linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Xin Ji <xji@analogixsemi.com>
To: Hsin-Yi Wang <hsinyi@chromium.org>
Cc: Robert Foss <robert.foss@linaro.org>,
	Andrzej Hajda <andrzej.hajda@intel.com>,
	Neil Armstrong <narmstrong@baylibre.com>,
	Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
	Jonas Karlman <jonas@kwiboo.se>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
	Sam Ravnborg <sam@ravnborg.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	Maxime Ripard <maxime@cerno.tech>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/4] drm/bridge: anx7625: Fix NULL pointer crash when using edp-panel
Date: Wed, 6 Jul 2022 10:31:48 +0800	[thread overview]
Message-ID: <20220706023148.GC2357796@anxtwsw-Precision-3640-Tower> (raw)
In-Reply-To: <20220629160550.433980-4-hsinyi@chromium.org>

Hi Hsin-Yi, thanks for your patch, it looks good to me.

Reviewed-by: Xin Ji <xji@analogixsemi.com>

Thanks,
Xin

On Thu, Jun 30, 2022 at 12:05:49AM +0800, Hsin-Yi Wang wrote:
> Move devm_of_dp_aux_populate_ep_devices() after pm runtime and i2c setup
> to avoid NULL pointer crash.
> 
> edp-panel probe (generic_edp_panel_probe) calls pm_runtime_get_sync() to
> read EDID. At this time, bridge should have pm runtime enabled and i2c
> clients ready.
> 
> Fixes: adca62ec370c ("drm/bridge: anx7625: Support reading edid through aux channel")
> Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
> ---
>  drivers/gpu/drm/bridge/analogix/anx7625.c | 17 +++++++++--------
>  1 file changed, 9 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c
> index 478f5af381c7d..59ddeba33652b 100644
> --- a/drivers/gpu/drm/bridge/analogix/anx7625.c
> +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c
> @@ -2590,14 +2590,6 @@ static int anx7625_i2c_probe(struct i2c_client *client,
>  	platform->aux.dev = dev;
>  	platform->aux.transfer = anx7625_aux_transfer;
>  	drm_dp_aux_init(&platform->aux);
> -	devm_of_dp_aux_populate_ep_devices(&platform->aux);
> -
> -	ret = anx7625_parse_dt(dev, pdata);
> -	if (ret) {
> -		if (ret != -EPROBE_DEFER)
> -			DRM_DEV_ERROR(dev, "fail to parse DT : %d\n", ret);
> -		goto free_wq;
> -	}
>  
>  	if (anx7625_register_i2c_dummy_clients(platform, client) != 0) {
>  		ret = -ENOMEM;
> @@ -2613,6 +2605,15 @@ static int anx7625_i2c_probe(struct i2c_client *client,
>  	if (ret)
>  		goto free_wq;
>  
> +	devm_of_dp_aux_populate_ep_devices(&platform->aux);
> +
> +	ret = anx7625_parse_dt(dev, pdata);
> +	if (ret) {
> +		if (ret != -EPROBE_DEFER)
> +			DRM_DEV_ERROR(dev, "fail to parse DT : %d\n", ret);
> +		goto free_wq;
> +	}
> +
>  	if (!platform->pdata.low_power_mode) {
>  		anx7625_disable_pd_protocol(platform);
>  		pm_runtime_get_sync(dev);
> -- 
> 2.37.0.rc0.161.g10f37bed90-goog

  reply	other threads:[~2022-07-06  2:32 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-29 16:05 [PATCH 0/4] anx7625: Cleanup, fixes, and implement wait_hpd_asserted Hsin-Yi Wang
2022-06-29 16:05 ` [PATCH 1/4] drm/bridge: anx7625: Convert to devm_i2c_new_dummy_device() Hsin-Yi Wang
2022-07-06  2:29   ` Xin Ji
2022-07-06 12:31     ` Robert Foss
2022-07-06 12:55       ` Hsin-Yi Wang
2022-06-29 16:05 ` [PATCH 2/4] drm/bridge: anx7625: Use pm_runtime_force_suspend(resume) Hsin-Yi Wang
2022-07-06  2:30   ` Xin Ji
2022-06-29 16:05 ` [PATCH 3/4] drm/bridge: anx7625: Fix NULL pointer crash when using edp-panel Hsin-Yi Wang
2022-07-06  2:31   ` Xin Ji [this message]
2022-06-29 16:05 ` [PATCH 4/4] drm/bridge: anx7625: Add wait_hpd_asserted() callback Hsin-Yi Wang
2022-07-06  2:32   ` Xin Ji

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=20220706023148.GC2357796@anxtwsw-Precision-3640-Tower \
    --to=xji@analogixsemi.com \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=airlied@linux.ie \
    --cc=andrzej.hajda@intel.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hsinyi@chromium.org \
    --cc=jernej.skrabec@gmail.com \
    --cc=jonas@kwiboo.se \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maxime@cerno.tech \
    --cc=narmstrong@baylibre.com \
    --cc=robert.foss@linaro.org \
    --cc=sam@ravnborg.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;
as well as URLs for NNTP newsgroup(s).