Thread (12 messages) read the whole thread 12 messages, 6 authors, 2025-03-30
STALE487d

Revision v1 of 3 in this series.

Revisions (3)
  1. v1 current
  2. v2 [diff vs current]
  3. v3 [diff vs current]

[PATCH 3/4] i2c: pasemi: Enable the unjam machine

From: Sven Peter via B4 Relay <devnull+sven.svenpeter.dev@kernel.org>
Date: 2025-02-22 13:38:42
Also in: asahi, b4-sent, linux-arm-kernel, linux-i2c, lkml
Subsystem: arm/apple machine support, i2c subsystem, i2c subsystem host drivers, linux for powerpc (32-bit and 64-bit), the rest · Maintainers: Sven Peter, Janne Grunau, Andi Shyti, Madhavan Srinivasan, Linus Torvalds

From: Hector Martin <redacted>

The I2C bus can get stuck under some conditions (desync between
controller and device). The pasemi controllers include an unjam feature
that is enabled on reset, but was being disabled by the driver. Keep it
enabled by explicitly setting the UJM bit in the CTL register. This
should help recover the bus from certain conditions, which would
otherwise remain stuck forever.

Signed-off-by: Hector Martin <redacted>
Signed-off-by: Sven Peter <redacted>
---
 drivers/i2c/busses/i2c-pasemi-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/i2c/busses/i2c-pasemi-core.c b/drivers/i2c/busses/i2c-pasemi-core.c
index 770b86b92a10..8f0ba975172f 100644
--- a/drivers/i2c/busses/i2c-pasemi-core.c
+++ b/drivers/i2c/busses/i2c-pasemi-core.c
@@ -73,7 +73,7 @@ static inline int reg_read(struct pasemi_smbus *smbus, int reg)
 
 static void pasemi_reset(struct pasemi_smbus *smbus)
 {
-	u32 val = (CTL_MTR | CTL_MRR | (smbus->clk_div & CTL_CLK_M));
+	u32 val = (CTL_MTR | CTL_MRR | CTL_UJM | (smbus->clk_div & CTL_CLK_M));
 
 	if (smbus->hw_rev >= 6)
 		val |= CTL_EN;
-- 
2.34.1


Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help