From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eva Kurchatova Date: Fri, 21 Aug 2026 18:38:20 +0300 Subject: [Devel] [PATCH vz10] drm/virtio: decline the device with -ENODEV when modesetting is off Message-ID: <20260821153821.799764-1-eva.kurchatova@virtuozzo.com> List-Id: 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 --- 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