Message ID | 20191004151414.8458-1-krzk@kernel.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [1/3] dt-bindings: arm: samsung: Force clkoutN names to be unique in PMU | expand |
On Fri, Oct 4, 2019 at 10:14 AM Krzysztof Kozlowski <krzk@kernel.org> wrote: > > The clkoutN names of clocks must be unique because they represent > unique inputs of clock multiplexer. > > Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> > --- > Documentation/devicetree/bindings/arm/samsung/pmu.yaml | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/Documentation/devicetree/bindings/arm/samsung/pmu.yaml b/Documentation/devicetree/bindings/arm/samsung/pmu.yaml > index 73b56fc5bf58..d8e03716f5d2 100644 > --- a/Documentation/devicetree/bindings/arm/samsung/pmu.yaml > +++ b/Documentation/devicetree/bindings/arm/samsung/pmu.yaml > @@ -53,8 +53,10 @@ properties: > List of clock names for particular CLKOUT mux inputs > minItems: 1 > maxItems: 32 > - items: > - pattern: '^clkout([0-9]|[12][0-9]|3[0-1])$' > + allOf: > + - items: > + pattern: '^clkout([0-9]|[12][0-9]|3[0-1])$' > + - uniqueItems: true You shouldn't need the 'allOf', just add uniqueItems at the same level as items. Rob
On Tue, Oct 08, 2019 at 07:38:14AM -0500, Rob Herring wrote: > On Fri, Oct 4, 2019 at 10:14 AM Krzysztof Kozlowski <krzk@kernel.org> wrote: > > > > The clkoutN names of clocks must be unique because they represent > > unique inputs of clock multiplexer. > > > > Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> > > --- > > Documentation/devicetree/bindings/arm/samsung/pmu.yaml | 6 ++++-- > > 1 file changed, 4 insertions(+), 2 deletions(-) > > > > diff --git a/Documentation/devicetree/bindings/arm/samsung/pmu.yaml b/Documentation/devicetree/bindings/arm/samsung/pmu.yaml > > index 73b56fc5bf58..d8e03716f5d2 100644 > > --- a/Documentation/devicetree/bindings/arm/samsung/pmu.yaml > > +++ b/Documentation/devicetree/bindings/arm/samsung/pmu.yaml > > @@ -53,8 +53,10 @@ properties: > > List of clock names for particular CLKOUT mux inputs > > minItems: 1 > > maxItems: 32 > > - items: > > - pattern: '^clkout([0-9]|[12][0-9]|3[0-1])$' > > + allOf: > > + - items: > > + pattern: '^clkout([0-9]|[12][0-9]|3[0-1])$' > > + - uniqueItems: true > > You shouldn't need the 'allOf', just add uniqueItems at the same level as items. If you mean something like: 56 uniqueItems: true 57 items: 58 pattern: '^clkout([0-9]|[12][0-9]|3[0-1])$' Then the dt_binding_check fails: dev/linux/Documentation/devicetree/bindings/arm/samsung/pmu.yaml: properties:clock-names: 'uniqueItems' is not one of ['$ref', 'additionalItems', 'additionalProperties', 'allOf', 'anyOf', 'const', 'contains', 'default', 'dependencies', 'deprecated', 'description', 'else', 'enum', 'items', 'if', 'minItems', 'minimum', 'maxItems', 'maximum', 'not', 'oneOf', 'pattern', 'patternProperties', 'properties', 'required', 'then', 'type', 'typeSize', 'unevaluatedProperties'] Best regards, Krzysztof
On Tue, Oct 8, 2019 at 7:50 AM Krzysztof Kozlowski <krzk@kernel.org> wrote: > > On Tue, Oct 08, 2019 at 07:38:14AM -0500, Rob Herring wrote: > > On Fri, Oct 4, 2019 at 10:14 AM Krzysztof Kozlowski <krzk@kernel.org> wrote: > > > > > > The clkoutN names of clocks must be unique because they represent > > > unique inputs of clock multiplexer. > > > > > > Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> > > > --- > > > Documentation/devicetree/bindings/arm/samsung/pmu.yaml | 6 ++++-- > > > 1 file changed, 4 insertions(+), 2 deletions(-) > > > > > > diff --git a/Documentation/devicetree/bindings/arm/samsung/pmu.yaml b/Documentation/devicetree/bindings/arm/samsung/pmu.yaml > > > index 73b56fc5bf58..d8e03716f5d2 100644 > > > --- a/Documentation/devicetree/bindings/arm/samsung/pmu.yaml > > > +++ b/Documentation/devicetree/bindings/arm/samsung/pmu.yaml > > > @@ -53,8 +53,10 @@ properties: > > > List of clock names for particular CLKOUT mux inputs > > > minItems: 1 > > > maxItems: 32 > > > - items: > > > - pattern: '^clkout([0-9]|[12][0-9]|3[0-1])$' > > > + allOf: > > > + - items: > > > + pattern: '^clkout([0-9]|[12][0-9]|3[0-1])$' > > > + - uniqueItems: true > > > > You shouldn't need the 'allOf', just add uniqueItems at the same level as items. > > If you mean something like: > 56 uniqueItems: true > 57 items: > 58 pattern: '^clkout([0-9]|[12][0-9]|3[0-1])$' > > Then the dt_binding_check fails: > > dev/linux/Documentation/devicetree/bindings/arm/samsung/pmu.yaml: properties:clock-names: > 'uniqueItems' is not one of ['$ref', 'additionalItems', 'additionalProperties', 'allOf', 'anyOf', 'const', 'contains', 'default', 'dependencies', 'deprecated', 'description', 'else', 'enum', 'items', 'if', 'minItems', 'minimum', 'maxItems', 'maximum', 'not', 'oneOf', 'pattern', 'patternProperties', 'properties', 'required', 'then', 'type', 'typeSize', 'unevaluatedProperties'] I can add it. The other option is to fix this in the clock schema. I'm not sure if there's a need for duplicate clock-names. Seems unlikely. I'll test that. Rob
On Tue, Oct 8, 2019 at 9:05 AM Rob Herring <robh+dt@kernel.org> wrote: > > On Tue, Oct 8, 2019 at 7:50 AM Krzysztof Kozlowski <krzk@kernel.org> wrote: > > > > On Tue, Oct 08, 2019 at 07:38:14AM -0500, Rob Herring wrote: > > > On Fri, Oct 4, 2019 at 10:14 AM Krzysztof Kozlowski <krzk@kernel.org> wrote: > > > > > > > > The clkoutN names of clocks must be unique because they represent > > > > unique inputs of clock multiplexer. > > > > > > > > Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> > > > > --- > > > > Documentation/devicetree/bindings/arm/samsung/pmu.yaml | 6 ++++-- > > > > 1 file changed, 4 insertions(+), 2 deletions(-) > > > > > > > > diff --git a/Documentation/devicetree/bindings/arm/samsung/pmu.yaml b/Documentation/devicetree/bindings/arm/samsung/pmu.yaml > > > > index 73b56fc5bf58..d8e03716f5d2 100644 > > > > --- a/Documentation/devicetree/bindings/arm/samsung/pmu.yaml > > > > +++ b/Documentation/devicetree/bindings/arm/samsung/pmu.yaml > > > > @@ -53,8 +53,10 @@ properties: > > > > List of clock names for particular CLKOUT mux inputs > > > > minItems: 1 > > > > maxItems: 32 > > > > - items: > > > > - pattern: '^clkout([0-9]|[12][0-9]|3[0-1])$' > > > > + allOf: > > > > + - items: > > > > + pattern: '^clkout([0-9]|[12][0-9]|3[0-1])$' > > > > + - uniqueItems: true > > > > > > You shouldn't need the 'allOf', just add uniqueItems at the same level as items. > > > > If you mean something like: > > 56 uniqueItems: true > > 57 items: > > 58 pattern: '^clkout([0-9]|[12][0-9]|3[0-1])$' > > > > Then the dt_binding_check fails: > > > > dev/linux/Documentation/devicetree/bindings/arm/samsung/pmu.yaml: properties:clock-names: > > 'uniqueItems' is not one of ['$ref', 'additionalItems', 'additionalProperties', 'allOf', 'anyOf', 'const', 'contains', 'default', 'dependencies', 'deprecated', 'description', 'else', 'enum', 'items', 'if', 'minItems', 'minimum', 'maxItems', 'maximum', 'not', 'oneOf', 'pattern', 'patternProperties', 'properties', 'required', 'then', 'type', 'typeSize', 'unevaluatedProperties'] > > I can add it. > > The other option is to fix this in the clock schema. I'm not sure if > there's a need for duplicate clock-names. Seems unlikely. I'll test > that. Actually, clock-names is already set to be unique. Did you see otherwise? Rob
On Tue, Oct 08, 2019 at 09:17:16AM -0500, Rob Herring wrote: > On Tue, Oct 8, 2019 at 9:05 AM Rob Herring <robh+dt@kernel.org> wrote: > > > > On Tue, Oct 8, 2019 at 7:50 AM Krzysztof Kozlowski <krzk@kernel.org> wrote: > > > > > > On Tue, Oct 08, 2019 at 07:38:14AM -0500, Rob Herring wrote: > > > > On Fri, Oct 4, 2019 at 10:14 AM Krzysztof Kozlowski <krzk@kernel.org> wrote: > > > > > > > > > > The clkoutN names of clocks must be unique because they represent > > > > > unique inputs of clock multiplexer. > > > > > > > > > > Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> > > > > > --- > > > > > Documentation/devicetree/bindings/arm/samsung/pmu.yaml | 6 ++++-- > > > > > 1 file changed, 4 insertions(+), 2 deletions(-) > > > > > > > > > > diff --git a/Documentation/devicetree/bindings/arm/samsung/pmu.yaml b/Documentation/devicetree/bindings/arm/samsung/pmu.yaml > > > > > index 73b56fc5bf58..d8e03716f5d2 100644 > > > > > --- a/Documentation/devicetree/bindings/arm/samsung/pmu.yaml > > > > > +++ b/Documentation/devicetree/bindings/arm/samsung/pmu.yaml > > > > > @@ -53,8 +53,10 @@ properties: > > > > > List of clock names for particular CLKOUT mux inputs > > > > > minItems: 1 > > > > > maxItems: 32 > > > > > - items: > > > > > - pattern: '^clkout([0-9]|[12][0-9]|3[0-1])$' > > > > > + allOf: > > > > > + - items: > > > > > + pattern: '^clkout([0-9]|[12][0-9]|3[0-1])$' > > > > > + - uniqueItems: true > > > > > > > > You shouldn't need the 'allOf', just add uniqueItems at the same level as items. > > > > > > If you mean something like: > > > 56 uniqueItems: true > > > 57 items: > > > 58 pattern: '^clkout([0-9]|[12][0-9]|3[0-1])$' > > > > > > Then the dt_binding_check fails: > > > > > > dev/linux/Documentation/devicetree/bindings/arm/samsung/pmu.yaml: properties:clock-names: > > > 'uniqueItems' is not one of ['$ref', 'additionalItems', 'additionalProperties', 'allOf', 'anyOf', 'const', 'contains', 'default', 'dependencies', 'deprecated', 'description', 'else', 'enum', 'items', 'if', 'minItems', 'minimum', 'maxItems', 'maximum', 'not', 'oneOf', 'pattern', 'patternProperties', 'properties', 'required', 'then', 'type', 'typeSize', 'unevaluatedProperties'] > > > > I can add it. > > > > The other option is to fix this in the clock schema. I'm not sure if > > there's a need for duplicate clock-names. Seems unlikely. I'll test > > that. > > Actually, clock-names is already set to be unique. Did you see otherwise? Yeah, I duplicated on purpose "clkout1" and it was not reported as an error. That's why I added "uniqueItems". Best regards, Krzysztof
On Tue, Oct 8, 2019 at 9:29 AM Krzysztof Kozlowski <krzk@kernel.org> wrote: > > On Tue, Oct 08, 2019 at 09:17:16AM -0500, Rob Herring wrote: > > On Tue, Oct 8, 2019 at 9:05 AM Rob Herring <robh+dt@kernel.org> wrote: > > > > > > On Tue, Oct 8, 2019 at 7:50 AM Krzysztof Kozlowski <krzk@kernel.org> wrote: > > > > > > > > On Tue, Oct 08, 2019 at 07:38:14AM -0500, Rob Herring wrote: > > > > > On Fri, Oct 4, 2019 at 10:14 AM Krzysztof Kozlowski <krzk@kernel.org> wrote: > > > > > > > > > > > > The clkoutN names of clocks must be unique because they represent > > > > > > unique inputs of clock multiplexer. > > > > > > > > > > > > Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> > > > > > > --- > > > > > > Documentation/devicetree/bindings/arm/samsung/pmu.yaml | 6 ++++-- > > > > > > 1 file changed, 4 insertions(+), 2 deletions(-) > > > > > > > > > > > > diff --git a/Documentation/devicetree/bindings/arm/samsung/pmu.yaml b/Documentation/devicetree/bindings/arm/samsung/pmu.yaml > > > > > > index 73b56fc5bf58..d8e03716f5d2 100644 > > > > > > --- a/Documentation/devicetree/bindings/arm/samsung/pmu.yaml > > > > > > +++ b/Documentation/devicetree/bindings/arm/samsung/pmu.yaml > > > > > > @@ -53,8 +53,10 @@ properties: > > > > > > List of clock names for particular CLKOUT mux inputs > > > > > > minItems: 1 > > > > > > maxItems: 32 > > > > > > - items: > > > > > > - pattern: '^clkout([0-9]|[12][0-9]|3[0-1])$' > > > > > > + allOf: > > > > > > + - items: > > > > > > + pattern: '^clkout([0-9]|[12][0-9]|3[0-1])$' > > > > > > + - uniqueItems: true > > > > > > > > > > You shouldn't need the 'allOf', just add uniqueItems at the same level as items. > > > > > > > > If you mean something like: > > > > 56 uniqueItems: true > > > > 57 items: > > > > 58 pattern: '^clkout([0-9]|[12][0-9]|3[0-1])$' > > > > > > > > Then the dt_binding_check fails: > > > > > > > > dev/linux/Documentation/devicetree/bindings/arm/samsung/pmu.yaml: properties:clock-names: > > > > 'uniqueItems' is not one of ['$ref', 'additionalItems', 'additionalProperties', 'allOf', 'anyOf', 'const', 'contains', 'default', 'dependencies', 'deprecated', 'description', 'else', 'enum', 'items', 'if', 'minItems', 'minimum', 'maxItems', 'maximum', 'not', 'oneOf', 'pattern', 'patternProperties', 'properties', 'required', 'then', 'type', 'typeSize', 'unevaluatedProperties'] > > > > > > I can add it. > > > > > > The other option is to fix this in the clock schema. I'm not sure if > > > there's a need for duplicate clock-names. Seems unlikely. I'll test > > > that. > > > > Actually, clock-names is already set to be unique. Did you see otherwise? > > Yeah, I duplicated on purpose "clkout1" and it was not reported as an > error. That's why I added "uniqueItems". Are you running using DT_SCHEMA_FILES? If so, you won't get the core schema. Rob
On Tue, Oct 08, 2019 at 09:38:15AM -0500, Rob Herring wrote:
> Are you running using DT_SCHEMA_FILES? If so, you won't get the core schema.
Ah, yes, now I see proper errors. Thanks for pointing this.
I'll send next version of this patch only (if others are ok).
Best regards,
Krzysztof
On Tue, Oct 08, 2019 at 05:04:56PM +0200, Krzysztof Kozlowski wrote: > On Tue, Oct 08, 2019 at 09:38:15AM -0500, Rob Herring wrote: > > Are you running using DT_SCHEMA_FILES? If so, you won't get the core schema. > > Ah, yes, now I see proper errors. Thanks for pointing this. > > I'll send next version of this patch only (if others are ok). > Of course, there will be no v2, this patch can be just skipped. Best regards, Krzysztof
diff --git a/Documentation/devicetree/bindings/arm/samsung/pmu.yaml b/Documentation/devicetree/bindings/arm/samsung/pmu.yaml index 73b56fc5bf58..d8e03716f5d2 100644 --- a/Documentation/devicetree/bindings/arm/samsung/pmu.yaml +++ b/Documentation/devicetree/bindings/arm/samsung/pmu.yaml @@ -53,8 +53,10 @@ properties: List of clock names for particular CLKOUT mux inputs minItems: 1 maxItems: 32 - items: - pattern: '^clkout([0-9]|[12][0-9]|3[0-1])$' + allOf: + - items: + pattern: '^clkout([0-9]|[12][0-9]|3[0-1])$' + - uniqueItems: true clocks: minItems: 1
The clkoutN names of clocks must be unique because they represent unique inputs of clock multiplexer. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> --- Documentation/devicetree/bindings/arm/samsung/pmu.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)