This is a note to let you know that I've just added the patch titled drm/nouveau: use drm_dev_unplug() during device removal to the 5.15-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-nouveau-use-drm_dev_unplug-during-device-removal.patch and it can be found in the queue-5.15 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From aff2299e0d81b26304ccc6a1ec0170e437f38efc Mon Sep 17 00:00:00 2001 From: Jeremy Cline <jcline@xxxxxxxxxx> Date: Wed, 25 Nov 2020 15:26:46 -0500 Subject: drm/nouveau: use drm_dev_unplug() during device removal From: Jeremy Cline <jcline@xxxxxxxxxx> commit aff2299e0d81b26304ccc6a1ec0170e437f38efc upstream. Nouveau does not currently support hot-unplugging, but it still makes sense to switch from drm_dev_unregister() to drm_dev_unplug(). drm_dev_unplug() calls drm_dev_unregister() after marking the device as unplugged, but only after any device critical sections are finished. Since nouveau isn't using drm_dev_enter() and drm_dev_exit(), there are no critical sections so this is nearly functionally equivalent. However, the DRM layer does check to see if the device is unplugged, and if it is returns appropriate error codes. In the future nouveau can add critical sections in order to truly support hot-unplugging. Cc: stable@xxxxxxxxxxxxxxx # 5.4+ Signed-off-by: Jeremy Cline <jcline@xxxxxxxxxx> Reviewed-by: Lyude Paul <lyude@xxxxxxxxxx> Reviewed-by: Ben Skeggs <bskeggs@xxxxxxxxxx> Tested-by: Karol Herbst <kherbst@xxxxxxxxxx> Signed-off-by: Karol Herbst <kherbst@xxxxxxxxxx> Link: https://patchwork.freedesktop.org/patch/msgid/20201125202648.5220-2-jcline@xxxxxxxxxx Link: https://gitlab.freedesktop.org/drm/nouveau/-/merge_requests/14 Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/gpu/drm/nouveau/nouveau_drm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/gpu/drm/nouveau/nouveau_drm.c +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c @@ -798,7 +798,7 @@ nouveau_drm_device_remove(struct drm_dev struct nvkm_client *client; struct nvkm_device *device; - drm_dev_unregister(dev); + drm_dev_unplug(dev); client = nvxx_client(&drm->client.base); device = nvkm_device_find(client->device); Patches currently in stable-queue which might be from jcline@xxxxxxxxxx are queue-5.15/drm-nouveau-add-a-dedicated-mutex-for-the-clients-list.patch queue-5.15/drm-nouveau-clean-up-all-clients-on-device-removal.patch queue-5.15/drm-nouveau-use-drm_dev_unplug-during-device-removal.patch