Skip to contentSkip to conversation

phy: rockchip: inno-hdmi: Fix missing readl base addr

PATCH In review Jagan Teki 2 participants 2 messages Jun 22, 2024 – Jul 16, 2024

Subsystems (2)
lore
Share & tools
lore

Jagan Teki

author
#0 lore raw

PATCH 1/1 phy: rockchip: inno-hdmi: Fix missing readl base addr

inno_poll passes the reg offset that is used by readl_poll_sleep_timeout without any base addr.

Fix it.

Bug:
inno_hdmi_phy phy@ff430000: Pre-PLL locking failed inno_hdmi_phy phy@ff430000: PHY: Failed to power on phy@ff430000: -110. failed to power on phy (ret=-110)
inno_hdmi_phy phy@ff430000: Pre-PLL locking failed inno_hdmi_phy phy@ff430000: PHY: Failed to power on phy@ff430000: -110. failed to power on phy (ret=-110)

Fixes aa2271184603 ("phy: rockchip: Add Rockchip INNO HDMI PHY driver")
---
 drivers/phy/rockchip/phy-rockchip-inno-hdmi.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/phy/rockchip/phy-rockchip-inno-hdmi.c +4 -4
index 3bb1a254ff..7459779dff 100644
@@ -432,8 +432,8 @@ static inline void inno_update_bits(struct inno_hdmi_phy *inno, u8 reg,
 	inno_write(inno, reg, tmp);
 }
 
-#define inno_poll(reg, val, cond, sleep_us, timeout_us) \
-	readl_poll_sleep_timeout((reg) * 4, val, cond, sleep_us, timeout_us)
+#define inno_poll(inno, reg, val, cond, sleep_us, timeout_us) \
+	readl_poll_sleep_timeout((inno)->regs + ((reg) * 4), val, cond, sleep_us, timeout_us)
 
 static unsigned long inno_hdmi_phy_get_tmdsclk(struct inno_hdmi_phy *inno,
 					       unsigned long rate)
@@ -575,7 +575,7 @@ inno_hdmi_phy_rk3328_clk_set_rate(struct phy *phy,
 	inno_update_bits(inno, 0xa0, RK3328_PRE_PLL_POWER_DOWN, 0);
 
 	/* Wait for Pre-PLL lock */
-	ret = inno_poll(0xa9, val, val & RK3328_PRE_PLL_LOCK_STATUS,
+	ret = inno_poll(inno, 0xa9, val, val & RK3328_PRE_PLL_LOCK_STATUS,
 			1000, 10000);
 	if (ret) {
 		dev_err(phy->dev, "Pre-PLL locking failed\n");
@@ -674,7 +674,7 @@ inno_hdmi_phy_rk3328_power_on(struct phy *phy,
 			 RK3328_TMDS_DRIVER_ENABLE);
 
 	/* Wait for post PLL lock */
-	ret = inno_poll(0xaf, v, v & RK3328_POST_PLL_LOCK_STATUS,
+	ret = inno_poll(inno, 0xaf, v, v & RK3328_POST_PLL_LOCK_STATUS,
 			1000, 10000);
 	if (ret) {
 		dev_err(phy->dev, "Post-PLL locking failed\n");
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 13 lines · Jagan Teki

inno_poll passes the reg offset that is used by readl_poll_sleep_timeout without any base addr.

Fix it.

Bug:
inno_hdmi_phy phy@ff430000: Pre-PLL locking failed inno_hdmi_phy phy@ff430000: PHY: Failed to power on phy@ff430000: -110. failed to power on phy (ret=-110)
inno_hdmi_phy phy@ff430000: Pre-PLL locking failed inno_hdmi_phy phy@ff430000: PHY: Failed to power on phy@ff430000: -110. failed to power on phy (ret=-110)

Quoted 3 lines
Fixes aa2271184603 ("phy: rockchip: Add Rockchip INNO HDMI PHY driver")

Thanks,
- Kever

Quoted 37 lines
---
  drivers/phy/rockchip/phy-rockchip-inno-hdmi.c | 8 ++++----
  1 file changed, 4 insertions(+), 4 deletions(-)
drivers/phy/rockchip/phy-rockchip-inno-hdmi.c +4 -4
index 3bb1a254ff..7459779dff 100644
@@ -432,8 +432,8 @@ static inline void inno_update_bits(struct inno_hdmi_phy *inno, u8 reg,
  	inno_write(inno, reg, tmp);
  }
 
-#define inno_poll(reg, val, cond, sleep_us, timeout_us) \
-	readl_poll_sleep_timeout((reg) * 4, val, cond, sleep_us, timeout_us)
+#define inno_poll(inno, reg, val, cond, sleep_us, timeout_us) \
+	readl_poll_sleep_timeout((inno)->regs + ((reg) * 4), val, cond, sleep_us, timeout_us)
 
  static unsigned long inno_hdmi_phy_get_tmdsclk(struct inno_hdmi_phy *inno,
  					       unsigned long rate)
@@ -575,7 +575,7 @@ inno_hdmi_phy_rk3328_clk_set_rate(struct phy *phy,
  	inno_update_bits(inno, 0xa0, RK3328_PRE_PLL_POWER_DOWN, 0);
 
  	/* Wait for Pre-PLL lock */
-	ret = inno_poll(0xa9, val, val & RK3328_PRE_PLL_LOCK_STATUS,
+	ret = inno_poll(inno, 0xa9, val, val & RK3328_PRE_PLL_LOCK_STATUS,
  			1000, 10000);
  	if (ret) {
  		dev_err(phy->dev, "Pre-PLL locking failed\n");
@@ -674,7 +674,7 @@ inno_hdmi_phy_rk3328_power_on(struct phy *phy,
  			 RK3328_TMDS_DRIVER_ENABLE);
 
  	/* Wait for post PLL lock */
-	ret = inno_poll(0xaf, v, v & RK3328_POST_PLL_LOCK_STATUS,
+	ret = inno_poll(inno, 0xaf, v, v & RK3328_POST_PLL_LOCK_STATUS,
  			1000, 10000);
  	if (ret) {
  		dev_err(phy->dev, "Post-PLL locking failed\n");