mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] i2c: qcom-cci: enable SCL clock stretching in standard mode on CCI v2
@ 2026-09-14 13:23 Hitesh Patel
  2026-09-21 11:34 ` Konrad Dybcio
  2026-09-21 13:19 ` [PATCH v2] i2c: qcom-cci: always enable SCL clock stretching Hitesh Patel
  0 siblings, 2 replies; 8+ messages in thread
From: Hitesh Patel @ 2026-09-14 13:23 UTC (permalink / raw)
  To: Andi Shyti
  Cc: Loic Poulain, Robert Foss, linux-i2c, linux-arm-msm,
	linux-kernel, ravi, Hitesh Patel

The CCI v2 standard-mode (100 kHz) timing table leaves SCL clock
stretching disabled, unlike the fast-plus table for the same block.
A slave that holds SCL low is then not waited for: the master keeps
its own clock timing and the transfer fails with a NACK or returns
corrupt data.

This is hit with a camera reached through a GMSL serializer/
deserializer I2C tunnel (MAX9296A/MAX96717 on the RB3 Gen2 vision
mezzanine). The deserializer acknowledges the address locally, but
forwards the transaction over the coax link and stretches SCL until
the remote side has completed it, which takes well over one clock
period at 100 kHz. Without stretching the register reads of the
sensor behind the link intermittently return garbage and writes are
dropped, which shows up as random sensor init failures.

Clock stretching is part of the I2C specification for every speed
mode and a device that does not stretch is unaffected by enabling it,
so enable it for standard mode as it already is for fast-plus.

Signed-off-by: Hitesh Patel <hitesh@ebytelogic.com>
---
 drivers/i2c/busses/i2c-qcom-cci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-qcom-cci.c b/drivers/i2c/busses/i2c-qcom-cci.c
index 25b6e4e9e..327efa86f 100644
--- a/drivers/i2c/busses/i2c-qcom-cci.c
+++ b/drivers/i2c/busses/i2c-qcom-cci.c
@@ -723,7 +723,7 @@ static const struct cci_data cci_v2_data = {
 		.thd_dat = 22,
 		.thd_sta = 162,
 		.tbuf = 227,
-		.scl_stretch_en = 0,
+		.scl_stretch_en = 1,
 		.trdhld = 6,
 		.tsp = 3
 	},

base-commit: 68142f986ff04b2b70b31db00f719bf690f64a9a
-- 
2.43.0


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

end of thread, other threads:[~2026-10-06 13:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-14 13:23 [PATCH] i2c: qcom-cci: enable SCL clock stretching in standard mode on CCI v2 Hitesh Patel
2026-09-21 11:34 ` Konrad Dybcio
2026-09-21 12:36   ` Hitesh Patel
2026-09-21 13:19 ` [PATCH v2] i2c: qcom-cci: always enable SCL clock stretching Hitesh Patel
2026-09-28 23:37   ` Andi Shyti
2026-10-05  4:27     ` Hitesh Patel
2026-10-05  8:30   ` Loic Poulain
2026-10-06 13:58   ` Andi Shyti

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

all inboxes | Powered by JetHome®