2022-08-11 20:54:21

by Conor Dooley

[permalink] [raw]
Subject: [PATCH] dt-bindings: mmc: cdns: add card-detect-delay property

From: Conor Dooley <[email protected]>

Upgrading dt-schema to v2022.08 brings with it better handling of
unevaluatedProperties, exposing a previously undetected missing
property in the cadence sdhci dt-binding:
arch/riscv/boot/dts/microchip/mpfs-icicle-kit.dtb: mmc@20008000: Unevaluated properties are not allowed ('card-detect-delay' was unexpected)
From schema: Documentation/devicetree/bindings/mmc/cdns,sdhci.yaml

Signed-off-by: Conor Dooley <[email protected]>
---
Should this have a fixes tag? If anything, it'd be
Fixes: 84723eec251d ("dt-bindings: mmc: cdns: document Microchip MPFS MMC/SDHCI controller")
but idk.
---
Documentation/devicetree/bindings/mmc/cdns,sdhci.yaml | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/Documentation/devicetree/bindings/mmc/cdns,sdhci.yaml b/Documentation/devicetree/bindings/mmc/cdns,sdhci.yaml
index 4207fed62dfe..99f89eb19356 100644
--- a/Documentation/devicetree/bindings/mmc/cdns,sdhci.yaml
+++ b/Documentation/devicetree/bindings/mmc/cdns,sdhci.yaml
@@ -112,6 +112,13 @@ properties:
minimum: 0
maximum: 0x7f

+ card-detect-delay:
+ description:
+ Delay in milli-seconds before detecting card after card
+ insert event. The default value is 0.
+ $ref: /schemas/types.yaml#/definitions/uint32
+ default: 0
+
required:
- compatible
- reg
--
2.37.1


2022-08-12 15:34:52

by Rob Herring

[permalink] [raw]
Subject: Re: [PATCH] dt-bindings: mmc: cdns: add card-detect-delay property

On Thu, Aug 11, 2022 at 2:32 PM Conor Dooley <[email protected]> wrote:
>
> From: Conor Dooley <[email protected]>
>
> Upgrading dt-schema to v2022.08 brings with it better handling of
> unevaluatedProperties, exposing a previously undetected missing
> property in the cadence sdhci dt-binding:
> arch/riscv/boot/dts/microchip/mpfs-icicle-kit.dtb: mmc@20008000: Unevaluated properties are not allowed ('card-detect-delay' was unexpected)
> From schema: Documentation/devicetree/bindings/mmc/cdns,sdhci.yaml
>
> Signed-off-by: Conor Dooley <[email protected]>
> ---
> Should this have a fixes tag? If anything, it'd be
> Fixes: 84723eec251d ("dt-bindings: mmc: cdns: document Microchip MPFS MMC/SDHCI controller")
> but idk.

No, the common property 'cd-debounce-delay-ms' should be used instead.

Rob

2022-08-12 15:48:31

by Conor Dooley

[permalink] [raw]
Subject: Re: [PATCH] dt-bindings: mmc: cdns: add card-detect-delay property

On 12/08/2022 16:33, Rob Herring wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>
> On Thu, Aug 11, 2022 at 2:32 PM Conor Dooley <[email protected]> wrote:
>>
>> From: Conor Dooley <[email protected]>
>>
>> Upgrading dt-schema to v2022.08 brings with it better handling of
>> unevaluatedProperties, exposing a previously undetected missing
>> property in the cadence sdhci dt-binding:
>> arch/riscv/boot/dts/microchip/mpfs-icicle-kit.dtb: mmc@20008000: Unevaluated properties are not allowed ('card-detect-delay' was unexpected)
>> From schema: Documentation/devicetree/bindings/mmc/cdns,sdhci.yaml
>>
>> Signed-off-by: Conor Dooley <[email protected]>
>> ---
>> Should this have a fixes tag? If anything, it'd be
>> Fixes: 84723eec251d ("dt-bindings: mmc: cdns: document Microchip MPFS MMC/SDHCI controller")
>> but idk.
>
> No, the common property 'cd-debounce-delay-ms' should be used instead.

So it's a case of "what's in the dts is wrong so it needs to change"?
For the future, where is the line drawn between "don't break the dts"
& "don't use bad properties"? Only if the property has consumers?
I don't mind, just want to get it right next time ;)

Thanks,
Conor.

2022-08-12 16:41:45

by Rob Herring

[permalink] [raw]
Subject: Re: [PATCH] dt-bindings: mmc: cdns: add card-detect-delay property

On Fri, Aug 12, 2022 at 9:46 AM <[email protected]> wrote:
>
> On 12/08/2022 16:33, Rob Herring wrote:
> > EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> >
> > On Thu, Aug 11, 2022 at 2:32 PM Conor Dooley <[email protected]> wrote:
> >>
> >> From: Conor Dooley <[email protected]>
> >>
> >> Upgrading dt-schema to v2022.08 brings with it better handling of
> >> unevaluatedProperties, exposing a previously undetected missing
> >> property in the cadence sdhci dt-binding:
> >> arch/riscv/boot/dts/microchip/mpfs-icicle-kit.dtb: mmc@20008000: Unevaluated properties are not allowed ('card-detect-delay' was unexpected)
> >> From schema: Documentation/devicetree/bindings/mmc/cdns,sdhci.yaml
> >>
> >> Signed-off-by: Conor Dooley <[email protected]>
> >> ---
> >> Should this have a fixes tag? If anything, it'd be
> >> Fixes: 84723eec251d ("dt-bindings: mmc: cdns: document Microchip MPFS MMC/SDHCI controller")
> >> but idk.
> >
> > No, the common property 'cd-debounce-delay-ms' should be used instead.
>
> So it's a case of "what's in the dts is wrong so it needs to change"?

Yes.

> For the future, where is the line drawn between "don't break the dts"
> & "don't use bad properties"?

Depends...

> Only if the property has consumers?
> I don't mind, just want to get it right next time ;)

In this case, there shouldn't be any compatibility issues because the
mmc core has supported the common property longer than the dts
existed. If that was not the case, then we'd probably be stuck with
the property in the dts file. That still depends on usage in the
kernel or elsewhere, in dts files, stability of the platform support,
etc.

Rob

2022-08-12 16:57:22

by Conor Dooley

[permalink] [raw]
Subject: Re: [PATCH] dt-bindings: mmc: cdns: add card-detect-delay property

On 12/08/2022 17:38, Rob Herring wrote:
>>> No, the common property 'cd-debounce-delay-ms' should be used instead.
>>
>> So it's a case of "what's in the dts is wrong so it needs to change"?
>
> Yes.
>
>> For the future, where is the line drawn between "don't break the dts"
>> & "don't use bad properties"?
>
> Depends...
>
>> Only if the property has consumers?
>> I don't mind, just want to get it right next time ;)
>
> In this case, there shouldn't be any compatibility issues because the
> mmc core has supported the common property longer than the dts
> existed. If that was not the case, then we'd probably be stuck with
> the property in the dts file. That still depends on usage in the
> kernel or elsewhere, in dts files, stability of the platform support,
> etc.

Cool, thanks Rob!


2022-08-12 19:06:07

by Conor Dooley

[permalink] [raw]
Subject: Re: [PATCH] dt-bindings: mmc: cdns: add card-detect-delay property

On 12/08/2022 16:33, Rob Herring wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>
> On Thu, Aug 11, 2022 at 2:32 PM Conor Dooley <[email protected]> wrote:
>>
>> From: Conor Dooley <[email protected]>
>>
>> Upgrading dt-schema to v2022.08 brings with it better handling of
>> unevaluatedProperties, exposing a previously undetected missing
>> property in the cadence sdhci dt-binding:
>> arch/riscv/boot/dts/microchip/mpfs-icicle-kit.dtb: mmc@20008000: Unevaluated properties are not allowed ('card-detect-delay' was unexpected)
>> From schema: Documentation/devicetree/bindings/mmc/cdns,sdhci.yaml
>>
>> Signed-off-by: Conor Dooley <[email protected]>
>> ---
>> Should this have a fixes tag? If anything, it'd be
>> Fixes: 84723eec251d ("dt-bindings: mmc: cdns: document Microchip MPFS MMC/SDHCI controller")
>> but idk.
>
> No, the common property 'cd-debounce-delay-ms' should be used instead.

While looking for the fixes tag this would require for the dts, I
realised that this is just another of the properties that pre-dated
my involvement with the dt. I think it's in the same category as
ti,fifodepth & was just copied from somewhere else.
I think rather than rename it, it should just be outright deleted.
cd-debounce-delay-ms depends on cd-gpios, and we don't have any
GPIOs wired to the sdcard.

Thanks,
Conor.