drm/i915/hdcp: Get conn while content_type changed
authorAnshuman Gupta <anshuman.gupta@intel.com>
Mon, 11 Jan 2021 08:11:03 +0000 (13:41 +0530)
committerAnshuman Gupta <anshuman.gupta@intel.com>
Wed, 13 Jan 2021 02:59:31 +0000 (08:29 +0530)
Get DRM connector reference count while scheduling a prop work
to avoid any possible destroy of DRM connector when it is in
DRM_CONNECTOR_REGISTERED state.

Fixes: a6597faa2d59 ("drm/i915: Protect workers against disappearing connectors")
Cc: Sean Paul <seanpaul@chromium.org>
Cc: Ramalingam C <ramalingam.c@intel.com>
Reviewed-by: Uma Shankar <uma.shankar@intel.com>
Reviewed-by: Ramalingam C <ramalingam.c@intel.com>
Tested-by: Karthik B S <karthik.b.s@intel.com>
Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210111081120.28417-3-anshuman.gupta@intel.com
drivers/gpu/drm/i915/display/intel_hdcp.c

index eee8263405b9fabb1f7b03f9e9972fab649ca965..b9d8825e2bb12f397ea31cee5b2288d6995a0fd0 100644 (file)
@@ -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);
        }