From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 986391DE89C for ; Mon, 10 Mar 2025 17:35:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741628104; cv=none; b=bSrOpZPotxeyYXvMWoZUUwP0KmBvMu7Un9TM4E8B+5Y0tTbGhsAbCTPi34FgYKQWYB7Xw7ADrJ65aoM4tqrQhjzG93C8LWyBt2GivCNzSPXK+yvwtaxU6wkhuz6v+RoEFpxDGEZN/cfDnG3kDGhSnOrOI4VUVN11t60jD5a+6xs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741628104; c=relaxed/simple; bh=ebmnlRJLW9EKdXGx/lld0Ko4HRB+e24LWFwQ0Ym8SqU=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=eu0iul0m9Jun1GOBzIEeODTpdrWnfI5tOG4mEoB7lh4roVq7KL2smsV2TdpkNGP05s82vX3hODNXmnnOj/yZ6CVsqKUlYYCaE55+3kK+iPqiwOXQ1+ZxvRyHAUpmzMxJJdlBeO801IXCZp6g07YL+a5rgYZwK2N21Txl5uU6KNg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=O4/CQePa; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="O4/CQePa" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5D246C4CEE5; Mon, 10 Mar 2025 17:34:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1741628104; bh=ebmnlRJLW9EKdXGx/lld0Ko4HRB+e24LWFwQ0Ym8SqU=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=O4/CQePa3rImkHy6pSVkICKnYDcMUSjCBIl29XTsUgvlZ8gaAbCV23UqlHsui8oWj 5l7ED8gGpwmq4HSn9VpuiBJvor6T8+js3xvHXbtZ6BO5vwp7RQDarX9BybCfk+MBKX nfns71YVygCM55EaCxudYykBLqBHVLVF0tPk0kfTN1IWoQnJuovTMXTtUOz+Z1/cD8 N2tu6T5oRYYFUp/5LLKOB6WYvVsdZapoPSfjNcCSaGATosWqspT9qDJm4kKxyU9gjj jSR+d012Gx7KY482dwotAT7ZrAfpSN7I7Lhp6b3yaCdq+wtWBpDVn6/rpAB/F2BLQW XWTwRUMb+Ay0A== Message-ID: <130b6c9e-9e11-433c-881f-1a7ea8b0f86e@kernel.org> Date: Mon, 10 Mar 2025 18:34:57 +0100 Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 4/6] dt-bindings: gpu: v3d: Add SMS to the registers' list To: =?UTF-8?Q?Ma=C3=ADra_Canal?= Cc: Melissa Wen , Iago Toral , Jose Maria Casanova Crespo , Phil Elwell , dri-devel@lists.freedesktop.org, kernel-dev@igalia.com, Krzysztof Kozlowski , Conor Dooley , Nicolas Saenz Julienne , devicetree@vger.kernel.org References: <20250308-v3d-gpu-reset-fixes-v2-0-2939c30f0cc4@igalia.com> <20250308-v3d-gpu-reset-fixes-v2-4-2939c30f0cc4@igalia.com> <20250310-calculating-flat-cuttlefish-4c9fc2@krzk-bin> <4d224fc2-d077-47aa-8b52-edba30c62d19@igalia.com> <6f87918b-b4ca-4404-8f1e-e1100190c0f6@kernel.org> <2bc573c6-e44f-441b-9b13-baa7df64a641@igalia.com> From: Kr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Yyl6gU BLHFTg2hYnLFJI4Xjg+AX1hHFVKmvl3VBHIsBv0oDcsQWXqY+NaFahT0lRPjYtrTa1v3tem/ JoFzZ4B0p27K+qQCF2R96hVvuEyjzBmdq2esyE6zIqftdo4MOJho8uctOiWbwNNq2U9pPWmu 4vXVFBYIGmpyNPYzRm0QPwARAQABwsF8BBgBCgAmAhsMFiEEm9B+DgxR+NWWd7dUG5NDfTtB YpsFAmA872oFCRRflLYACgkQG5NDfTtBYpvScw/9GrqBrVLuJoJ52qBBKUBDo4E+5fU1bjt0 Gv0nh/hNJuecuRY6aemU6HOPNc2t8QHMSvwbSF+Vp9ZkOvrM36yUOufctoqON+wXrliEY0J4 ksR89ZILRRAold9Mh0YDqEJc1HmuxYLJ7lnbLYH1oui8bLbMBM8S2Uo9RKqV2GROLi44enVt vdrDvo+CxKj2K+d4cleCNiz5qbTxPUW/cgkwG0lJc4I4sso7l4XMDKn95c7JtNsuzqKvhEVS oic5by3fbUnuI0cemeizF4QdtX2uQxrP7RwHFBd+YUia7zCcz0//rv6FZmAxWZGy5arNl6Vm lQqNo7/Poh8WWfRS+xegBxc6hBXahpyUKphAKYkah+m+I0QToCfnGKnPqyYIMDEHCS/RfqA5 t8F+O56+oyLBAeWX7XcmyM6TGeVfb+OZVMJnZzK0s2VYAuI0Rl87FBFYgULdgqKV7R7WHzwD uZwJCLykjad45hsWcOGk3OcaAGQS6NDlfhM6O9aYNwGL6tGt/6BkRikNOs7VDEa4/HlbaSJo 7FgndGw1kWmkeL6oQh7wBvYll2buKod4qYntmNKEicoHGU+x91Gcan8mCoqhJkbqrL7+nXG2 5Q/GS5M9RFWS+nYyJh+c3OcfKqVcZQNANItt7+ULzdNJuhvTRRdC3g9hmCEuNSr+CLMdnRBY fv0= In-Reply-To: <2bc573c6-e44f-441b-9b13-baa7df64a641@igalia.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 >>>>> --- >>>>> .../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