[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <399ac8fd-b5b1-50ae-c1bd-88951679cf83@linaro.org>
Date: Tue, 13 Jun 2023 08:55:13 +0200
From: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
To: Serge Semin <fancer.lancer@...il.com>
Cc: Sebastian Reichel <sebastian.reichel@...labora.com>,
Heiko Stuebner <heiko@...ech.de>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Damien Le Moal <damien.lemoal@...nsource.wdc.com>,
Vinod Koul <vkoul@...nel.org>,
Kishon Vijay Abraham I <kishon@...nel.org>,
linux-ide@...r.kernel.org, linux-phy@...ts.infradead.org,
linux-rockchip@...ts.infradead.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, kernel@...labora.com
Subject: Re: [PATCH v3 2/5] dt-bindings: ata: dwc-ahci: add Rockchip RK3588
On 12/06/2023 10:52, Serge Semin wrote:
> On Mon, Jun 12, 2023 at 10:39:57AM +0200, Krzysztof Kozlowski wrote:
>> On 12/06/2023 10:35, Serge Semin wrote:
>>> On Mon, Jun 12, 2023 at 10:24:06AM +0200, Krzysztof Kozlowski wrote:
>>>> On 08/06/2023 18:22, Sebastian Reichel wrote:
>>>>> This adds Rockchip RK3588 AHCI binding. In order to narrow down the
>>>>> allowed clocks without bloating the generic binding, the description
>>>>> of Rockchip's AHCI controllers has been moved to its own file.
>>>>>
>>>>> Signed-off-by: Sebastian Reichel <sebastian.reichel@...labora.com>
>>>>> ---
>>>>
>>>> ...
>>>>
>>>>> +
>>>>> +properties:
>>>>> + compatible:
>>>>> + items:
>>>>> + - enum:
>>>>> + - rockchip,rk3568-dwc-ahci
>>>>> + - rockchip,rk3588-dwc-ahci
>>>>> + - const: snps,dwc-ahci
>>>>> +
>>>>> + ports-implemented:
>>>>> + const: 1
>>>>> +
>>>>> +patternProperties:
>>>>> + "^sata-port@[0-9a-e]$":
>>>>> + $ref: /schemas/ata/snps,dwc-ahci-common.yaml#/$defs/dwc-ahci-port
>>>>> +
>>>>> + unevaluatedProperties: false
>>>>
>>>
>>>> You should be able to skip this patternProperties entirely, because it
>>>> comes from dwc-ahci-common -> ahci-common schema. Did you try the patch
>>>> without it?
>>>
>
>>> Please see my message about this. The "sata-port@[0-9a-e]$" sub-node
>>> bindings could be updated with the "reg" property constraint which,
>>> based on the "ports-implemented" property value, most likely is
>>> supposed to be always set to const: 1.
>>
>> Then anyway the pattern is wrong as it should be @1 always.
>
> * I miscalculated a bit, it should have been zero but in general
> the pattern-property is indeed redundant.
>
> As a conclusion the change should look like this:
>
> +properties:
> + compatible:
> + items:
> + - enum:
> + - rockchip,rk3568-dwc-ahci
> + - rockchip,rk3588-dwc-ahci
> + - const: snps,dwc-ahci
> +
> + ports-implemented:
> + const: 1
> +
> + "sata-port@0":
> + $ref: /schemas/ata/snps,dwc-ahci-common.yaml#/$defs/dwc-ahci-port
> +
> + properties:
> + reg:
> + const: 0
> +
> + unevaluatedProperties: false
> +
> + ...
>
> Right?
Code is correct but as I said - probably meaningless. All other ports
are also accepted via referenced schema. You would need to disallow
other ports or switch to additionalProperties: false in top-level.
Best regards,
Krzysztof
Powered by blists - more mailing lists