* [PATCH] drm: Register the full minor range
@ 2026-09-03 15:57 Andrey Erokhin
0 siblings, 0 replies; only message in thread
From: Andrey Erokhin @ 2026-09-03 15:57 UTC (permalink / raw)
To: dri-devel
Cc: linux-kernel, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter,
Christian König, Michał Winiarski, stable
Commit 071d583e01c8 ("drm: Expand max DRM device number to full MINORBITS")
expanded DRM minor allocation to the full range provided by MINORBITS.
However, drm_core_init() still uses register_chrdev(),
which registers only minors 0 through 255.
Consequently, character-device lookup for a DRM minor greater than 255
fails with -ENXIO before drm_stub_open() can handle the open.
Register and unregister the full minor range explicitly.
Fixes: 071d583e01c8 ("drm: Expand max DRM device number to full MINORBITS")
Cc: stable@vger.kernel.org
Signed-off-by: Andrey Erokhin <language.lawyer@gmail.com>
---
drivers/gpu/drm/drm_drv.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
index c808958a2188..25819c88c627 100644
--- a/drivers/gpu/drm/drm_drv.c
+++ b/drivers/gpu/drm/drm_drv.c
@@ -1250,7 +1250,7 @@ static void drm_core_exit(void)
drm_privacy_screen_lookup_exit();
drm_panic_exit();
accel_core_exit();
- unregister_chrdev(DRM_MAJOR, "drm");
+ __unregister_chrdev(DRM_MAJOR, 0, MINORMASK + 1, "drm");
drm_debugfs_remove_root();
drm_sysfs_destroy();
WARN_ON(!xa_empty(&drm_minors_xa));
@@ -1273,7 +1273,7 @@ static int __init drm_core_init(void)
drm_debugfs_init_root();
drm_debugfs_bridge_params();
- ret = register_chrdev(DRM_MAJOR, "drm", &drm_stub_fops);
+ ret = __register_chrdev(DRM_MAJOR, 0, MINORMASK + 1, "drm", &drm_stub_fops);
if (ret < 0)
goto error;
--
2.55.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-09-03 15:58 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-03 15:57 [PATCH] drm: Register the full minor range Andrey Erokhin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®