All of lore.kernel.org
 help / color / mirror / Atom feed
From: Neil Armstrong <neil.armstrong@linaro.org>
To: Johan Hovold <johan@kernel.org>,
	Jessica Zhang <jesszhan0024@gmail.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>
Cc: David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/panel-simple: take i2c adapter module reference
Date: Fri, 2 Oct 2026 16:02:30 +0200	[thread overview]
Message-ID: <e37d41db-5218-494e-96fe-bbf4e028763e@linaro.org> (raw)
In-Reply-To: <20260716132334.1565183-1-johan@kernel.org>

On 7/16/26 15:23, Johan Hovold wrote:
> The i2c subsystem currently blocks during adapter deregistration
> whenever there are consumers holding a reference.
> 
> Switch to using of_get_i2c_adapter_by_node() which also takes a
> reference to the adapter module so that an attempt to unload the module
> while in use fails gracefully instead of blocking uninterruptibly.
> 
> Signed-off-by: Johan Hovold <johan@kernel.org>
> ---
>   drivers/gpu/drm/panel/panel-simple.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
> index c09bf3db5e78..f58e83aa4ebe 100644
> --- a/drivers/gpu/drm/panel/panel-simple.c
> +++ b/drivers/gpu/drm/panel/panel-simple.c
> @@ -701,7 +701,7 @@ static struct panel_simple *panel_simple_probe(struct device *dev)
>   
>   	ddc = of_parse_phandle(dev->of_node, "ddc-i2c-bus", 0);
>   	if (ddc) {
> -		panel->ddc = of_find_i2c_adapter_by_node(ddc);
> +		panel->ddc = of_get_i2c_adapter_by_node(ddc);
>   		of_node_put(ddc);
>   
>   		if (!panel->ddc)
> @@ -746,7 +746,7 @@ static struct panel_simple *panel_simple_probe(struct device *dev)
>   	pm_runtime_disable(dev);
>   free_ddc:
>   	if (panel->ddc)
> -		put_device(&panel->ddc->dev);
> +		i2c_put_adapter(panel->ddc);
>   
>   	return ERR_PTR(err);
>   }
> @@ -791,7 +791,7 @@ static void panel_simple_remove(struct device *dev)
>   	pm_runtime_dont_use_autosuspend(dev);
>   	pm_runtime_disable(dev);
>   	if (panel->ddc)
> -		put_device(&panel->ddc->dev);
> +		i2c_put_adapter(panel->ddc);
>   }
>   
>   static const struct drm_display_mode ampire_am_1280800n3tzqw_t00h_mode = {

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

Thanks,
Neil

      parent reply	other threads:[~2026-10-02 14:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-16 13:23 [PATCH] drm/panel-simple: take i2c adapter module reference Johan Hovold
2026-07-16 13:49 ` sashiko-bot
2026-08-12 14:12 ` Johan Hovold
2026-10-01 13:01   ` Johan Hovold
2026-11-17 11:49   ` Johan Hovold
2026-11-18  4:24     ` Doug Anderson
2026-11-18  7:17       ` Johan Hovold
2026-10-02 14:02 ` Neil Armstrong [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=e37d41db-5218-494e-96fe-bbf4e028763e@linaro.org \
    --to=neil.armstrong@linaro.org \
    --cc=airlied@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jesszhan0024@gmail.com \
    --cc=johan@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@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.