Skip to content

drm/nouveau: Fixup module probe to add ->shutdown()

Lyude Paul dri-devel lkml nouveau 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3drm/nouveau: Fix potential memory leak in nouveau_drm_load()drivers/gpu/drm/nouveau/nouveau_drm.c+4 -20 replies
2/3drm/nouveau: Start using new drm_dev initialization helpersdrivers/gpu/drm/nouveau/nouveau_drm.c+101 -720 replies
3/3drm/nouveau: Shut down GPU on kernel shutdowndrivers/gpu/drm/nouveau/nouveau_drm.c+1 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] drm/nouveau: Fixup module probe to add ->shutdown()

This series is intended to add support for shutting down the GPU on kernel shutdown/reboot using the ->shutdown() hook, similar to what amdgpu does. This is mainly intended to workaround a bios issue on the P50 that was preventing nouveau from initializing the dedicated GM107 GPU on that system properly. You can find more details on this issue in the patch labeled "Shut down GPU on kernel shutdown".

Doing this so that it wouldn't race with userspace took a little bit of work (and uncovered one small bug in the process). Mainly, I had to convert nouveau to use the new drm_dev_alloc() and drm_dev_register() helpers to ensure that there isn't any chance that we can race with userspace during shutdown. This also involved removing ->load() and ->unload() and moving their work into nouveau_drm_probe().

============================== IMPORTANT =============================== This patch series WILL NOT WORK PROPERLY unless you also apply the following patches which fix some leftover device removal issues:

https://patchwork.freedesktop.org/series/48596/
This fixes kernel panics on removal on systems with nvidia controlled backlights

https://patchwork.freedesktop.org/series/47843/
This fixes issues with DRM connectors getting leaked on device removal, due to hpd_work still being active when unloading nouveau.

============================== IMPORTANT ===============================

This also uncovered one small bug in nouveau_drm_load().

Lyude Paul (3):
drm/nouveau: Fix potential memory leak in nouveau_drm_load() drm/nouveau: Start using new drm_dev initialization helpers drm/nouveau: Shut down GPU on kernel shutdown

 drivers/gpu/drm/nouveau/nouveau_drm.c | 180 +++++++++++++++-----------
 1 file changed, 106 insertions(+), 74 deletions(-)
Signature · 1 line
2.17.1