[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <eea1c5dc-6bc5-4246-f0e1-0c790de9f078@linaro.org>
Date: Fri, 13 Jan 2023 06:23:22 +0200
From: Dmitry Baryshkov <dmitry.baryshkov@...aro.org>
To: Bjorn Andersson <quic_bjorande@...cinc.com>,
Rob Clark <robdclark@...il.com>,
Abhinav Kumar <quic_abhinavk@...cinc.com>,
Johan Hovold <johan@...nel.org>
Cc: Sean Paul <sean@...rly.run>, David Airlie <airlied@...il.com>,
Daniel Vetter <daniel@...ll.ch>, linux-arm-msm@...r.kernel.org,
dri-devel@...ts.freedesktop.org, freedreno@...ts.freedesktop.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drm/msm: Initialize mode_config earlier
On 13/01/2023 06:10, Bjorn Andersson wrote:
> Invoking drm_bridge_hpd_notify() on a drm_bridge with a HPD-enabled
> bridge_connector ends up in drm_bridge_connector_hpd_cb() calling
> drm_kms_helper_hotplug_event(), which assumes that the associated
> drm_device's mode_config.funcs is a valid pointer.
>
> But in the MSM DisplayPort driver the HPD enablement happens at bind
> time and mode_config.funcs is initialized late in msm_drm_init(). This
> means that there's a window for hot plug events to dereference a NULL
> mode_config.funcs.
>
> Move the assignment of mode_config.funcs before the bind, to avoid this
> scenario.
Cam we make DP driver not to report HPD events until the enable_hpd()
was called? I think this is what was fixed by your internal_hpd patchset.
>
> Reported-by: Johan Hovold <johan@...nel.org>
> Signed-off-by: Bjorn Andersson <quic_bjorande@...cinc.com>
> ---
> drivers/gpu/drm/msm/msm_drv.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
> index ee2f60b6f09b..7ac670f3e6ab 100644
> --- a/drivers/gpu/drm/msm/msm_drv.c
> +++ b/drivers/gpu/drm/msm/msm_drv.c
> @@ -438,6 +438,9 @@ static int msm_drm_init(struct device *dev, const struct drm_driver *drv)
>
> drm_mode_config_init(ddev);
>
> + ddev->mode_config.funcs = &mode_config_funcs;
> + ddev->mode_config.helper_private = &mode_config_helper_funcs;
> +
> ret = msm_init_vram(ddev);
> if (ret)
> return ret;
> @@ -479,9 +482,6 @@ static int msm_drm_init(struct device *dev, const struct drm_driver *drv)
>
> drm_helper_move_panel_connectors_to_head(ddev);
>
> - ddev->mode_config.funcs = &mode_config_funcs;
> - ddev->mode_config.helper_private = &mode_config_helper_funcs;
> -
> for (i = 0; i < priv->num_crtcs; i++) {
> /* initialize event thread */
> priv->event_thread[i].crtc_id = priv->crtcs[i]->base.id;
--
With best wishes
Dmitry
Powered by blists - more mailing lists