[PATCH v3 6/7] drm/xe/tile: Abort driver load for sysfs creation failure

Ghimiray, Himal Prasad himal.prasad.ghimiray at intel.com
Fri Apr 12 15:39:59 UTC 2024


On 12-04-2024 19:02, Lucas De Marchi wrote:
> On Fri, Apr 12, 2024 at 01:32:44PM +0530, Himal Prasad Ghimiray wrote:
>> Ensure that the status of all tile associated sysfs entries creation is
>> relayed to xe_tile_init_noalloc, leading to a driver load abort if any
>> sysfs creation failures occur.
>>
>> Cc: Rodrigo Vivi <rodrigo.vivi at intel.com>
>> Cc: Lucas De Marchi <lucas.demarchi at intel.com>
>> Signed-off-by: Himal Prasad Ghimiray <himal.prasad.ghimiray at intel.com>
>> ---
>> drivers/gpu/drm/xe/xe_tile.c       |  2 +-
>> drivers/gpu/drm/xe/xe_tile_sysfs.c | 17 ++++++++---------
>> drivers/gpu/drm/xe/xe_tile_sysfs.h |  2 +-
>> drivers/gpu/drm/xe/xe_vram_freq.c  | 21 +++++++++------------
>> drivers/gpu/drm/xe/xe_vram_freq.h  |  2 +-
>> 5 files changed, 20 insertions(+), 24 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/xe/xe_tile.c b/drivers/gpu/drm/xe/xe_tile.c
>> index 0650b2fa75ef..409cf55aa8a1 100644
>> --- a/drivers/gpu/drm/xe/xe_tile.c
>> +++ b/drivers/gpu/drm/xe/xe_tile.c
>> @@ -173,7 +173,7 @@ int xe_tile_init_noalloc(struct xe_tile *tile)
>>     }
>>     xe_wa_apply_tile_workarounds(tile);
>>
>> -    xe_tile_sysfs_init(tile);
>> +    err = xe_tile_sysfs_init(tile);
>>
>> err_mem_access:
>>     xe_device_mem_access_put(tile_to_xe(tile));
>> diff --git a/drivers/gpu/drm/xe/xe_tile_sysfs.c 
>> b/drivers/gpu/drm/xe/xe_tile_sysfs.c
>> index 237a0761d3ad..3cd340984c34 100644
>> --- a/drivers/gpu/drm/xe/xe_tile_sysfs.c
>> +++ b/drivers/gpu/drm/xe/xe_tile_sysfs.c
>> @@ -29,7 +29,7 @@ static void tile_sysfs_fini(struct drm_device *drm, 
>> void *arg)
>>     kobject_put(tile->sysfs);
>> }
>>
>> -void xe_tile_sysfs_init(struct xe_tile *tile)
>> +int  xe_tile_sysfs_init(struct xe_tile *tile)
>> {
>>     struct xe_device *xe = tile_to_xe(tile);
>>     struct device *dev = xe->drm.dev;
>> @@ -38,7 +38,7 @@ void xe_tile_sysfs_init(struct xe_tile *tile)
>>
>>     kt = kzalloc(sizeof(*kt), GFP_KERNEL);
>>     if (!kt)
>> -        return;
>> +        return -ENOMEM;
>>
>>     kobject_init(&kt->base, &xe_tile_sysfs_kobj_type);
>>     kt->tile = tile;
>> @@ -46,16 +46,15 @@ void xe_tile_sysfs_init(struct xe_tile *tile)
>>     err = kobject_add(&kt->base, &dev->kobj, "tile%d", tile->id);
>>     if (err) {
>>         kobject_put(&kt->base);
>> -        drm_warn(&xe->drm, "failed to register TILE sysfs directory, 
>> err: %d\n", err);
>> -        return;
>> +        drm_err(&xe->drm, "failed to register TILE sysfs directory, 
>> err: %d\n", err);
>
> same comments here and below as previous patch
Noted.
>
> Lucas De Marchi


More information about the Intel-xe mailing list