2024-02-29 10:59:16

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH RFT 0/3] i2c: mpc: use proper binding for transfer timeouts

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



2024-02-29 10:59:17

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH RFT 1/3] dt-bindings: i2c: mpc: use proper binding for transfer timeouts

"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 <[email protected]>
---
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


2024-02-29 10:59:47

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH RFT 3/3] i2c: mpc: remove outdated macro

DRV_NAME was useful back in the days. But here, being used once, it is
only cruft.

Signed-off-by: Wolfram Sang <[email protected]>
---
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


2024-03-01 14:42:36

by Rob Herring

[permalink] [raw]
Subject: Re: [PATCH RFT 1/3] dt-bindings: i2c: mpc: use proper binding for transfer timeouts


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 <[email protected]>
> ---
> Documentation/devicetree/bindings/i2c/i2c-mpc.yaml | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>

Acked-by: Rob Herring <[email protected]>


2024-03-03 20:28:55

by Chris Packham

[permalink] [raw]
Subject: Re: [PATCH RFT 0/3] i2c: mpc: use proper binding for transfer timeouts


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 <[email protected]>

and on a P2041RDB

Tested-by: Chris Packham <[email protected]>

>
>
> 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(-)
>

2024-03-04 15:40:39

by Andi Shyti

[permalink] [raw]
Subject: Re: [PATCH RFT 1/3] dt-bindings: i2c: mpc: use proper binding for transfer timeouts

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 <[email protected]>
> ---
> 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

2024-03-04 15:48:44

by Wolfram Sang

[permalink] [raw]
Subject: Re: [PATCH RFT 1/3] dt-bindings: i2c: mpc: use proper binding for transfer timeouts


> Chris, can you please give it an ack?

He did on the coverletter for the whole series? Or did I overlook
something?


Attachments:
(No filename) (126.00 B)
signature.asc (849.00 B)
Download all attachments

2024-03-04 20:03:08

by Chris Packham

[permalink] [raw]
Subject: Re: [PATCH RFT 1/3] dt-bindings: i2c: mpc: use proper binding for transfer timeouts

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 <[email protected]>
>> ---
>> 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 <[email protected]>

and on a P2041RDB

Tested-by: Chris Packham <[email protected]>

2024-03-06 15:56:23

by Andi Shyti

[permalink] [raw]
Subject: Re: [PATCH RFT 0/3] i2c: mpc: use proper binding for transfer timeouts

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