]> www.infradead.org Git - users/jedix/linux-maple.git/commit
drm/msm/dsi/phy: Protect PHY_CMN_CLK_CFG0 updated from driver side
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Fri, 14 Feb 2025 15:08:41 +0000 (16:08 +0100)
committerAbhinav Kumar <quic_abhinavk@quicinc.com>
Sat, 15 Feb 2025 19:46:42 +0000 (11:46 -0800)
commit588257897058a0b1aa47912db4fe93c6ff5e3887
treeec1151d2c364fc721c4674c6abcf2ca51da02ba2
parent5e192eefebaab5bdcf716add8910d7f8a2e30e3c
drm/msm/dsi/phy: Protect PHY_CMN_CLK_CFG0 updated from driver side

PHY_CMN_CLK_CFG0 register is updated by the PHY driver and by two
divider clocks from Common Clock Framework:
devm_clk_hw_register_divider_parent_hw().  Concurrent access by the
clocks side is protected with spinlock, however driver's side in
restoring state is not.  Restoring state is called from
msm_dsi_phy_enable(), so there could be a path leading to concurrent and
conflicting updates with clock framework.

Add missing lock usage on the PHY driver side, encapsulated in its own
function so the code will be still readable.

While shuffling the code, define and use PHY_CMN_CLK_CFG0 bitfields to
make the code more readable and obvious.

Fixes: 1ef7c99d145c ("drm/msm/dsi: add support for 7nm DSI PHY/PLL")
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/637376/
Link: https://lore.kernel.org/r/20250214-drm-msm-phy-pll-cfg-reg-v3-1-0943b850722c@linaro.org
Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
drivers/gpu/drm/msm/dsi/phy/dsi_phy_7nm.c
drivers/gpu/drm/msm/registers/display/dsi_phy_7nm.xml