Re: [PATCH v6] drm/msm/dp: stop event kernel thread when DP unbind

From: Stephen Boyd
Date: Fri Apr 15 2022 - 15:48:18 EST


Quoting Kuogee Hsieh (2022-04-15 08:41:16)
> diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c
> index 01453db..92c9819 100644
> --- a/drivers/gpu/drm/msm/dp/dp_display.c
> +++ b/drivers/gpu/drm/msm/dp/dp_display.c
> @@ -230,6 +231,14 @@ void dp_display_signal_audio_complete(struct msm_dp *dp_display)
> complete_all(&dp->audio_comp);
> }
>
> +static void dp_hpd_event_thread_stop(struct dp_display_private *dp_priv)
> +{
> + kthread_stop(dp_priv->ev_tsk);
> +
> +}
> +
> +static int dp_hpd_event_thread_start(struct dp_display_private *dp_priv);
> +
> static int dp_display_bind(struct device *dev, struct device *master,
> void *data)
> {
> @@ -280,6 +290,9 @@ static void dp_display_unbind(struct device *dev, struct device *master,
> struct drm_device *drm = dev_get_drvdata(master);
> struct msm_drm_private *priv = drm->dev_private;
>
> + /* disable all HPD interrupts */
> + dp_catalog_hpd_config_intr(dp->catalog, DP_DP_HPD_INT_MASK, false);
> + dp_hpd_event_thread_stop(dp);

It's a one line function. How about just

kthread_stop(dp->ev_tsk)

> dp_power_client_deinit(dp->power);
> dp_aux_unregister(dp->aux);
> priv->dp[dp->id] = NULL;