OpenVZ / Virtuozzo kernel development (devel@openvz.org)
 help / color / mirror / Atom feed
* [Devel] [PATCH vz10] drm/virtio: decline the device with -ENODEV when modesetting is off
@ 2026-08-21 15:38 Eva Kurchatova
  2026-08-24  8:49 ` Vasileios Almpanis
  2026-08-24 17:03 ` [Devel] [PATCH vz10 v2] drm: " Konstantin Khorenko
  0 siblings, 2 replies; 4+ messages in thread
From: Eva Kurchatova @ 2026-08-21 15:38 UTC (permalink / raw)


Our kernels disable modesetting by default, see 7932a11226c8 ("drm:
Disable modeset by default"), so on a machine that was not booted with
"modeset" every KMS driver declines the device it was offered. Of 23
existing upstream drm drivers, 21 report -ENODEV in such case, which
really_probe() reports as "rejects match" at debug level. virtio_gpu
returns -EINVAL instead, which the same function reports as

  virtio_gpu virtio0: probe with driver virtio_gpu failed with error -22

at error level, for a device the driver was never going to drive. It is
the only device error in the log of an otherwise healthy machine, and
the devices/error_logs selftest reports it, correctly.

Return -ENODEV, as the other drivers do. Nothing else changes: the probe
still does not happen and no drm device appears.

https://virtuozzo.atlassian.net/browse/VSTOR-139680
Feature: fix vz kernel
Signed-off-by: Eva Kurchatova <eva.kurchatova@virtuozzo.com>
---
 drivers/gpu/drm/virtio/virtgpu_drv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.c b/drivers/gpu/drm/virtio/virtgpu_drv.c
index 71c6ccad4b99..c9deef9f8af0 100644
--- a/drivers/gpu/drm/virtio/virtgpu_drv.c
+++ b/drivers/gpu/drm/virtio/virtgpu_drv.c
@@ -76,10 +76,10 @@ static int virtio_gpu_probe(struct virtio_device *vdev)
 	int ret;
 
 	if (drm_firmware_drivers_only() && virtio_gpu_modeset == -1)
-		return -EINVAL;
+		return -ENODEV;
 
 	if (virtio_gpu_modeset == 0)
-		return -EINVAL;
+		return -ENODEV;
 
 	/*
 	 * The virtio-gpu device is a virtual device that doesn't have DMA
-- 
2.55.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Devel] [PATCH vz10] drm/virtio: decline the device with -ENODEV when modesetting is off
  2026-08-21 15:38 [Devel] [PATCH vz10] drm/virtio: decline the device with -ENODEV when modesetting is off Eva Kurchatova
@ 2026-08-24  8:49 ` Vasileios Almpanis
  2026-08-24 17:03 ` [Devel] [PATCH vz10 v2] drm: " Konstantin Khorenko
  1 sibling, 0 replies; 4+ messages in thread
From: Vasileios Almpanis @ 2026-08-24  8:49 UTC (permalink / raw)


> Our kernels disable modesetting by default, see 7932a11226c8 ("drm:
checkpatch.pl complains about description style here.
Please use git commit description style 'commit <12+ chars of sha1>
> Disable modeset by default"), so on a machine that was not booted with
> "modeset" every KMS driver declines the device it was offered. Of 23
> existing upstream drm drivers, 21 report -ENODEV in such case, which
> really_probe() reports as "rejects match" at debug level. virtio_gpu
> returns -EINVAL instead, which the same function reports as
> 
>   virtio_gpu virtio0: probe with driver virtio_gpu failed with error -22
> 
> at error level, for a device the driver was never going to drive. It is
> the only device error in the log of an otherwise healthy machine, and
> the devices/error_logs selftest reports it, correctly.
> 
> Return -ENODEV, as the other drivers do. Nothing else changes: the probe
> still does not happen and no drm device appears.
> 
> https://virtuozzo.atlassian.net/browse/VSTOR-139680
> Feature: fix vz kernel
Please add Fixes tag.

-- 
Vasileios Almpanis <vasileios.almpanis@virtuozzo.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Devel] [PATCH vz10 v2] drm: decline the device with -ENODEV when modesetting is off
  2026-08-21 15:38 [Devel] [PATCH vz10] drm/virtio: decline the device with -ENODEV when modesetting is off Eva Kurchatova
  2026-08-24  8:49 ` Vasileios Almpanis
@ 2026-08-24 17:03 ` Konstantin Khorenko
  2026-08-24 17:04   ` [Devel] [PATCH RHEL10 COMMIT] " Konstantin Khorenko
  1 sibling, 1 reply; 4+ messages in thread
From: Konstantin Khorenko @ 2026-08-24 17:03 UTC (permalink / raw)


From: Eva Kurchatova <eva.kurchatova@virtuozzo.com>

Our kernels disable modesetting by default, see commit 7932a11226c8
("drm: Disable modeset by default"), so on a machine that was not booted
with "modeset" every KMS driver declines the device it was offered.
Almost all of them report -ENODEV in such case, which really_probe()
reports as "rejects match" at debug level. virtio_gpu and amdgpu return
-EINVAL instead, which the same function reports as

  virtio_gpu virtio0: probe with driver virtio_gpu failed with error -22

at error level, for a device the driver was never going to drive. It is
the only device error in the log of an otherwise healthy machine, and
the devices/error_logs selftest reports it, correctly.

Return -ENODEV, as the other drivers do. Nothing else changes: the probe
still does not happen and no drm device appears.

Fixes: 7932a11226c8 ("drm: Disable modeset by default")
https://virtuozzo.atlassian.net/browse/VSTOR-139680
Feature: fix drivers
Signed-off-by: Eva Kurchatova <eva.kurchatova@virtuozzo.com>
Signed-off-by: Konstantin Khorenko <khorenko@virtuozzo.com>
---
Changes in v2:
- fix amdgpu as well. It has the same -EINVAL after the same
  drm_firmware_drivers_only() check, so on a machine with an AMD card it
  produces the same error level message. virtio_gpu was not the only
  driver out of line.
- drop the driver counts from the commit message. The exact numbers
  depend on how one counts, since some drivers call the helper without a
  return next to it, and they go stale with every new driver.
- subject: drm/virtio -> drm, the patch is no longer about one driver.
- add a Fixes: tag, and the "commit" before the referenced sha1 that
  checkpatch asks for.

 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 2 +-
 drivers/gpu/drm/virtio/virtgpu_drv.c    | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
index 7333e19291cf..2e1e77380f50 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -2325,7 +2325,7 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
 	if ((pdev->class >> 8) == PCI_CLASS_DISPLAY_VGA ||
 	    (pdev->class >> 8) == PCI_CLASS_DISPLAY_OTHER) {
 		if (drm_firmware_drivers_only() && amdgpu_modeset == -1)
-			return -EINVAL;
+			return -ENODEV;
 	}
 
 	/* skip devices which are owned by radeon */
diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.c b/drivers/gpu/drm/virtio/virtgpu_drv.c
index 71c6ccad4b99..c9deef9f8af0 100644
--- a/drivers/gpu/drm/virtio/virtgpu_drv.c
+++ b/drivers/gpu/drm/virtio/virtgpu_drv.c
@@ -76,10 +76,10 @@ static int virtio_gpu_probe(struct virtio_device *vdev)
 	int ret;
 
 	if (drm_firmware_drivers_only() && virtio_gpu_modeset == -1)
-		return -EINVAL;
+		return -ENODEV;
 
 	if (virtio_gpu_modeset == 0)
-		return -EINVAL;
+		return -ENODEV;
 
 	/*
 	 * The virtio-gpu device is a virtual device that doesn't have DMA
-- 
2.47.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Devel] [PATCH RHEL10 COMMIT] drm: decline the device with -ENODEV when modesetting is off
  2026-08-24 17:03 ` [Devel] [PATCH vz10 v2] drm: " Konstantin Khorenko
@ 2026-08-24 17:04   ` Konstantin Khorenko
  0 siblings, 0 replies; 4+ messages in thread
From: Konstantin Khorenko @ 2026-08-24 17:04 UTC (permalink / raw)


The commit is pushed to "branch-rh10-6.12.0-211.39.1.16.x.vz10-ovz" and will appear at git at bitbucket.org:openvz/vzkernel.git
after rh10-6.12.0-211.39.1.16.8.vz10
------>
commit 3125c1f2930d389cb5a4bdf58859eb404bc16391
Author: Eva Kurchatova <eva.kurchatova@virtuozzo.com>
Date:   Fri Aug 21 18:38:20 2026 +0300

    drm: decline the device with -ENODEV when modesetting is off
    
    Our kernels disable modesetting by default, see commit 7932a11226c8
    ("drm: Disable modeset by default"), so on a machine that was not booted
    with "modeset" every KMS driver declines the device it was offered.
    Almost all of them report -ENODEV in such case, which really_probe()
    reports as "rejects match" at debug level. virtio_gpu and amdgpu return
    -EINVAL instead, which the same function reports as
    
      virtio_gpu virtio0: probe with driver virtio_gpu failed with error -22
    
    at error level, for a device the driver was never going to drive. It is
    the only device error in the log of an otherwise healthy machine, and
    the devices/error_logs selftest reports it, correctly.
    
    Return -ENODEV, as the other drivers do. Nothing else changes: the probe
    still does not happen and no drm device appears.
    
    Fixes: 7932a11226c8 ("drm: Disable modeset by default")
    https://virtuozzo.atlassian.net/browse/VSTOR-139680
    Feature: fix drivers
    Signed-off-by: Eva Kurchatova <eva.kurchatova@virtuozzo.com>
    Signed-off-by: Konstantin Khorenko <khorenko@virtuozzo.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 2 +-
 drivers/gpu/drm/virtio/virtgpu_drv.c    | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
index 7333e19291cf..2e1e77380f50 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -2325,7 +2325,7 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
 	if ((pdev->class >> 8) == PCI_CLASS_DISPLAY_VGA ||
 	    (pdev->class >> 8) == PCI_CLASS_DISPLAY_OTHER) {
 		if (drm_firmware_drivers_only() && amdgpu_modeset == -1)
-			return -EINVAL;
+			return -ENODEV;
 	}
 
 	/* skip devices which are owned by radeon */
diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.c b/drivers/gpu/drm/virtio/virtgpu_drv.c
index 71c6ccad4b99..c9deef9f8af0 100644
--- a/drivers/gpu/drm/virtio/virtgpu_drv.c
+++ b/drivers/gpu/drm/virtio/virtgpu_drv.c
@@ -76,10 +76,10 @@ static int virtio_gpu_probe(struct virtio_device *vdev)
 	int ret;
 
 	if (drm_firmware_drivers_only() && virtio_gpu_modeset == -1)
-		return -EINVAL;
+		return -ENODEV;
 
 	if (virtio_gpu_modeset == 0)
-		return -EINVAL;
+		return -ENODEV;
 
 	/*
 	 * The virtio-gpu device is a virtual device that doesn't have DMA

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-08-24 17:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-21 15:38 [Devel] [PATCH vz10] drm/virtio: decline the device with -ENODEV when modesetting is off Eva Kurchatova
2026-08-24  8:49 ` Vasileios Almpanis
2026-08-24 17:03 ` [Devel] [PATCH vz10 v2] drm: " Konstantin Khorenko
2026-08-24 17:04   ` [Devel] [PATCH RHEL10 COMMIT] " Konstantin Khorenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox