All of lore.kernel.org
 help / color / mirror / Atom feed
From: Liviu Dudau <Liviu.Dudau@arm.com>
To: Maxime Ripard <mripard@kernel.org>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	dri-devel@lists.freedesktop.org, sashiko-bot@kernel.org
Subject: Re: [PATCH v2 03/64] drm/hdlcd: Fix drm_atomic_helper_shutdown() on the probe error path
Date: Mon, 16 Nov 2026 18:10:52 +0000	[thread overview]
Message-ID: <avtHLCDADPo05tTy@e142607> (raw)
In-Reply-To: <20261116-drm-no-more-config-reset-v2-3-0bb471f4d1e0@kernel.org>

On Mon, Nov 16, 2026 at 11:30:19AM +0100, Maxime Ripard wrote:
> The hdlcd_probe() error paths for pm_runtime_set_active() and
> drm_vblank_init() fall through to the err_pm_active label, which calls
> drm_atomic_helper_shutdown().
> 
> However, both calls happen before drm_mode_config_reset(), so the CRTC
> state is still NULL at that point. drm_atomic_helper_shutdown() will
> then go through drm_atomic_helper_disable_all() and
> drm_atomic_get_crtc_state() to drm_atomic_helper_crtc_duplicate_state(),
> which trips its WARN_ON(!crtc->state) and returns an error.
> 
> Move drm_atomic_helper_shutdown() to the err_register label, the only
> error path where drm_mode_config_reset() has run and thus where
> shutting the device down makes sense. This also brings the error path
> closer to hdlcd_remove(), which calls drm_atomic_helper_shutdown()
> while runtime PM is still enabled.
> 
> The pm_runtime_set_active() error path now jumps directly to
> err_unload: runtime PM hasn't been enabled at that point, so calling
> pm_runtime_disable() there wasn't needed either.
> 
> It will also be needed when drm_mode_config_reset() gets replaced by
> drm_mode_config_create_initial_state(), whose state allocation can
> fail.
> 
> Fixes: d664b851eb2bc ("drm/arm/hdlcd: Reject atomic commits that disable only the plane")
> Reported-by: sashiko-bot@kernel.org
> Link: https://lore.kernel.org/r/sashiko-outbox-199498@kernel.org
> Signed-off-by: Maxime Ripard <mripard@kernel.org>

Something seems to have broken down in your setup as I've only been
Cc-ed on patch 04/64, discovered this one during a search.

Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>

Best regards,
Liviu

> ---
>  drivers/gpu/drm/arm/hdlcd_drv.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c
> index 340b1bb38bf9..f2bf9a61979d 100644
> --- a/drivers/gpu/drm/arm/hdlcd_drv.c
> +++ b/drivers/gpu/drm/arm/hdlcd_drv.c
> @@ -297,11 +297,11 @@ static int hdlcd_probe(struct platform_device *pdev)
>  		goto err_unload;
>  	}
>  
>  	ret = pm_runtime_set_active(dev);
>  	if (ret)
> -		goto err_pm_active;
> +		goto err_unload;
>  
>  	pm_runtime_enable(dev);
>  
>  	ret = drm_vblank_init(drm, drm->mode_config.num_crtc);
>  	if (ret < 0) {
> @@ -333,14 +333,13 @@ static int hdlcd_probe(struct platform_device *pdev)
>  
>  	return 0;
>  
>  err_register:
>  	drm_kms_helper_poll_fini(drm);
> +	drm_atomic_helper_shutdown(drm);
>  err_vblank:
>  	pm_runtime_disable(drm->dev);
> -err_pm_active:
> -	drm_atomic_helper_shutdown(drm);
>  err_unload:
>  	hdlcd_irq_uninstall(hdlcd);
>  	of_reserved_mem_device_release(drm->dev);
>  err_free:
>  	dev_set_drvdata(dev, NULL);
> 
> -- 
> 2.56.1
> 

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯

  reply	other threads:[~2026-11-16 18:11 UTC|newest]

Thread overview: 87+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16 10:30 [PATCH v2 00/64] drm: Switch drivers to drm_mode_config_create_initial_state Maxime Ripard
2026-11-16 10:30 ` Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 01/64] drm/adp: Switch " Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 02/64] drm/amdgpu: " Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 03/64] drm/hdlcd: Fix drm_atomic_helper_shutdown() on the probe error path Maxime Ripard
2026-11-16 18:10   ` Liviu Dudau [this message]
2026-11-16 10:30 ` [PATCH v2 04/64] drm/hdlcd: Switch to drm_mode_config_create_initial_state Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 05/64] drm/armada: " Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 06/64] drm/ast: " Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 07/64] drm/exynos: " Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 08/64] drm/fsl-dcu: " Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 09/64] drm/hisilicon/hibmc: Remove hibmc_unload() from the load error path Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 10/64] drm/hisilicon/hibmc: Switch to drm_mode_config_create_initial_state Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 11/64] drm/hyperv: " Maxime Ripard
2026-11-17 13:07   ` Hamza Mahfooz
2026-11-16 10:30 ` [PATCH v2 12/64] drm/imx/ipuv3: " Maxime Ripard
2026-11-16 11:40   ` Philipp Zabel
2026-11-16 10:30 ` [PATCH v2 13/64] drm/ingenic: Move the private object creation before the reset Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 14/64] drm/ingenic: Switch to drm_mode_config_create_initial_state Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 15/64] drm/kmb: " Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 16/64] drm/logicvc: " Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 17/64] drm/loongson: " Maxime Ripard
2026-11-16 10:53   ` sashiko-bot
2026-11-16 10:30 ` [PATCH v2 18/64] drm/mediatek: " Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 19/64] drm/mgag200: " Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 20/64] drm/msm: " Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 21/64] drm/nouveau: " Maxime Ripard
2026-11-16 10:30   ` Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 22/64] drm/omap: " Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 23/64] drm/qxl: Destroy the monitors object on the modeset init error path Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 24/64] drm/qxl: Switch to drm_mode_config_create_initial_state Maxime Ripard
2026-11-16 10:52   ` sashiko-bot
2026-11-16 10:30 ` [PATCH v2 25/64] drm/rcar-du: " Maxime Ripard
2026-11-17 23:53   ` Laurent Pinchart
2026-11-16 10:30 ` [PATCH v2 26/64] drm/rz-du: " Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 27/64] drm/shmobile: " Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 28/64] drm/st7571: " Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 29/64] drm/st7586: " Maxime Ripard
2026-11-17 14:03   ` David Lechner
2026-11-16 10:30 ` [PATCH v2 30/64] drm/st7735r: " Maxime Ripard
2026-11-17 14:03   ` David Lechner
2026-11-16 10:30 ` [PATCH v2 31/64] drm/st7920: " Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 32/64] drm/sprd: " Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 33/64] drm/sti: Fix drm_atomic_helper_shutdown() on the bind error paths Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 34/64] drm/sti: Move drm_mode_config_create_initial_state() before drm_dev_register() Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 35/64] drm/stm: Switch to drm_mode_config_create_initial_state Maxime Ripard
2026-11-16 14:50   ` Raphael Gallais-Pou
2026-11-16 10:30 ` [PATCH v2 36/64] drm/sun4i: " Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 37/64] drm/tegra: " Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 38/64] drm/tests: drm_atomic_state_test: " Maxime Ripard
2026-11-16 10:55   ` sashiko-bot
2026-11-16 10:30 ` [PATCH v2 39/64] drm/tests: drm_atomic_test: " Maxime Ripard
2026-11-16 10:53   ` sashiko-bot
2026-11-16 10:30 ` [PATCH v2 40/64] drm/tests: drm_bridge_test: " Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 41/64] drm/tests: drm_hdmi_state_helper_test: " Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 42/64] drm/tidss: " Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 43/64] drm/tilcdc: " Maxime Ripard
2026-11-16 11:10   ` sashiko-bot
2026-11-16 10:31 ` [PATCH v2 44/64] drm/arcpgu: " Maxime Ripard
2026-11-16 10:31 ` [PATCH v2 45/64] drm/bochs: " Maxime Ripard
2026-11-16 10:55   ` sashiko-bot
2026-11-16 10:31 ` [PATCH v2 46/64] drm/cirrus-qemu: " Maxime Ripard
2026-11-16 10:54   ` sashiko-bot
2026-11-16 10:31 ` [PATCH v2 47/64] drm/gm12u320: " Maxime Ripard
2026-11-16 10:31 ` [PATCH v2 48/64] drm/hx8357d: " Maxime Ripard
2026-11-16 10:31 ` [PATCH v2 49/64] drm/ili9163: " Maxime Ripard
2026-11-16 10:31 ` [PATCH v2 50/64] drm/ili9225: " Maxime Ripard
2026-11-17 14:03   ` David Lechner
2026-11-16 10:31 ` [PATCH v2 51/64] drm/ili9341: " Maxime Ripard
2026-11-16 10:31 ` [PATCH v2 52/64] drm/ili9486: " Maxime Ripard
2026-11-16 10:31 ` [PATCH v2 53/64] drm/mi0283qt: " Maxime Ripard
2026-11-16 10:31 ` [PATCH v2 54/64] drm/panel-mipi-dbi: " Maxime Ripard
2026-11-16 10:31 ` [PATCH v2 55/64] drm/pixpaper: " Maxime Ripard
2026-11-16 10:31 ` [PATCH v2 56/64] drm/repaper: " Maxime Ripard
2026-11-16 10:31 ` [PATCH v2 57/64] drm/sharp-memory: " Maxime Ripard
2026-11-16 10:31 ` [PATCH v2 58/64] drm/udl: " Maxime Ripard
2026-11-16 10:31 ` [PATCH v2 59/64] drm/vboxvideo: " Maxime Ripard
2026-11-16 10:31 ` [PATCH v2 60/64] drm/verisilicon: " Maxime Ripard
2026-11-16 10:31 ` [PATCH v2 61/64] drm/virtio: " Maxime Ripard
2026-11-16 11:01   ` sashiko-bot
2026-11-16 10:31 ` [PATCH v2 62/64] drm/vmwgfx: " Maxime Ripard
2026-11-16 11:08   ` sashiko-bot
2026-11-17  6:52   ` Zack Rusin
2026-11-16 10:31 ` [PATCH v2 63/64] drm/xen: " Maxime Ripard
2026-11-16 10:31 ` [PATCH v2 64/64] drm/xlnx: " Maxime Ripard
2026-11-17 13:22 ` [PATCH v2 00/64] drm: Switch drivers " Thomas Zimmermann
2026-11-17 13:22   ` Thomas Zimmermann

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=avtHLCDADPo05tTy@e142607 \
    --to=liviu.dudau@arm.com \
    --cc=airlied@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=sashiko-bot@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=tzimmermann@suse.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.