mbox series

[0/6] i2c-imx-lpi2c: add IPG clock

Message ID 20220812043424.4078034-1-peng.fan@oss.nxp.com
Headers show
Series i2c-imx-lpi2c: add IPG clock | expand

Message

Peng Fan (OSS) Aug. 12, 2022, 4:34 a.m. UTC
From: Peng Fan <peng.fan@nxp.com>

The i.MX LPI2C needs PER and IPG clock, not just PER or IPG clock.
This patch is to enable both PER and IPG clock for imx-i2c-lpi2c.

Peng Fan (6):
  dt-bindings: i2c: i2c-imx-lpi2c: add ipg clk
  dt-bindings: i2c: i2c-imx-lpi2c: add dmas property
  dt-bindings: i2c: i2c-imx-lpi2c: add i.MX93
  arm64: dts: imx8-ss-dma: add IPG clock for i2c
  ARM: dts: imx7ulp: Add PER clock for lpi2c
  i2c: imx-lpi2c: handle IPG clock

 .../bindings/i2c/i2c-imx-lpi2c.yaml           | 20 +++++++--
 arch/arm/boot/dts/imx7ulp.dtsi                | 10 +++--
 .../arm64/boot/dts/freescale/imx8-ss-dma.dtsi | 20 +++++----
 drivers/i2c/busses/i2c-imx-lpi2c.c            | 41 ++++++++++++++-----
 4 files changed, 66 insertions(+), 25 deletions(-)

Comments

Krzysztof Kozlowski Aug. 12, 2022, 10:11 a.m. UTC | #1
On 12/08/2022 07:34, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
> 
> i.MX LPI2C has dma capability, so add dmas property
> 
> Signed-off-by: Peng Fan <peng.fan@nxp.com>


Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>


Best regards,
Krzysztof
Krzysztof Kozlowski Aug. 12, 2022, 10:14 a.m. UTC | #2
On 12/08/2022 07:34, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
> 
> The i.MX LPI2C needs PER and IPG clock, not just PER or IPG clock.
> This patch is to enable both PER and IPG clock for imx-i2c-lpi2c.

This patchset breaks the ABI and is not bisectable. The justification is
very limited (one sentence), so not really enough.

Best regards,
Krzysztof
Rob Herring Aug. 12, 2022, 3:13 p.m. UTC | #3
On Fri, 12 Aug 2022 12:34:19 +0800, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
> 
> i.MX LPI2C actually requires dual clock: per clock and ipg clock, so add
> both.
> 
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
>  Documentation/devicetree/bindings/i2c/i2c-imx-lpi2c.yaml | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 

Running 'make dtbs_check' with the schema in this patch gives the
following warnings. Consider if they are expected or the schema is
incorrect. These may not be new warnings.

Note that it is not yet a requirement to have 0 warnings for dtbs_check.
This will change in the future.

Full log is available here: https://patchwork.ozlabs.org/patch/


i2c@40a40000: clock-names:0: 'per' was expected
	arch/arm/boot/dts/imx7ulp-com.dtb
	arch/arm/boot/dts/imx7ulp-evk.dtb

i2c@40a40000: clock-names: ['ipg'] is too short
	arch/arm/boot/dts/imx7ulp-com.dtb
	arch/arm/boot/dts/imx7ulp-evk.dtb

i2c@40a40000: clocks: [[14, 2]] is too short
	arch/arm/boot/dts/imx7ulp-com.dtb

i2c@40a40000: clocks: [[18, 2]] is too short
	arch/arm/boot/dts/imx7ulp-evk.dtb

i2c@40a40000: Unevaluated properties are not allowed ('clock-names', 'clocks' were unexpected)
	arch/arm/boot/dts/imx7ulp-com.dtb
	arch/arm/boot/dts/imx7ulp-evk.dtb

i2c@40a50000: clock-names:0: 'per' was expected
	arch/arm/boot/dts/imx7ulp-com.dtb
	arch/arm/boot/dts/imx7ulp-evk.dtb

i2c@40a50000: clock-names: ['ipg'] is too short
	arch/arm/boot/dts/imx7ulp-com.dtb
	arch/arm/boot/dts/imx7ulp-evk.dtb

i2c@40a50000: clocks: [[14, 3]] is too short
	arch/arm/boot/dts/imx7ulp-com.dtb

i2c@40a50000: clocks: [[18, 3]] is too short
	arch/arm/boot/dts/imx7ulp-evk.dtb

i2c@40a50000: Unevaluated properties are not allowed ('clock-names', 'clocks' were unexpected)
	arch/arm/boot/dts/imx7ulp-com.dtb
	arch/arm/boot/dts/imx7ulp-evk.dtb

i2c@5a800000: clock-names: ['per'] is too short
	arch/arm64/boot/dts/freescale/imx8qm-mek.dtb
	arch/arm64/boot/dts/freescale/imx8qxp-ai_ml.dtb
	arch/arm64/boot/dts/freescale/imx8qxp-colibri-eval-v3.dtb
	arch/arm64/boot/dts/freescale/imx8qxp-mek.dtb

i2c@5a800000: clocks: [[15, 0]] is too short
	arch/arm64/boot/dts/freescale/imx8qm-mek.dtb

i2c@5a800000: clocks: [[35, 0]] is too short
	arch/arm64/boot/dts/freescale/imx8qxp-ai_ml.dtb

i2c@5a800000: clocks: [[37, 0]] is too short
	arch/arm64/boot/dts/freescale/imx8qxp-mek.dtb

i2c@5a800000: clocks: [[38, 0]] is too short
	arch/arm64/boot/dts/freescale/imx8qxp-colibri-eval-v3.dtb

i2c@5a800000: Unevaluated properties are not allowed ('clock-names', 'clocks' were unexpected)
	arch/arm64/boot/dts/freescale/imx8qm-mek.dtb
	arch/arm64/boot/dts/freescale/imx8qxp-ai_ml.dtb
	arch/arm64/boot/dts/freescale/imx8qxp-colibri-eval-v3.dtb
	arch/arm64/boot/dts/freescale/imx8qxp-mek.dtb

i2c@5a810000: clock-names: ['per'] is too short
	arch/arm64/boot/dts/freescale/imx8qm-mek.dtb
	arch/arm64/boot/dts/freescale/imx8qxp-ai_ml.dtb
	arch/arm64/boot/dts/freescale/imx8qxp-colibri-eval-v3.dtb
	arch/arm64/boot/dts/freescale/imx8qxp-mek.dtb

i2c@5a810000: clocks: [[16, 0]] is too short
	arch/arm64/boot/dts/freescale/imx8qm-mek.dtb

i2c@5a810000: clocks: [[36, 0]] is too short
	arch/arm64/boot/dts/freescale/imx8qxp-ai_ml.dtb

i2c@5a810000: clocks: [[38, 0]] is too short
	arch/arm64/boot/dts/freescale/imx8qxp-mek.dtb

i2c@5a810000: clocks: [[43, 0]] is too short
	arch/arm64/boot/dts/freescale/imx8qxp-colibri-eval-v3.dtb

i2c@5a810000: Unevaluated properties are not allowed ('clock-names', 'clocks' were unexpected)
	arch/arm64/boot/dts/freescale/imx8qm-mek.dtb
	arch/arm64/boot/dts/freescale/imx8qxp-ai_ml.dtb
	arch/arm64/boot/dts/freescale/imx8qxp-colibri-eval-v3.dtb
	arch/arm64/boot/dts/freescale/imx8qxp-mek.dtb

i2c@5a820000: clock-names: ['per'] is too short
	arch/arm64/boot/dts/freescale/imx8qm-mek.dtb
	arch/arm64/boot/dts/freescale/imx8qxp-ai_ml.dtb
	arch/arm64/boot/dts/freescale/imx8qxp-colibri-eval-v3.dtb
	arch/arm64/boot/dts/freescale/imx8qxp-mek.dtb

i2c@5a820000: clocks: [[17, 0]] is too short
	arch/arm64/boot/dts/freescale/imx8qm-mek.dtb

i2c@5a820000: clocks: [[37, 0]] is too short
	arch/arm64/boot/dts/freescale/imx8qxp-ai_ml.dtb

i2c@5a820000: clocks: [[43, 0]] is too short
	arch/arm64/boot/dts/freescale/imx8qxp-mek.dtb

i2c@5a820000: clocks: [[45, 0]] is too short
	arch/arm64/boot/dts/freescale/imx8qxp-colibri-eval-v3.dtb

i2c@5a820000: Unevaluated properties are not allowed ('clock-names', 'clocks' were unexpected)
	arch/arm64/boot/dts/freescale/imx8qm-mek.dtb
	arch/arm64/boot/dts/freescale/imx8qxp-ai_ml.dtb
	arch/arm64/boot/dts/freescale/imx8qxp-colibri-eval-v3.dtb
	arch/arm64/boot/dts/freescale/imx8qxp-mek.dtb

i2c@5a830000: clock-names: ['per'] is too short
	arch/arm64/boot/dts/freescale/imx8qm-mek.dtb
	arch/arm64/boot/dts/freescale/imx8qxp-ai_ml.dtb
	arch/arm64/boot/dts/freescale/imx8qxp-colibri-eval-v3.dtb
	arch/arm64/boot/dts/freescale/imx8qxp-mek.dtb

i2c@5a830000: clocks: [[18, 0]] is too short
	arch/arm64/boot/dts/freescale/imx8qm-mek.dtb

i2c@5a830000: clocks: [[38, 0]] is too short
	arch/arm64/boot/dts/freescale/imx8qxp-ai_ml.dtb

i2c@5a830000: clocks: [[44, 0]] is too short
	arch/arm64/boot/dts/freescale/imx8qxp-mek.dtb

i2c@5a830000: clocks: [[46, 0]] is too short
	arch/arm64/boot/dts/freescale/imx8qxp-colibri-eval-v3.dtb

i2c@5a830000: Unevaluated properties are not allowed ('clock-names', 'clocks' were unexpected)
	arch/arm64/boot/dts/freescale/imx8qm-mek.dtb
	arch/arm64/boot/dts/freescale/imx8qxp-ai_ml.dtb
	arch/arm64/boot/dts/freescale/imx8qxp-colibri-eval-v3.dtb
	arch/arm64/boot/dts/freescale/imx8qxp-mek.dtb
Peng Fan Aug. 15, 2022, 12:52 a.m. UTC | #4
Hi Krzysztof,

> Subject: Re: [PATCH 0/6] i2c-imx-lpi2c: add IPG clock
> 
> On 12/08/2022 07:34, Peng Fan (OSS) wrote:
> > From: Peng Fan <peng.fan@nxp.com>
> >
> > The i.MX LPI2C needs PER and IPG clock, not just PER or IPG clock.
> > This patch is to enable both PER and IPG clock for imx-i2c-lpi2c.
> 
> This patchset breaks the ABI and is not bisectable. The justification is very
> limited (one sentence), so not really enough.

ARM32 i.MX7ULP and ARM64 i.MX8QXP/i.MX8ULP all need to use two
clocks, PER and IPG. But current dt-bindings and dts, use one clock.

This patchset includes dts changes patch 4 and patch 5.
Patch 6 is to update driver use two clocks.

I think the patch order in this patchset would not break git bisect, it
just break ABI. But I not find good way how could not break ABI,
because only use one clock is wrong whether in dt-bindings or dtbs.

Should I use a fixes tag to dt-bindings, then break ABI is allowed?

Thanks,
Peng.

> 
> Best regards,
> Krzysztof
Krzysztof Kozlowski Aug. 16, 2022, 6:01 a.m. UTC | #5
On 15/08/2022 03:52, Peng Fan wrote:
> Hi Krzysztof,
> 
>> Subject: Re: [PATCH 0/6] i2c-imx-lpi2c: add IPG clock
>>
>> On 12/08/2022 07:34, Peng Fan (OSS) wrote:
>>> From: Peng Fan <peng.fan@nxp.com>
>>>
>>> The i.MX LPI2C needs PER and IPG clock, not just PER or IPG clock.
>>> This patch is to enable both PER and IPG clock for imx-i2c-lpi2c.
>>
>> This patchset breaks the ABI and is not bisectable. The justification is very
>> limited (one sentence), so not really enough.
> 
> ARM32 i.MX7ULP and ARM64 i.MX8QXP/i.MX8ULP all need to use two
> clocks, PER and IPG. But current dt-bindings and dts, use one clock.
> 
> This patchset includes dts changes patch 4 and patch 5.
> Patch 6 is to update driver use two clocks.
> 
> I think the patch order in this patchset would not break git bisect, it
> just break ABI. But I not find good way how could not break ABI,
> because only use one clock is wrong whether in dt-bindings or dtbs.

Driver changes always go via separate branch than DTS, so your patch
breaks git bisect. I already pointed it out in other patch. This is not
really acceptable. Breaking ABI is another problem which could be
justified with your explanation in other cases... but not in this one,
since it is easy to make it backwards compatible,

> Should I use a fixes tag to dt-bindings, then break ABI is allowed?

No. For such patch ABI break is also not allowed in that case. Just make
the driver backwards compatible and both problems - non bisectability
and ABI break - go away.

Best regards,
Krzysztof
Peng Fan Aug. 16, 2022, 6:31 a.m. UTC | #6
> Subject: Re: [PATCH 0/6] i2c-imx-lpi2c: add IPG clock
> 
> On 15/08/2022 03:52, Peng Fan wrote:
> > Hi Krzysztof,
> >
> >> Subject: Re: [PATCH 0/6] i2c-imx-lpi2c: add IPG clock
> >>
> >> On 12/08/2022 07:34, Peng Fan (OSS) wrote:
> >>> From: Peng Fan <peng.fan@nxp.com>
> >>>
> >>> The i.MX LPI2C needs PER and IPG clock, not just PER or IPG clock.
> >>> This patch is to enable both PER and IPG clock for imx-i2c-lpi2c.
> >>
> >> This patchset breaks the ABI and is not bisectable. The justification
> >> is very limited (one sentence), so not really enough.
> >
> > ARM32 i.MX7ULP and ARM64 i.MX8QXP/i.MX8ULP all need to use two
> clocks,
> > PER and IPG. But current dt-bindings and dts, use one clock.
> >
> > This patchset includes dts changes patch 4 and patch 5.
> > Patch 6 is to update driver use two clocks.
> >
> > I think the patch order in this patchset would not break git bisect,
> > it just break ABI. But I not find good way how could not break ABI,
> > because only use one clock is wrong whether in dt-bindings or dtbs.
> 
> Driver changes always go via separate branch than DTS, so your patch
> breaks git bisect. I already pointed it out in other patch. This is not really
> acceptable. Breaking ABI is another problem which could be justified with
> your explanation in other cases... but not in this one, since it is easy to make
> it backwards compatible,

I see. But the current binding and dts using one clk is really wrong. Anyway,
I could make it backwards compatible.

Thanks,
Peng.
> 
> > Should I use a fixes tag to dt-bindings, then break ABI is allowed?
> 
> No. For such patch ABI break is also not allowed in that case. Just make the
> driver backwards compatible and both problems - non bisectability and ABI
> break - go away.
> 
> Best regards,
> Krzysztof
Peng Fan Aug. 16, 2022, 8:43 a.m. UTC | #7
Hi Krzysztof,

> Subject: Re: [PATCH 0/6] i2c-imx-lpi2c: add IPG clock
> 
> On 15/08/2022 03:52, Peng Fan wrote:
> > Hi Krzysztof,
> >
> >> Subject: Re: [PATCH 0/6] i2c-imx-lpi2c: add IPG clock
> >>
> >> On 12/08/2022 07:34, Peng Fan (OSS) wrote:
> >>> From: Peng Fan <peng.fan@nxp.com>
> >>>
> >>> The i.MX LPI2C needs PER and IPG clock, not just PER or IPG clock.
> >>> This patch is to enable both PER and IPG clock for imx-i2c-lpi2c.
> >>
> >> This patchset breaks the ABI and is not bisectable. The justification
> >> is very limited (one sentence), so not really enough.
> >
> > ARM32 i.MX7ULP and ARM64 i.MX8QXP/i.MX8ULP all need to use two
> clocks,
> > PER and IPG. But current dt-bindings and dts, use one clock.
> >
> > This patchset includes dts changes patch 4 and patch 5.
> > Patch 6 is to update driver use two clocks.
> >
> > I think the patch order in this patchset would not break git bisect,
> > it just break ABI. But I not find good way how could not break ABI,
> > because only use one clock is wrong whether in dt-bindings or dtbs.
> 
> Driver changes always go via separate branch than DTS, so your patch
> breaks git bisect. I already pointed it out in other patch. This is not really
> acceptable. Breaking ABI is another problem which could be justified with
> your explanation in other cases... but not in this one, since it is easy to make
> it backwards compatible,
> 
> > Should I use a fixes tag to dt-bindings, then break ABI is allowed?
> 
> No. For such patch ABI break is also not allowed in that case. Just make the
> driver backwards compatible and both problems - non bisectability and ABI
> break - go away.

One more point that I am not very clear about  
"non bisectability and ABI break "

ABI, I suppose you mean dt-binding, right?
The I2C bindings and dts update will go through different tree, I think. So
dtbs_check may fail considering the PR merge order.

Thanks,
Peng.

> 
> Best regards,
> Krzysztof
Krzysztof Kozlowski Aug. 16, 2022, 9:44 a.m. UTC | #8
On 16/08/2022 11:43, Peng Fan wrote:
>> No. For such patch ABI break is also not allowed in that case. Just make the
>> driver backwards compatible and both problems - non bisectability and ABI
>> break - go away.
> 
> One more point that I am not very clear about  
> "non bisectability and ABI break "
> 
> ABI, I suppose you mean dt-binding, right?
> The I2C bindings and dts update will go through different tree, I think. So
> dtbs_check may fail considering the PR merge order.

ABI break means breaking Application Binary Interface, so out of tree
DTS conforming to old bindings stop working with new kernel.

ABI is described by bindings and implemented by driver. You broke it in
the driver.

Best regards,
Krzysztof
Peng Fan Aug. 16, 2022, 9:47 a.m. UTC | #9
> Subject: Re: [PATCH 0/6] i2c-imx-lpi2c: add IPG clock
> 
> On 16/08/2022 11:43, Peng Fan wrote:
> >> No. For such patch ABI break is also not allowed in that case. Just
> >> make the driver backwards compatible and both problems - non
> >> bisectability and ABI break - go away.
> >
> > One more point that I am not very clear about "non bisectability and
> > ABI break "
> >
> > ABI, I suppose you mean dt-binding, right?
> > The I2C bindings and dts update will go through different tree, I
> > think. So dtbs_check may fail considering the PR merge order.
> 
> ABI break means breaking Application Binary Interface, so out of tree DTS
> conforming to old bindings stop working with new kernel.
> 
> ABI is described by bindings and implemented by driver. You broke it in the
> driver.

Thanks for your explanation. V2 will take care of this.

Thanks,
Peng.
> 
> Best regards,
> Krzysztof