summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/display/intel_display_core.h
diff options
context:
space:
mode:
authorImre Deak <imre.deak@intel.com>2022-10-25 14:44:55 +0300
committerImre Deak <imre.deak@intel.com>2022-10-26 15:51:13 +0300
commit89cb0ba4ceee6bed1059904859c5723b3f39da68 (patch)
tree106c89c68e62bab97ea14e174eddcf8eec039b74 /drivers/gpu/drm/i915/display/intel_display_core.h
parent0701c285087d79b44546e04dd13b9056443571a3 (diff)
downloadlinux-89cb0ba4ceee6bed1059904859c5723b3f39da68.tar.gz
linux-89cb0ba4ceee6bed1059904859c5723b3f39da68.tar.bz2
linux-89cb0ba4ceee6bed1059904859c5723b3f39da68.zip
drm/i915/tgl+: Add locking around DKL PHY register accesses
Accessing the TypeC DKL PHY registers during modeset-commit, -verification, DP link-retraining and AUX power well toggling is racy due to these code paths being concurrent and the PHY register bank selection register (HIP_INDEX_REG) being shared between PHY instances (aka TC ports) and the bank selection being not atomic wrt. the actual PHY register access. Add the required locking around each PHY register bank selection-> register access sequence. Kudos to Ville for noticing the race conditions. v2: - Add the DKL PHY register accessors to intel_dkl_phy.[ch]. (Jani) - Make the DKL_REG_TC_PORT macro independent of PHY internals. - Move initing the DKL PHY lock to a more logical place. v3: - Fix parameter reuse in the DKL_REG_TC_PORT definition. - Document the usage of phy_lock. v4: - Fix adding TC_PORT_1 offset in the DKL_REG_TC_PORT definition. Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Cc: Jani Nikula <jani.nikula@intel.com> Cc: <stable@vger.kernel.org> # v5.5+ Acked-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Imre Deak <imre.deak@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20221025114457.2191004-1-imre.deak@intel.com
Diffstat (limited to 'drivers/gpu/drm/i915/display/intel_display_core.h')
-rw-r--r--drivers/gpu/drm/i915/display/intel_display_core.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/display/intel_display_core.h b/drivers/gpu/drm/i915/display/intel_display_core.h
index b4b9c4cef78e..337d8e08ba43 100644
--- a/drivers/gpu/drm/i915/display/intel_display_core.h
+++ b/drivers/gpu/drm/i915/display/intel_display_core.h
@@ -321,6 +321,14 @@ struct intel_display {
} dbuf;
struct {
+ /*
+ * dkl.phy_lock protects against concurrent access of the
+ * Dekel TypeC PHYs.
+ */
+ spinlock_t phy_lock;
+ } dkl;
+
+ struct {
/* VLV/CHV/BXT/GLK DSI MMIO register base address */
u32 mmio_base;
} dsi;