* [PATCH RFT 0/3] i2c: mpc: use proper binding for transfer timeouts
@ 2024-02-29 10:58 Wolfram Sang
2024-02-29 10:58 ` [PATCH RFT 1/3] dt-bindings: " Wolfram Sang
` (4 more replies)
0 siblings, 5 replies; 10+ messages in thread
From: Wolfram Sang @ 2024-02-29 10:58 UTC (permalink / raw)
To: linux-renesas-soc
Cc: Chris Packham, Rob Herring, Wolfram Sang, devicetree, linux-i2c,
linux-kernel
To clean up the confusing situation regarding I2C timeout bindings, here
is the series to fix up the MPC driver which mixed up clock stretching
timeout with transfer timeouts. Plus a minor cleanup while here.
Only build tested, so actual testing is welcome.
Wolfram Sang (3):
dt-bindings: i2c: mpc: use proper binding for transfer timeouts
i2c: mpc: use proper binding for transfer timeouts
i2c: mpc: remove outdated macro
.../devicetree/bindings/i2c/i2c-mpc.yaml | 2 +-
drivers/i2c/busses/i2c-mpc.c | 16 +++++++---------
2 files changed, 8 insertions(+), 10 deletions(-)
--
2.43.0
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH RFT 1/3] dt-bindings: i2c: mpc: use proper binding for transfer timeouts
2024-02-29 10:58 [PATCH RFT 0/3] i2c: mpc: use proper binding for transfer timeouts Wolfram Sang
@ 2024-02-29 10:58 ` Wolfram Sang
2024-03-01 14:42 ` Rob Herring
2024-03-04 15:16 ` Andi Shyti
2024-02-29 10:58 ` [PATCH RFT 2/3] " Wolfram Sang
` (3 subsequent siblings)
4 siblings, 2 replies; 10+ messages in thread
From: Wolfram Sang @ 2024-02-29 10:58 UTC (permalink / raw)
To: linux-renesas-soc
Cc: Chris Packham, Rob Herring, Wolfram Sang, Andi Shyti,
Krzysztof Kozlowski, Conor Dooley, linux-i2c, devicetree,
linux-kernel
"i2c-scl-clk-low-timeout-us" has flaws in itself and the usage here is
all wrong. The driver doesn't use it as a maximum time for clock
stretching but the maximum time for a total transfer. We already have
a binding for the latter. Convert the wrong binding from examples.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
Documentation/devicetree/bindings/i2c/i2c-mpc.yaml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/i2c/i2c-mpc.yaml b/Documentation/devicetree/bindings/i2c/i2c-mpc.yaml
index 70fb69b923c4..b1d7d14c0be4 100644
--- a/Documentation/devicetree/bindings/i2c/i2c-mpc.yaml
+++ b/Documentation/devicetree/bindings/i2c/i2c-mpc.yaml
@@ -96,6 +96,6 @@ examples:
interrupts = <43 2>;
interrupt-parent = <&mpic>;
clock-frequency = <400000>;
- i2c-scl-clk-low-timeout-us = <10000>;
+ i2c-transfer-timeout-us = <10000>;
};
...
--
2.43.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH RFT 2/3] i2c: mpc: use proper binding for transfer timeouts
2024-02-29 10:58 [PATCH RFT 0/3] i2c: mpc: use proper binding for transfer timeouts Wolfram Sang
2024-02-29 10:58 ` [PATCH RFT 1/3] dt-bindings: " Wolfram Sang
@ 2024-02-29 10:58 ` Wolfram Sang
2024-02-29 10:58 ` [PATCH RFT 3/3] i2c: mpc: remove outdated macro Wolfram Sang
` (2 subsequent siblings)
4 siblings, 0 replies; 10+ messages in thread
From: Wolfram Sang @ 2024-02-29 10:58 UTC (permalink / raw)
To: linux-renesas-soc
Cc: Chris Packham, Rob Herring, Wolfram Sang, Andi Shyti, linux-i2c,
linux-kernel
"i2c-scl-clk-low-timeout-us" is wrongly used here because it describes
maximum clock stretching not maximum transfer time. Additionally, it is
deprecated because of issues. Move this driver to the correct binding.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
drivers/i2c/busses/i2c-mpc.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c
index e4e4995ab224..0b4de9e569ba 100644
--- a/drivers/i2c/busses/i2c-mpc.c
+++ b/drivers/i2c/busses/i2c-mpc.c
@@ -844,14 +844,14 @@ static int fsl_i2c_probe(struct platform_device *op)
mpc_i2c_setup_8xxx(op->dev.of_node, i2c, clock);
}
- /*
- * "fsl,timeout" has been marked as deprecated and, to maintain
- * backward compatibility, we will only look for it if
- * "i2c-scl-clk-low-timeout-us" is not present.
- */
+ /* Sadly, we have to support two deprecated bindings here */
result = of_property_read_u32(op->dev.of_node,
- "i2c-scl-clk-low-timeout-us",
+ "i2c-transfer-timeout-us",
&mpc_ops.timeout);
+ if (result == -EINVAL)
+ result = of_property_read_u32(op->dev.of_node,
+ "i2c-scl-clk-low-timeout-us",
+ &mpc_ops.timeout);
if (result == -EINVAL)
result = of_property_read_u32(op->dev.of_node,
"fsl,timeout", &mpc_ops.timeout);
--
2.43.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH RFT 3/3] i2c: mpc: remove outdated macro
2024-02-29 10:58 [PATCH RFT 0/3] i2c: mpc: use proper binding for transfer timeouts Wolfram Sang
2024-02-29 10:58 ` [PATCH RFT 1/3] dt-bindings: " Wolfram Sang
2024-02-29 10:58 ` [PATCH RFT 2/3] " Wolfram Sang
@ 2024-02-29 10:58 ` Wolfram Sang
2024-03-03 20:28 ` [PATCH RFT 0/3] i2c: mpc: use proper binding for transfer timeouts Chris Packham
2024-03-06 15:43 ` Andi Shyti
4 siblings, 0 replies; 10+ messages in thread
From: Wolfram Sang @ 2024-02-29 10:58 UTC (permalink / raw)
To: linux-renesas-soc
Cc: Chris Packham, Rob Herring, Wolfram Sang, Andi Shyti, linux-i2c,
linux-kernel
DRV_NAME was useful back in the days. But here, being used once, it is
only cruft.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
drivers/i2c/busses/i2c-mpc.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c
index 0b4de9e569ba..8d73c0f405ed 100644
--- a/drivers/i2c/busses/i2c-mpc.c
+++ b/drivers/i2c/busses/i2c-mpc.c
@@ -30,8 +30,6 @@
#include <asm/mpc85xx.h>
#include <sysdev/fsl_soc.h>
-#define DRV_NAME "mpc-i2c"
-
#define MPC_I2C_CLOCK_LEGACY 0
#define MPC_I2C_CLOCK_PRESERVE (~0U)
@@ -960,7 +958,7 @@ static struct platform_driver mpc_i2c_driver = {
.probe = fsl_i2c_probe,
.remove_new = fsl_i2c_remove,
.driver = {
- .name = DRV_NAME,
+ .name = "mpc-i2c",
.of_match_table = mpc_i2c_of_match,
.pm = &mpc_i2c_pm_ops,
},
--
2.43.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH RFT 1/3] dt-bindings: i2c: mpc: use proper binding for transfer timeouts
2024-02-29 10:58 ` [PATCH RFT 1/3] dt-bindings: " Wolfram Sang
@ 2024-03-01 14:42 ` Rob Herring
2024-03-04 15:16 ` Andi Shyti
1 sibling, 0 replies; 10+ messages in thread
From: Rob Herring @ 2024-03-01 14:42 UTC (permalink / raw)
To: Wolfram Sang
Cc: devicetree, Rob Herring, linux-renesas-soc, linux-i2c,
Chris Packham, Krzysztof Kozlowski, Andi Shyti, linux-kernel,
Conor Dooley
On Thu, 29 Feb 2024 11:58:11 +0100, Wolfram Sang wrote:
> "i2c-scl-clk-low-timeout-us" has flaws in itself and the usage here is
> all wrong. The driver doesn't use it as a maximum time for clock
> stretching but the maximum time for a total transfer. We already have
> a binding for the latter. Convert the wrong binding from examples.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> ---
> Documentation/devicetree/bindings/i2c/i2c-mpc.yaml | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
Acked-by: Rob Herring <robh@kernel.org>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH RFT 0/3] i2c: mpc: use proper binding for transfer timeouts
2024-02-29 10:58 [PATCH RFT 0/3] i2c: mpc: use proper binding for transfer timeouts Wolfram Sang
` (2 preceding siblings ...)
2024-02-29 10:58 ` [PATCH RFT 3/3] i2c: mpc: remove outdated macro Wolfram Sang
@ 2024-03-03 20:28 ` Chris Packham
2024-03-06 15:43 ` Andi Shyti
4 siblings, 0 replies; 10+ messages in thread
From: Chris Packham @ 2024-03-03 20:28 UTC (permalink / raw)
To: Wolfram Sang, linux-renesas-soc@vger.kernel.org
Cc: Rob Herring, devicetree@vger.kernel.org,
linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org
On 29/02/24 23:58, Wolfram Sang wrote:
> To clean up the confusing situation regarding I2C timeout bindings, here
> is the series to fix up the MPC driver which mixed up clock stretching
> timeout with transfer timeouts. Plus a minor cleanup while here.
>
> Only build tested, so actual testing is welcome.
For the series
Reviewed-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
and on a P2041RDB
Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
>
>
> Wolfram Sang (3):
> dt-bindings: i2c: mpc: use proper binding for transfer timeouts
> i2c: mpc: use proper binding for transfer timeouts
> i2c: mpc: remove outdated macro
>
> .../devicetree/bindings/i2c/i2c-mpc.yaml | 2 +-
> drivers/i2c/busses/i2c-mpc.c | 16 +++++++---------
> 2 files changed, 8 insertions(+), 10 deletions(-)
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH RFT 1/3] dt-bindings: i2c: mpc: use proper binding for transfer timeouts
2024-02-29 10:58 ` [PATCH RFT 1/3] dt-bindings: " Wolfram Sang
2024-03-01 14:42 ` Rob Herring
@ 2024-03-04 15:16 ` Andi Shyti
2024-03-04 15:40 ` Wolfram Sang
2024-03-04 20:02 ` Chris Packham
1 sibling, 2 replies; 10+ messages in thread
From: Andi Shyti @ 2024-03-04 15:16 UTC (permalink / raw)
To: Wolfram Sang
Cc: linux-renesas-soc, Chris Packham, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, linux-i2c, devicetree,
linux-kernel, Andi Shyti
Hi,
On Thu, Feb 29, 2024 at 11:58:11AM +0100, Wolfram Sang wrote:
> "i2c-scl-clk-low-timeout-us" has flaws in itself and the usage here is
> all wrong. The driver doesn't use it as a maximum time for clock
> stretching but the maximum time for a total transfer. We already have
> a binding for the latter. Convert the wrong binding from examples.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> ---
> Documentation/devicetree/bindings/i2c/i2c-mpc.yaml | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Documentation/devicetree/bindings/i2c/i2c-mpc.yaml b/Documentation/devicetree/bindings/i2c/i2c-mpc.yaml
> index 70fb69b923c4..b1d7d14c0be4 100644
> --- a/Documentation/devicetree/bindings/i2c/i2c-mpc.yaml
> +++ b/Documentation/devicetree/bindings/i2c/i2c-mpc.yaml
> @@ -96,6 +96,6 @@ examples:
> interrupts = <43 2>;
> interrupt-parent = <&mpic>;
> clock-frequency = <400000>;
> - i2c-scl-clk-low-timeout-us = <10000>;
> + i2c-transfer-timeout-us = <10000>;
Chris, can you please give it an ack?
The whole series is coherent to this change.
Andi
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH RFT 1/3] dt-bindings: i2c: mpc: use proper binding for transfer timeouts
2024-03-04 15:16 ` Andi Shyti
@ 2024-03-04 15:40 ` Wolfram Sang
2024-03-04 20:02 ` Chris Packham
1 sibling, 0 replies; 10+ messages in thread
From: Wolfram Sang @ 2024-03-04 15:40 UTC (permalink / raw)
To: Andi Shyti
Cc: linux-renesas-soc, Chris Packham, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, linux-i2c, devicetree,
linux-kernel
[-- Attachment #1: Type: text/plain, Size: 120 bytes --]
> Chris, can you please give it an ack?
He did on the coverletter for the whole series? Or did I overlook
something?
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH RFT 1/3] dt-bindings: i2c: mpc: use proper binding for transfer timeouts
2024-03-04 15:16 ` Andi Shyti
2024-03-04 15:40 ` Wolfram Sang
@ 2024-03-04 20:02 ` Chris Packham
1 sibling, 0 replies; 10+ messages in thread
From: Chris Packham @ 2024-03-04 20:02 UTC (permalink / raw)
To: Andi Shyti, Wolfram Sang
Cc: linux-renesas-soc@vger.kernel.org, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, linux-i2c@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Hi Andi,
On 5/03/24 04:16, Andi Shyti wrote:
> Hi,
>
> On Thu, Feb 29, 2024 at 11:58:11AM +0100, Wolfram Sang wrote:
>> "i2c-scl-clk-low-timeout-us" has flaws in itself and the usage here is
>> all wrong. The driver doesn't use it as a maximum time for clock
>> stretching but the maximum time for a total transfer. We already have
>> a binding for the latter. Convert the wrong binding from examples.
>>
>> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
>> ---
>> Documentation/devicetree/bindings/i2c/i2c-mpc.yaml | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/Documentation/devicetree/bindings/i2c/i2c-mpc.yaml b/Documentation/devicetree/bindings/i2c/i2c-mpc.yaml
>> index 70fb69b923c4..b1d7d14c0be4 100644
>> --- a/Documentation/devicetree/bindings/i2c/i2c-mpc.yaml
>> +++ b/Documentation/devicetree/bindings/i2c/i2c-mpc.yaml
>> @@ -96,6 +96,6 @@ examples:
>> interrupts = <43 2>;
>> interrupt-parent = <&mpic>;
>> clock-frequency = <400000>;
>> - i2c-scl-clk-low-timeout-us = <10000>;
>> + i2c-transfer-timeout-us = <10000>;
> Chris, can you please give it an ack?
>
> The whole series is coherent to this change.
Looks like you weren't on the To: list for the cover letter which I
replied to.
For the series
Reviewed-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
and on a P2041RDB
Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH RFT 0/3] i2c: mpc: use proper binding for transfer timeouts
2024-02-29 10:58 [PATCH RFT 0/3] i2c: mpc: use proper binding for transfer timeouts Wolfram Sang
` (3 preceding siblings ...)
2024-03-03 20:28 ` [PATCH RFT 0/3] i2c: mpc: use proper binding for transfer timeouts Chris Packham
@ 2024-03-06 15:43 ` Andi Shyti
4 siblings, 0 replies; 10+ messages in thread
From: Andi Shyti @ 2024-03-06 15:43 UTC (permalink / raw)
To: linux-renesas-soc, Wolfram Sang
Cc: Chris Packham, Rob Herring, devicetree, linux-i2c, linux-kernel
Hi
On Thu, 29 Feb 2024 11:58:10 +0100, Wolfram Sang wrote:
> To clean up the confusing situation regarding I2C timeout bindings, here
> is the series to fix up the MPC driver which mixed up clock stretching
> timeout with transfer timeouts. Plus a minor cleanup while here.
>
> Only build tested, so actual testing is welcome.
>
>
> [...]
Applied to i2c/i2c-host on
git://git.kernel.org/pub/scm/linux/kernel/git/andi.shyti/linux.git
Thank you,
Andi
Patches applied
===============
[1/3] dt-bindings: i2c: mpc: use proper binding for transfer timeouts
commit: f9ccb4533bdcf31f1225a9a09805329b8020a4e3
[2/3] i2c: mpc: use proper binding for transfer timeouts
commit: 401a8e9e3d697b75c2e237b9b405bb0f388dd7ed
[3/3] i2c: mpc: remove outdated macro
commit: d0e944150446d8056a050049a8f0e98241ba6194
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2024-03-06 15:53 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-29 10:58 [PATCH RFT 0/3] i2c: mpc: use proper binding for transfer timeouts Wolfram Sang
2024-02-29 10:58 ` [PATCH RFT 1/3] dt-bindings: " Wolfram Sang
2024-03-01 14:42 ` Rob Herring
2024-03-04 15:16 ` Andi Shyti
2024-03-04 15:40 ` Wolfram Sang
2024-03-04 20:02 ` Chris Packham
2024-02-29 10:58 ` [PATCH RFT 2/3] " Wolfram Sang
2024-02-29 10:58 ` [PATCH RFT 3/3] i2c: mpc: remove outdated macro Wolfram Sang
2024-03-03 20:28 ` [PATCH RFT 0/3] i2c: mpc: use proper binding for transfer timeouts Chris Packham
2024-03-06 15:43 ` Andi Shyti
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox