diff mbox series

drm/i915: Acquire connector reference before prop_work

Message ID 20201027103335.3725-1-srinivasx.k@intel.com
State New, archived
Headers show
Series drm/i915: Acquire connector reference before prop_work | expand

Commit Message

K, SrinivasX Oct. 27, 2020, 10:33 a.m. UTC
From: Srinivas Kamati <srinivasx.k@intel.com>

"Content protection type change" igt test results in kernel
taint. Everytime after prop_work is done we are also
giving up connector reference, which is resulting in ref
count underrun.

Before scheduling prop_work acquire connector reference.

Cc: Sean Paul <seanpaul@chromium.org>
Cc: Ramalingam C <ramalingam.c@intel.com>
Signed-off-by: Srinivas Kamati <srinivasx.k@intel.com>
---
 drivers/gpu/drm/i915/display/intel_hdcp.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Anshuman Gupta Oct. 28, 2020, 9:04 a.m. UTC | #1
On 2020-10-27 at 16:03:35 +0530, Kamati Srinivas wrote:
> From: Srinivas Kamati <srinivasx.k@intel.com>
> 
> "Content protection type change" igt test results in kernel
> taint. Everytime after prop_work is done we are also
> giving up connector reference, which is resulting in ref
> count underrun.
> 
> Before scheduling prop_work acquire connector reference.
I has been alreayd taken care at 
https://patchwork.freedesktop.org/patch/397215/?series=82998&rev=2
> 
> Cc: Sean Paul <seanpaul@chromium.org>
> Cc: Ramalingam C <ramalingam.c@intel.com>
> Signed-off-by: Srinivas Kamati <srinivasx.k@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_hdcp.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.c b/drivers/gpu/drm/i915/display/intel_hdcp.c
> index b2a4bbcfdcd2..beedd672b21e 100644
> --- a/drivers/gpu/drm/i915/display/intel_hdcp.c
> +++ b/drivers/gpu/drm/i915/display/intel_hdcp.c
> @@ -2210,6 +2210,7 @@ void intel_hdcp_update_pipe(struct intel_atomic_state *state,
>  	if (content_protection_type_changed) {
>  		mutex_lock(&hdcp->mutex);
>  		hdcp->value = DRM_MODE_CONTENT_PROTECTION_DESIRED;
> +		drm_connector_get(&connector->base);
>  		schedule_work(&hdcp->prop_work);
>  		mutex_unlock(&hdcp->mutex);
>  	}
> -- 
> 2.25.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
K, SrinivasX Oct. 28, 2020, 9:22 a.m. UTC | #2
++Tejas

-----Original Message-----
From: Anshuman Gupta <anshuman.gupta@intel.com> 
Sent: 28 October 2020 14:35
To: K, SrinivasX <srinivasx.k@intel.com>
Cc: intel-gfx@lists.freedesktop.org; seanpaul@chromium.org; Pandey, Hariom <hariom.pandey@intel.com>
Subject: Re: [Intel-gfx] drm/i915: Acquire connector reference before prop_work

On 2020-10-27 at 16:03:35 +0530, Kamati Srinivas wrote:
> From: Srinivas Kamati <srinivasx.k@intel.com>
> 
> "Content protection type change" igt test results in kernel taint. 
> Everytime after prop_work is done we are also giving up connector 
> reference, which is resulting in ref count underrun.
> 
> Before scheduling prop_work acquire connector reference.
I has been alreayd taken care at
https://patchwork.freedesktop.org/patch/397215/?series=82998&rev=2
> 
> Cc: Sean Paul <seanpaul@chromium.org>
> Cc: Ramalingam C <ramalingam.c@intel.com>
> Signed-off-by: Srinivas Kamati <srinivasx.k@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_hdcp.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.c 
> b/drivers/gpu/drm/i915/display/intel_hdcp.c
> index b2a4bbcfdcd2..beedd672b21e 100644
> --- a/drivers/gpu/drm/i915/display/intel_hdcp.c
> +++ b/drivers/gpu/drm/i915/display/intel_hdcp.c
> @@ -2210,6 +2210,7 @@ void intel_hdcp_update_pipe(struct intel_atomic_state *state,
>  	if (content_protection_type_changed) {
>  		mutex_lock(&hdcp->mutex);
>  		hdcp->value = DRM_MODE_CONTENT_PROTECTION_DESIRED;
> +		drm_connector_get(&connector->base);
>  		schedule_work(&hdcp->prop_work);
>  		mutex_unlock(&hdcp->mutex);
>  	}
> --
> 2.25.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.c b/drivers/gpu/drm/i915/display/intel_hdcp.c
index b2a4bbcfdcd2..beedd672b21e 100644
--- a/drivers/gpu/drm/i915/display/intel_hdcp.c
+++ b/drivers/gpu/drm/i915/display/intel_hdcp.c
@@ -2210,6 +2210,7 @@  void intel_hdcp_update_pipe(struct intel_atomic_state *state,
 	if (content_protection_type_changed) {
 		mutex_lock(&hdcp->mutex);
 		hdcp->value = DRM_MODE_CONTENT_PROTECTION_DESIRED;
+		drm_connector_get(&connector->base);
 		schedule_work(&hdcp->prop_work);
 		mutex_unlock(&hdcp->mutex);
 	}