mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-23 08:25:58 -04:00
drm/xe/pcode: Don't ignore drmm_mutex_init failure
The drm_device-managed mutex_init might fail and return an error. Add proper error handling. While around, update the function name to clearly indicate this is an early software-only initialization. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Link: https://patch.msgid.link/20260529195956.25349-1-michal.wajdeczko@intel.com
This commit is contained in:
@@ -323,15 +323,17 @@ int xe_pcode_ready(struct xe_device *xe, bool locked)
|
||||
}
|
||||
|
||||
/**
|
||||
* xe_pcode_init: initialize components of PCODE
|
||||
* xe_pcode_init_early() - Initialize components of PCODE
|
||||
* @tile: tile instance
|
||||
*
|
||||
* This function initializes the xe_pcode component.
|
||||
* To be called once only during probe.
|
||||
*
|
||||
* Return: 0 on success or a negative error code on failure.
|
||||
*/
|
||||
void xe_pcode_init(struct xe_tile *tile)
|
||||
int xe_pcode_init_early(struct xe_tile *tile)
|
||||
{
|
||||
drmm_mutex_init(&tile_to_xe(tile)->drm, &tile->pcode.lock);
|
||||
return drmm_mutex_init(&tile_to_xe(tile)->drm, &tile->pcode.lock);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -12,7 +12,7 @@ struct drm_device;
|
||||
struct xe_device;
|
||||
struct xe_tile;
|
||||
|
||||
void xe_pcode_init(struct xe_tile *tile);
|
||||
int xe_pcode_init_early(struct xe_tile *tile);
|
||||
int xe_pcode_probe_early(struct xe_device *xe);
|
||||
int xe_pcode_ready(struct xe_device *xe, bool locked);
|
||||
int xe_pcode_init_min_freq_table(struct xe_tile *tile, u32 min_gt_freq,
|
||||
|
||||
@@ -157,7 +157,9 @@ int xe_tile_init_early(struct xe_tile *tile, struct xe_device *xe, u8 id)
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
xe_pcode_init(tile);
|
||||
err = xe_pcode_init_early(tile);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user