Patch "drm/xe/mmio: move mmio_fini over to devm" has been added to the 6.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    drm/xe/mmio: move mmio_fini over to devm

to the 6.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     drm-xe-mmio-move-mmio_fini-over-to-devm.patch
and it can be found in the queue-6.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 3ee036f86d3041441eeda0b64c2f4920cf53464f
Author: Matthew Auld <matthew.auld@xxxxxxxxx>
Date:   Wed May 22 11:21:57 2024 +0100

    drm/xe/mmio: move mmio_fini over to devm
    
    [ Upstream commit a0b834c8957a7d2848face008a12382a0ad11ffc ]
    
    Not valid to touch mmio once the device is removed, so make sure we
    unmap on removal and not just when driver instance goes away. Also set
    the mmio pointers to NULL to hopefully catch such issues more easily.
    
    Signed-off-by: Matthew Auld <matthew.auld@xxxxxxxxx>
    Cc: Andrzej Hajda <andrzej.hajda@xxxxxxxxx>
    Cc: Rodrigo Vivi <rodrigo.vivi@xxxxxxxxx>
    Reviewed-by: Andrzej Hajda <andrzej.hajda@xxxxxxxxx>
    Link: https://patchwork.freedesktop.org/patch/msgid/20240522102143.128069-32-matthew.auld@xxxxxxxxx
    Stable-dep-of: 15939ca77d44 ("drm/xe: Fix tile fini sequence")
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/gpu/drm/xe/xe_mmio.c b/drivers/gpu/drm/xe/xe_mmio.c
index 334637511e750..2ebb2f0d6874e 100644
--- a/drivers/gpu/drm/xe/xe_mmio.c
+++ b/drivers/gpu/drm/xe/xe_mmio.c
@@ -386,13 +386,16 @@ void xe_mmio_probe_tiles(struct xe_device *xe)
 	}
 }
 
-static void mmio_fini(struct drm_device *drm, void *arg)
+static void mmio_fini(void *arg)
 {
 	struct xe_device *xe = arg;
 
 	pci_iounmap(to_pci_dev(xe->drm.dev), xe->mmio.regs);
 	if (xe->mem.vram.mapping)
 		iounmap(xe->mem.vram.mapping);
+
+	xe->mem.vram.mapping = NULL;
+	xe->mmio.regs = NULL;
 }
 
 int xe_mmio_init(struct xe_device *xe)
@@ -417,7 +420,7 @@ int xe_mmio_init(struct xe_device *xe)
 	root_tile->mmio.size = SZ_16M;
 	root_tile->mmio.regs = xe->mmio.regs;
 
-	return drmm_add_action_or_reset(&xe->drm, mmio_fini, xe);
+	return devm_add_action_or_reset(xe->drm.dev, mmio_fini, xe);
 }
 
 u8 xe_mmio_read8(struct xe_gt *gt, struct xe_reg reg)




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux