Skip to content

Commit

Permalink
drm/xe/guc: move guc_fini over to devm
Browse files Browse the repository at this point in the history
Make sure to actually call this when the device is removed. Currently we
only trigger it when the driver instance goes away, but that doesn't
work too well with hotunplug, since device can be removed and re-probed
with a new driver instance, where the guc_fini() is called too late.
Move the fini over to devm to ensure this is called when device is
removed.

References: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/1717
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Andrzej Hajda <andrzej.hajda@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240522102143.128069-22-matthew.auld@intel.com
  • Loading branch information
Matthew Auld committed May 22, 2024
1 parent 3a1c27c commit 241f5d2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/gpu/drm/xe/xe_guc.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ static void guc_write_params(struct xe_guc *guc)
xe_mmio_write32(gt, SOFT_SCRATCH(1 + i), guc->params[i]);
}

static void guc_fini(struct drm_device *drm, void *arg)
static void guc_fini(void *arg)
{
struct xe_guc *guc = arg;
struct xe_gt *gt = guc_to_gt(guc);
Expand Down Expand Up @@ -349,7 +349,7 @@ int xe_guc_init(struct xe_guc *guc)
if (ret)
goto out;

ret = drmm_add_action_or_reset(&xe->drm, guc_fini, guc);
ret = devm_add_action_or_reset(xe->drm.dev, guc_fini, guc);
if (ret)
goto out;

Expand Down

0 comments on commit 241f5d2

Please sign in to comment.