From: Krzysztof Kozlowski <krzk@kernel.org>
To: "Maíra Canal" <mcanal@igalia.com>
Cc: Melissa Wen <mwen@igalia.com>, Iago Toral <itoral@igalia.com>,
Jose Maria Casanova Crespo <jmcasanova@igalia.com>,
Phil Elwell <phil@raspberrypi.com>,
dri-devel@lists.freedesktop.org, kernel-dev@igalia.com,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Nicolas Saenz Julienne <nsaenz@kernel.org>,
devicetree@vger.kernel.org
Subject: Re: [PATCH v2 4/6] dt-bindings: gpu: v3d: Add SMS to the registers' list
Date: Mon, 10 Mar 2025 18:34:57 +0100 [thread overview]
Message-ID: <130b6c9e-9e11-433c-881f-1a7ea8b0f86e@kernel.org> (raw)
In-Reply-To: <2bc573c6-e44f-441b-9b13-baa7df64a641@igalia.com>
On 10/03/2025 14:15, Maíra Canal wrote:
> Hi Krzysztof,
>
> On 3/10/25 09:55, Krzysztof Kozlowski wrote:
>> On 10/03/2025 12:57, Maíra Canal wrote:
>>>>
>>>>> Signed-off-by: Maíra Canal <mcanal@igalia.com>
>>>>> ---
>>>>> .../devicetree/bindings/gpu/brcm,bcm-v3d.yaml | 60 ++++++++++++++++++++--
>>>>> 1 file changed, 55 insertions(+), 5 deletions(-)
>>>>>
>>>>> diff --git a/Documentation/devicetree/bindings/gpu/brcm,bcm-v3d.yaml b/Documentation/devicetree/bindings/gpu/brcm,bcm-v3d.yaml
>>>>> index dc078ceeca9ac3447ba54a7c8830821f0b2a7f9f..c0caee055e8c18dbcac0e51aa192951996545695 100644
>>>>> --- a/Documentation/devicetree/bindings/gpu/brcm,bcm-v3d.yaml
>>>>> +++ b/Documentation/devicetree/bindings/gpu/brcm,bcm-v3d.yaml
>>>>> @@ -27,15 +27,12 @@ properties:
>>>>> - description: core0 register (required)
>>>>> - description: GCA cache controller register (if GCA controller present)
>>>>> - description: bridge register (if no external reset controller)
>>>>> + - description: SMS register (if SMS controller present)
>>>>
>>>> This lists five items, but you say you have max 4?
>>>
>>> V3D 3.1 uses hub, core0, gca, and bridge (optional)
>>> V3D 4.1 and 4.2 uses hub, core, and bridge (optional)
>>> V3D 7.1 uses hub, core0, sms, and bridge (optional)
>>>
>>> Therefore, for a given DT, you will have 4 items max.
>>
>> And how many items do you have here?
>>
>>>
>>>>
>>>>> minItems: 2
>>>>>
>>>>> reg-names:
>>>>> - items:
>>>>> - - const: hub
>>>>> - - const: core0
>>>>> - - enum: [ bridge, gca ]
>>>>> - - enum: [ bridge, gca ]
>>>>> minItems: 2
>>>>> + maxItems: 4
>>>>
>>>> So here 4, but earlier 5? These must come in sync.
>>>
>>> I added maxItems for reg in the allOf section.
>>
>> I don't think you answer the comments. I said you listed earlier 5 items
>> and then you answered with saying devices have 4 items. Here I said
>> these properties must be synced and you said why you added maxItems...
>> Not related, read again the feedback.
>
> I'm sorry, I don't usually write DTBs. I believe what I need is to
> specify the reg items for each compatible, right?
You need to list four items in 'reg' and last items' description would
need to describe two different sets.
And commit msg must explain why now this device needs to use sms, not
gca. Why you cannot use the gca range instead of sms? So many questions.
>
>>
>>
>>>
>>>>
>>>>>
>>>>> interrupts:
>>>>> items:
>>>>> @@ -60,6 +57,59 @@ required:
>>>>>
>>>>> additionalProperties: false
>>>>>
>>>>> +allOf:
>>>>
>>>> This goes above additionalProperties.
>>>
>>> Got it.
>>>
>>>>
>>>>> + - if:
>>>>> + properties:
>>>>> + compatible:
>>>>> + contains:
>>>>> + enum:
>>>>> + - brcm,2711-v3d
>>>>> + - brcm,7278-v3d
>>>>> + then:
>>>>> + properties:
>>>>> + reg:
>>>>> + minItems: 2
>>>>> + maxItems: 3
>>>>> + reg-names:
>>>>> + items:
>>>>> + - const: hub
>>>>> + - const: core0
>>>>> + - const: bridge
>>>>
>>>> Again un-synced lists.
>>>
>>> Sorry, what do you mean by un-synced lists?
>>
>> xxx and xxx-names must have the same constraints. They do not have here.
>> You have two different constraints and you can test your DTS to see that.
> >
>
> I used `make dt_binding_check` to test it and it didn't catch any
> errors.
So change the example to have one list with two items and second list
with three items. Is it correct DTS? No. Does this pass tests? Yes.
>
>>>
>>>>
>>>>> + - if:
>>>>> + properties:
>>>>> + compatible:
>>>>> + contains:
>>>>> + const: brcm,2712-v3d
>>>>> + then:
>>>>> + properties:
>>>>> + reg:
>>>>> + minItems: 3
>>>>> + maxItems: 4
>>>>> + reg-names:
>>>>> + items:
>>>>> + - const: hub
>>>>> + - const: core0
>>>>> + - enum: [ bridge, sms ]
>>>>> + - enum: [ bridge, sms ]
>>>>> + minItems: 3
>>>>
>>>> Why is this flexible?
>>>
>>> I cannot guarantee the order and bridge is optional.
>>
>> Hm? You must guarantee the order and I do not understand why this needs
>> some sort of exception from all other bindings that only here you cannot
>> guarantee the order.
>
> I'm trying to keep backwards compatibility. This binding exists for many
> years and it always used "enum: [ bridge, gca ]".
But it is now sms, not gca,, so I do not see how the ABI is preserved.
Best regards,
Krzysztof
next prev parent reply other threads:[~2025-03-10 17:35 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-08 14:33 [PATCH v2 0/6] drm/v3d: Fix GPU reset issues on the Raspberry Pi 5 Maíra Canal
2025-03-08 14:33 ` [PATCH v2 4/6] dt-bindings: gpu: v3d: Add SMS to the registers' list Maíra Canal
2025-03-10 9:49 ` Krzysztof Kozlowski
2025-03-10 11:57 ` Maíra Canal
2025-03-10 12:55 ` Krzysztof Kozlowski
2025-03-10 13:15 ` Maíra Canal
2025-03-10 17:34 ` Krzysztof Kozlowski [this message]
2025-03-10 20:07 ` Maíra Canal
2025-03-11 7:40 ` Krzysztof Kozlowski
2025-03-08 14:33 ` [PATCH v2 6/6] dt-bindings: gpu: Add V3D driver maintainer as DT maintainer Maíra Canal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=130b6c9e-9e11-433c-881f-1a7ea8b0f86e@kernel.org \
--to=krzk@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=itoral@igalia.com \
--cc=jmcasanova@igalia.com \
--cc=kernel-dev@igalia.com \
--cc=krzk+dt@kernel.org \
--cc=mcanal@igalia.com \
--cc=mwen@igalia.com \
--cc=nsaenz@kernel.org \
--cc=phil@raspberrypi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).