ARM Sunxi Platform Development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Lyude Paul" <lyude@redhat.com>
Cc: linux-hyperv@vger.kernel.org, intel-xe@lists.freedesktop.org,
	Frank.Li@kernel.org, linux-sunxi@lists.linux.dev,
	imx@lists.linux.dev, linux-amlogic@lists.infradead.org,
	neil.armstrong@linaro.org, wsa+renesas@sang-engineering.com,
	dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 3/5] drm/vblank: Remove num_crtcs argument from drm_vblank_init()
Date: Fri, 14 Aug 2026 20:51:45 +0000	[thread overview]
Message-ID: <20260814205146.560FA1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260814203542.1405135-4-lyude@redhat.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Critical] drm_vblank_init() returns -ENODEV causing probe failures in multiple drivers
--

--- Patch [3]: [PATCH 3/5] drm/vblank: Remove num_crtcs argument from drm_vblank_init() ---
commit 049e1e142facf2bbdd92cd8a8847a53f6b18b3aa
Author: Lyude Paul <lyude@redhat.com>

drm/vblank: Remove num_crtcs argument from drm_vblank_init()

This commit removes the num_crtcs argument from drm_vblank_init() and
updates callers across the tree to rely on the internal DRM count of CRTCs
instead. The change was applied mechanically using a Coccinelle patch.

> diff --git a/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c b/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c
> index d4577663a1f0e..ba78695d1015c 100644
> --- a/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c
> +++ b/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c
> @@ -205,7 +205,7 @@ static int aspeed_gfx_load(struct drm_device *drm)
>  	if (ret < 0)
>  		return ret;
>  
> -	ret = drm_vblank_init(drm, 1);
> +	ret = drm_vblank_init(drm);

[Severity: Critical]
Will this cause a probe regression for this driver?

By removing the explicit CRTC count, drm_vblank_init() now relies on the
DRM device's internal CRTC list being populated. However, aspeed_gfx_load()
calls drm_vblank_init() before calling aspeed_gfx_create_pipe(), which is
where the CRTC is actually created.

Because the CRTC list is empty at this point, drm_vblank_init() will
return -ENODEV and fail the probe.

>  	if (ret < 0) {
>  		dev_err(drm->dev, "Failed to initialise vblank\n");
>  		return ret;

> [ ... ]

> diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c
> index 9228a7ad0dfa4..c9e29da53d056 100644
> --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c
> +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c
> @@ -888,7 +888,7 @@ int rcar_du_modeset_init(struct rcar_du_device *rcdu)
>  	 * Initialize vertical blanking interrupts handling. Start with vblank
>  	 * disabled for all CRTCs.
>  	 */
> -	ret = drm_vblank_init(dev, rcdu->num_crtcs);
> +	ret = drm_vblank_init(dev);

[Severity: Critical]
Does this introduce a similar regression for rcar-du?

The driver calls drm_vblank_init() here, but the CRTCs are not created
until the rcar_du_crtc_create() loop further down. This means
drm_vblank_init() will see an empty CRTC list and fail with -ENODEV.

>  	if (ret < 0)
>  		return ret;

> [ ... ]

> diff --git a/drivers/gpu/drm/vkms/vkms_drv.c b/drivers/gpu/drm/vkms/vkms_drv.c
> index 5a640b531d88f..5a830cee7fe9b 100644
> --- a/drivers/gpu/drm/vkms/vkms_drv.c
> +++ b/drivers/gpu/drm/vkms/vkms_drv.c
> @@ -192,8 +192,7 @@ int vkms_create(struct vkms_config *config)
>  		goto out_devres;
>  	}
>  
> -	ret = drm_vblank_init(&vkms_device->drm,
> -			      vkms_config_get_num_crtcs(config));
> +	ret = drm_vblank_init(&vkms_device->drm);

[Severity: Critical]
Can this lead to a complete initialization failure for vkms?

The call to drm_vblank_init() occurs before vkms_modeset_init(), meaning
the pipeline components have not been created yet and the internal CRTC
count is zero.

>  	if (ret) {
>  		DRM_ERROR("Failed to vblank\n");
>  		goto out_devres;

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260814203542.1405135-1-lyude@redhat.com?part=3

  reply	other threads:[~2026-08-14 20:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-14 20:35 [PATCH 0/5] drm/vblank: Enforce all-or-nothing vblank support Lyude Paul
2026-08-14 20:35 ` [PATCH 1/5] drm/vblank: Add drm_device.has_hw_vblank Lyude Paul
2026-08-14 20:35 ` [PATCH 2/5] drm/vblank: Remove drm->num_crtcs Lyude Paul
2026-08-14 20:35 ` [PATCH 3/5] drm/vblank: Remove num_crtcs argument from drm_vblank_init() Lyude Paul
2026-08-14 20:51   ` sashiko-bot [this message]
2026-08-14 20:35 ` [PATCH 4/5] drm/vblank: Use drm_for_each_crtc() in drm_vblank_init() Lyude Paul
2026-08-14 20:56   ` sashiko-bot
2026-08-14 20:35 ` [PATCH 5/5] drm/vblank: Require all CRTCs implement vblank support " Lyude Paul
2026-08-14 21:08   ` sashiko-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260814205146.560FA1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=Frank.Li@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=imx@lists.linux.dev \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=lyude@redhat.com \
    --cc=neil.armstrong@linaro.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=wsa+renesas@sang-engineering.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox