mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Luca Ceresoli" <luca.ceresoli@bootlin.com>
To: "Osama Abdelkader" <osama.abdelkader@gmail.com>,
	<luca.ceresoli@bootlin.com>, "Linus Walleij" <linusw@kernel.org>,
	"Neil Armstrong" <neil.armstrong@linaro.org>,
	"Jessica Zhang" <jesszhan0024@gmail.com>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Maxime Ripard" <mripard@kernel.org>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	"David Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>,
	"Cristian Cozzolino" <cristian_ci@protonmail.com>,
	"Sumit Semwal" <sumit.semwal@linaro.org>,
	"Krzysztof Kozlowski" <krzk@kernel.org>,
	"Robert Chiras" <robert.chiras@nxp.com>,
	<dri-devel@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v4 3/6] drm/panel: Use managed helpers in Novatek and Raydium panels
Date: Tue, 25 Aug 2026 17:59:56 +0200	[thread overview]
Message-ID: <DKY5EGQY76J8.QI8G5V87V6X1@bootlin.com> (raw)
In-Reply-To: <20260812145910.69509-1-osama.abdelkader@gmail.com>

Hello Osama,

On Wed Aug 12, 2026 at 4:59 PM CEST, Osama Abdelkader wrote:
> Use the managed MIPI DSI attach and panel add helpers in Novatek and
> Raydium panel drivers and drop the corresponding manual detach and panel
> remove calls from remove paths.
>
> Suggested-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
> Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com>

...

> --- a/drivers/gpu/drm/panel/panel-novatek-nt35510.c
> +++ b/drivers/gpu/drm/panel/panel-novatek-nt35510.c
> @@ -1173,13 +1173,11 @@ static int nt35510_probe(struct mipi_dsi_device *dsi)
>  		nt->panel.backlight = bl;
>  	}
>
> -	drm_panel_add(&nt->panel);
> -
> -	ret = mipi_dsi_attach(dsi);
> -	if (ret < 0)
> -		drm_panel_remove(&nt->panel);
> +	ret = devm_drm_panel_add(dev, &nt->panel);
> +	if (ret)
> +		return ret;
>
> -	return 0;
> +	return devm_mipi_dsi_attach(dev, dsi);
>  }
>
>  static void nt35510_remove(struct mipi_dsi_device *dsi)
> @@ -1187,13 +1185,10 @@ static void nt35510_remove(struct mipi_dsi_device *dsi)
>  	struct nt35510 *nt = mipi_dsi_get_drvdata(dsi);
>  	int ret;
>
> -	mipi_dsi_detach(dsi);
>  	/* Power off */
>  	ret = nt35510_power_off(nt);
>  	if (ret)
>  		dev_err(&dsi->dev, "Failed to power off\n");
> -
> -	drm_panel_remove(&nt->panel);
>  }

This will change the removal sequence, from

  mipi_dsi_detach, nt35510_power_off, drm_panel_remove

to

  nt35510_power_off, mipi_dsi_detach, drm_panel_remove

Can this create issues? In a doubt, we shouldn't change the sequence.

Adding an explicit devm action to call nt35510_power_off in the correct
sequence is a possible way out. But perhaps it's safer and simpler if you
just change drm_panel_remove() to devm, not mipi_dsi_attach().

The rest of the patch LGTM.

> --- a/drivers/gpu/drm/panel/panel-novatek-nt36672a.c
> +++ b/drivers/gpu/drm/panel/panel-novatek-nt36672a.c
> @@ -428,9 +428,7 @@ static int nt36672a_panel_add(struct nt36672a_panel *pinfo)

Looking at this driver, the code split between nt36672a_panel_probe() and
nt36672a_panel_add() appears very arbitrary. Definitely unrelated to your
patch however, just thinking out loud, no need to change your patch about
this.

Luca

--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

      parent reply	other threads:[~2026-08-25 16:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-12 14:59 Osama Abdelkader
2026-08-17 12:53 ` Linus Walleij
2026-08-25 15:59 ` Luca Ceresoli [this message]

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=DKY5EGQY76J8.QI8G5V87V6X1@bootlin.com \
    --to=luca.ceresoli@bootlin.com \
    --cc=airlied@gmail.com \
    --cc=cristian_ci@protonmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jesszhan0024@gmail.com \
    --cc=krzk@kernel.org \
    --cc=linusw@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=osama.abdelkader@gmail.com \
    --cc=robert.chiras@nxp.com \
    --cc=simona@ffwll.ch \
    --cc=sumit.semwal@linaro.org \
    --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 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®