The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] phy: rockchip-samsung-dcphy: fix out-of-range max_register
@ 2026-08-11  8:10 Jason Yang via B4 Relay
  2026-08-11  9:58 ` Sebastian Reichel
  0 siblings, 1 reply; 2+ messages in thread
From: Jason Yang via B4 Relay @ 2026-08-11  8:10 UTC (permalink / raw)
  To: Vinod Koul
  Cc: Neil Armstrong, Heiko Stuebner, Sebastian Reichel, linux-phy,
	linux-arm-kernel, linux-rockchip, linux-kernel, stable,
	Jason Yang

From: Jason Yang <jason98166@gmail.com>

The PHY register block is 64KB, so with a register stride of 4 the
last accessible register sits at offset 0xfffc. max_register names
0x10000, one register past the end of the mapping: dumping the
registers through the regmap debugfs interface reads beyond the
ioremapped region and oopses on the unmapped page. The oops fires
with the regmap lock held, so later PHY operations deadlock.

Fixes: b2a1a2ae7818 ("phy: rockchip: Add Samsung MIPI D-/C-PHY driver")
Cc: stable@vger.kernel.org
Signed-off-by: Jason Yang <jason98166@gmail.com>
Assisted-by: Claude:claude-opus-5
---
Observed on an RK3588 board (v7.2-rc4): reading the debugfs
registers file for this PHY faults deterministically at offset
0x10000 (translation fault in regmap_mmio_read32le), and every
later PHY operation then blocks on the leaked lock. With
max_register corrected the dump walks 0x0000-0xfffc and completes,
and the PHY keeps working afterwards.

Growing the mapping is not an option: the TRM address map lists
each MIPI CD PHY as a 64KB block and the second PHY starts at the
next 64KB boundary, so offset 0x10000 of one PHY is register zero
of the other.

The same mistake was fixed the same way in c7d436a6c1a2
("dmaengine: xilinx: xdma: Fix regmap max_register").

This is independent of the D-PHY receiver series for the same
driver and applies in either order.
---
 drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c b/drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c
index cbd780556da8..18f5f582d1d7 100644
--- a/drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c
+++ b/drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c
@@ -1526,7 +1526,7 @@ static const struct regmap_config samsung_mipi_dcphy_regmap_config = {
 	.reg_bits = 32,
 	.val_bits = 32,
 	.reg_stride = 4,
-	.max_register = 0x10000,
+	.max_register = 0xfffc,
 };
 
 static struct phy *samsung_mipi_dcphy_xlate(struct device *dev,

---
base-commit: 1590cf0329716306e948a8fc29f1d3ee87d3989f
change-id: 20260811-dcphy-maxreg-v1-74a99944cf52

Best regards,
-- 
Jason Yang <jason98166@gmail.com>



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-08-11  9:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-11  8:10 [PATCH] phy: rockchip-samsung-dcphy: fix out-of-range max_register Jason Yang via B4 Relay
2026-08-11  9:58 ` Sebastian Reichel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox