* [PATCH 0/2] i2c: qcom-cci: Add DT property for SCL clock stretching
@ 2026-03-05 14:40 Cory Keitz via B4 Relay
2026-03-05 14:40 ` [PATCH 1/2] dt-bindings: i2c: qcom-cci: Document qcom,scl-stretch-enable property Cory Keitz via B4 Relay
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Cory Keitz via B4 Relay @ 2026-03-05 14:40 UTC (permalink / raw)
To: Loic Poulain, Robert Foss, Andi Shyti, Rob Herring,
Krzysztof Kozlowski, Conor Dooley
Cc: linux-arm-msm, linux-i2c, devicetree, linux-kernel, Cory Keitz
The Qualcomm CCI I2C controller has an SCL clock stretch enable bit in
the MISC_CTL register. Currently the driver hardcodes this off in
per-SoC hw_params tables, with no way to enable it from the device tree
on a per-master basis.
Clock stretching is required for GMSL configurations where the
deserializer uses it to absorb the latency imposed by forwarding I2C
transactions across the serial link. Without it, the CCI master exhibits
intermittent transaction failure.
This series adds a "qcom,scl-stretch-enable" boolean DT property to
individual CCI i2c-bus sub-nodes. The property ORs with the existing
hw_params default so it is purely additive and does not affect masters
that do not set it.
Tested on sa8775p using the qcom,sm8250-cci compatible string with two
CCI buses connected to one max96724/max96717 GMSL2 pair each. Enabling
this property eliminated intermittent NACK errors during serializer
and/or deserializer probe.
Signed-off-by: Cory Keitz <ckeitz@amazon.com>
---
Cory Keitz (2):
dt-bindings: i2c: qcom-cci: Document qcom,scl-stretch-enable property
i2c: qcom-cci: Add DT property for SCL clock stretching
Documentation/devicetree/bindings/i2c/qcom,i2c-cci.yaml | 8 ++++++++
drivers/i2c/busses/i2c-qcom-cci.c | 7 ++++++-
2 files changed, 14 insertions(+), 1 deletion(-)
---
base-commit: ecc64d2dc9ff9738d2a896beb68e02c2feaf9a02
change-id: 20260304-cci-scl-stretch-e20060685476
Best regards,
--
Cory Keitz <ckeitz@amazon.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/2] dt-bindings: i2c: qcom-cci: Document qcom,scl-stretch-enable property
2026-03-05 14:40 [PATCH 0/2] i2c: qcom-cci: Add DT property for SCL clock stretching Cory Keitz via B4 Relay
@ 2026-03-05 14:40 ` Cory Keitz via B4 Relay
2026-03-05 15:18 ` Krzysztof Kozlowski
2026-03-05 14:40 ` [PATCH 2/2] i2c: qcom-cci: Add DT property for SCL clock stretching Cory Keitz via B4 Relay
2026-03-05 15:16 ` [PATCH 0/2] " Loic Poulain
2 siblings, 1 reply; 8+ messages in thread
From: Cory Keitz via B4 Relay @ 2026-03-05 14:40 UTC (permalink / raw)
To: Loic Poulain, Robert Foss, Andi Shyti, Rob Herring,
Krzysztof Kozlowski, Conor Dooley
Cc: linux-arm-msm, linux-i2c, devicetree, linux-kernel, Cory Keitz
From: Cory Keitz <ckeitz@amazon.com>
Add the optional boolean property "qcom,scl-stretch-enable" to the
CCI i2c-bus sub-nodes. This property enables SCL clock stretching on
the corresponding CCI master, which is needed by peripherals such as
GMSL deserializers that hold SCL low to absorb forwarding latency.
Signed-off-by: Cory Keitz <ckeitz@amazon.com>
---
Documentation/devicetree/bindings/i2c/qcom,i2c-cci.yaml | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/Documentation/devicetree/bindings/i2c/qcom,i2c-cci.yaml b/Documentation/devicetree/bindings/i2c/qcom,i2c-cci.yaml
index 399a09409e07..fea609fa2f05 100644
--- a/Documentation/devicetree/bindings/i2c/qcom,i2c-cci.yaml
+++ b/Documentation/devicetree/bindings/i2c/qcom,i2c-cci.yaml
@@ -78,6 +78,14 @@ patternProperties:
clock-frequency:
default: 100000
+ qcom,scl-stretch-enable:
+ type: boolean
+ description:
+ Enable SCL clock stretching on this CCI master. When set, the
+ CCI hardware will assert the SCL stretch enable bit in the
+ MISC_CTL register, allowing peripherals to hold SCL low to
+ throttle the bus.
+
required:
- compatible
- clock-names
--
2.47.3
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 2/2] i2c: qcom-cci: Add DT property for SCL clock stretching
2026-03-05 14:40 [PATCH 0/2] i2c: qcom-cci: Add DT property for SCL clock stretching Cory Keitz via B4 Relay
2026-03-05 14:40 ` [PATCH 1/2] dt-bindings: i2c: qcom-cci: Document qcom,scl-stretch-enable property Cory Keitz via B4 Relay
@ 2026-03-05 14:40 ` Cory Keitz via B4 Relay
2026-03-05 15:16 ` [PATCH 0/2] " Loic Poulain
2 siblings, 0 replies; 8+ messages in thread
From: Cory Keitz via B4 Relay @ 2026-03-05 14:40 UTC (permalink / raw)
To: Loic Poulain, Robert Foss, Andi Shyti, Rob Herring,
Krzysztof Kozlowski, Conor Dooley
Cc: linux-arm-msm, linux-i2c, devicetree, linux-kernel, Cory Keitz
From: Cory Keitz <ckeitz@amazon.com>
The CCI hardware supports an SCL clock stretch enable bit in the
MISC_CTL register, but the driver hardcodes it off for most SoC
variants. This makes the bus driver unstable for configurations which
rely on clock stretching. Notably, GMSL uses clock stretching to absorb
the latency of transaction forwarding across the link.
Add a per-master "qcom,scl-stretch-enable" boolean DT property that
ORs with the existing hw_params default, allowing clock stretching to
be enabled on individual CCI masters without affecting others.
Signed-off-by: Cory Keitz <ckeitz@amazon.com>
---
drivers/i2c/busses/i2c-qcom-cci.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/i2c/busses/i2c-qcom-cci.c b/drivers/i2c/busses/i2c-qcom-cci.c
index 884055df1560..022c10b310a0 100644
--- a/drivers/i2c/busses/i2c-qcom-cci.c
+++ b/drivers/i2c/busses/i2c-qcom-cci.c
@@ -111,6 +111,7 @@ struct cci_master {
struct i2c_adapter adap;
u16 master;
u8 mode;
+ bool scl_stretch_en;
int status;
struct completion irq_complete;
struct cci *cci;
@@ -284,7 +285,8 @@ static int cci_init(struct cci *cci)
val = hw->tbuf;
writel(val, cci->base + CCI_I2C_Mm_SDA_CTL_2(i));
- val = hw->scl_stretch_en << 8 | hw->trdhld << 4 | hw->tsp;
+ val = (hw->scl_stretch_en | cci->master[i].scl_stretch_en) << 8 |
+ hw->trdhld << 4 | hw->tsp;
writel(val, cci->base + CCI_I2C_Mm_MISC_CTL(i));
}
@@ -572,6 +574,9 @@ static int cci_probe(struct platform_device *pdev)
master->mode = I2C_MODE_FAST_PLUS;
}
+ master->scl_stretch_en =
+ of_property_read_bool(child, "qcom,scl-stretch-enable");
+
init_completion(&master->irq_complete);
}
--
2.47.3
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 0/2] i2c: qcom-cci: Add DT property for SCL clock stretching
2026-03-05 14:40 [PATCH 0/2] i2c: qcom-cci: Add DT property for SCL clock stretching Cory Keitz via B4 Relay
2026-03-05 14:40 ` [PATCH 1/2] dt-bindings: i2c: qcom-cci: Document qcom,scl-stretch-enable property Cory Keitz via B4 Relay
2026-03-05 14:40 ` [PATCH 2/2] i2c: qcom-cci: Add DT property for SCL clock stretching Cory Keitz via B4 Relay
@ 2026-03-05 15:16 ` Loic Poulain
2026-03-05 23:01 ` Cory Keitz
2026-03-11 13:18 ` Konrad Dybcio
2 siblings, 2 replies; 8+ messages in thread
From: Loic Poulain @ 2026-03-05 15:16 UTC (permalink / raw)
To: ckeitz
Cc: Robert Foss, Andi Shyti, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, linux-arm-msm, linux-i2c, devicetree, linux-kernel
Hi Cory,
On Thu, Mar 5, 2026 at 3:40 PM Cory Keitz via B4 Relay
<devnull+ckeitz.amazon.com@kernel.org> wrote:
>
> The Qualcomm CCI I2C controller has an SCL clock stretch enable bit in
> the MISC_CTL register. Currently the driver hardcodes this off in
> per-SoC hw_params tables, with no way to enable it from the device tree
> on a per-master basis.
>
> Clock stretching is required for GMSL configurations where the
> deserializer uses it to absorb the latency imposed by forwarding I2C
> transactions across the serial link. Without it, the CCI master exhibits
> intermittent transaction failure.
>
> This series adds a "qcom,scl-stretch-enable" boolean DT property to
> individual CCI i2c-bus sub-nodes. The property ORs with the existing
> hw_params default so it is purely additive and does not affect masters
> that do not set it.
>
> Tested on sa8775p using the qcom,sm8250-cci compatible string with two
> CCI buses connected to one max96724/max96717 GMSL2 pair each. Enabling
> this property eliminated intermittent NACK errors during serializer
> and/or deserializer probe.
I'm not convinced this kind of hardware behaviour belongs in
devicetree. As far as I understand, clock stretching is part of the
I2C specification, and slaves are allowed to use it whenever they need
additional time. Masters are therefore expected to tolerate
stretching. Given that, why not enable it unconditionally in the
driver? Is there any downside to doing so?
Regards,
Loic
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] dt-bindings: i2c: qcom-cci: Document qcom,scl-stretch-enable property
2026-03-05 14:40 ` [PATCH 1/2] dt-bindings: i2c: qcom-cci: Document qcom,scl-stretch-enable property Cory Keitz via B4 Relay
@ 2026-03-05 15:18 ` Krzysztof Kozlowski
2026-03-05 23:04 ` Cory Keitz
0 siblings, 1 reply; 8+ messages in thread
From: Krzysztof Kozlowski @ 2026-03-05 15:18 UTC (permalink / raw)
To: ckeitz, Loic Poulain, Robert Foss, Andi Shyti, Rob Herring,
Krzysztof Kozlowski, Conor Dooley
Cc: linux-arm-msm, linux-i2c, devicetree, linux-kernel
On 05/03/2026 15:40, Cory Keitz via B4 Relay wrote:
> From: Cory Keitz <ckeitz@amazon.com>
>
> Add the optional boolean property "qcom,scl-stretch-enable" to the
> CCI i2c-bus sub-nodes. This property enables SCL clock stretching on
> the corresponding CCI master, which is needed by peripherals such as
> GMSL deserializers that hold SCL low to absorb forwarding latency.
>
> Signed-off-by: Cory Keitz <ckeitz@amazon.com>
> ---
> Documentation/devicetree/bindings/i2c/qcom,i2c-cci.yaml | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/i2c/qcom,i2c-cci.yaml b/Documentation/devicetree/bindings/i2c/qcom,i2c-cci.yaml
> index 399a09409e07..fea609fa2f05 100644
> --- a/Documentation/devicetree/bindings/i2c/qcom,i2c-cci.yaml
> +++ b/Documentation/devicetree/bindings/i2c/qcom,i2c-cci.yaml
> @@ -78,6 +78,14 @@ patternProperties:
> clock-frequency:
> default: 100000
>
> + qcom,scl-stretch-enable:
I don't understand why only Qualcomm needs per-controller property and
no others need to static configuration. Maybe this is just already solved?
And I actually found this:
https://lore.kernel.org/all/20230312131933.248715-2-andi.shyti@kernel.org/
so this is all done.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 0/2] i2c: qcom-cci: Add DT property for SCL clock stretching
2026-03-05 15:16 ` [PATCH 0/2] " Loic Poulain
@ 2026-03-05 23:01 ` Cory Keitz
2026-03-11 13:18 ` Konrad Dybcio
1 sibling, 0 replies; 8+ messages in thread
From: Cory Keitz @ 2026-03-05 23:01 UTC (permalink / raw)
To: Loic Poulain
Cc: Robert Foss, Andi Shyti, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, linux-arm-msm, linux-i2c, devicetree, linux-kernel
On Thu, Mar 05, 2026 at 04:16:31PM +0100, Loic Poulain wrote:
> I'm not convinced this kind of hardware behaviour belongs in
> devicetree. As far as I understand, clock stretching is part of the
> I2C specification, and slaves are allowed to use it whenever they need
> additional time. Masters are therefore expected to tolerate
> stretching. Given that, why not enable it unconditionally in the
> driver? Is there any downside to doing so?
Fair point. I wasn't sure of implications across the platforms, so my
preference was to make the change opt-in to preserve behavior for
existing systems. This is probably an overly-cautious approach though.
I'm happy to submit a v2 that forces it on, and remove the new DT
binding.
Cory
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] dt-bindings: i2c: qcom-cci: Document qcom,scl-stretch-enable property
2026-03-05 15:18 ` Krzysztof Kozlowski
@ 2026-03-05 23:04 ` Cory Keitz
0 siblings, 0 replies; 8+ messages in thread
From: Cory Keitz @ 2026-03-05 23:04 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Loic Poulain, Robert Foss, Andi Shyti, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, linux-arm-msm, linux-i2c,
devicetree, linux-kernel
On Thu, Mar 05, 2026 at 04:18:11PM +0100, Krzysztof Kozlowski wrote:
> I don't understand why only Qualcomm needs per-controller property and
> no others need to static configuration. Maybe this is just already solved?
>
> And I actually found this:
> https://lore.kernel.org/all/20230312131933.248715-2-andi.shyti@kernel.org/
>
> so this is all done.
Thanks, I hadn't seen this. The two properties there aren't quite the
same but the point about it being a general property is well taken. I
plan to follow Loic's suggestion and hardcode instead of using a DT
property.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 0/2] i2c: qcom-cci: Add DT property for SCL clock stretching
2026-03-05 15:16 ` [PATCH 0/2] " Loic Poulain
2026-03-05 23:01 ` Cory Keitz
@ 2026-03-11 13:18 ` Konrad Dybcio
1 sibling, 0 replies; 8+ messages in thread
From: Konrad Dybcio @ 2026-03-11 13:18 UTC (permalink / raw)
To: Loic Poulain, ckeitz, Mukesh Kumar Savaliya
Cc: Robert Foss, Andi Shyti, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, linux-arm-msm, linux-i2c, devicetree, linux-kernel
On 3/5/26 4:16 PM, Loic Poulain wrote:
> Hi Cory,
>
> On Thu, Mar 5, 2026 at 3:40 PM Cory Keitz via B4 Relay
> <devnull+ckeitz.amazon.com@kernel.org> wrote:
>>
>> The Qualcomm CCI I2C controller has an SCL clock stretch enable bit in
>> the MISC_CTL register. Currently the driver hardcodes this off in
>> per-SoC hw_params tables, with no way to enable it from the device tree
>> on a per-master basis.
>>
>> Clock stretching is required for GMSL configurations where the
>> deserializer uses it to absorb the latency imposed by forwarding I2C
>> transactions across the serial link. Without it, the CCI master exhibits
>> intermittent transaction failure.
>>
>> This series adds a "qcom,scl-stretch-enable" boolean DT property to
>> individual CCI i2c-bus sub-nodes. The property ORs with the existing
>> hw_params default so it is purely additive and does not affect masters
>> that do not set it.
>>
>> Tested on sa8775p using the qcom,sm8250-cci compatible string with two
>> CCI buses connected to one max96724/max96717 GMSL2 pair each. Enabling
>> this property eliminated intermittent NACK errors during serializer
>> and/or deserializer probe.
>
> I'm not convinced this kind of hardware behaviour belongs in
> devicetree. As far as I understand, clock stretching is part of the
> I2C specification, and slaves are allowed to use it whenever they need
> additional time. Masters are therefore expected to tolerate
> stretching. Given that, why not enable it unconditionally in the
> driver? Is there any downside to doing so?
+Mukesh may be able to help
Konrad
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2026-03-11 13:19 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-05 14:40 [PATCH 0/2] i2c: qcom-cci: Add DT property for SCL clock stretching Cory Keitz via B4 Relay
2026-03-05 14:40 ` [PATCH 1/2] dt-bindings: i2c: qcom-cci: Document qcom,scl-stretch-enable property Cory Keitz via B4 Relay
2026-03-05 15:18 ` Krzysztof Kozlowski
2026-03-05 23:04 ` Cory Keitz
2026-03-05 14:40 ` [PATCH 2/2] i2c: qcom-cci: Add DT property for SCL clock stretching Cory Keitz via B4 Relay
2026-03-05 15:16 ` [PATCH 0/2] " Loic Poulain
2026-03-05 23:01 ` Cory Keitz
2026-03-11 13:18 ` Konrad Dybcio
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox