Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Akhil P Oommen <akhilpo@oss.qualcomm.com>
Cc: Rob Clark <robin.clark@oss.qualcomm.com>,
	Sean Paul <sean@poorly.run>,
	Konrad Dybcio <konradybcio@kernel.org>,
	Dmitry Baryshkov <lumag@kernel.org>,
	Abhinav Kumar <abhinav.kumar@linux.dev>,
	Marijn Suijten <marijn.suijten@somainline.org>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Jessica Zhang <jesszhan0024@gmail.com>,
	Dan Carpenter <dan.carpenter@linaro.org>,
	linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org,
	freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	devicetree@vger.kernel.org
Subject: Re: [PATCH v3 2/6] dt-bindings: display/msm: gpu: Document A612 GPU
Date: Sat, 29 Nov 2025 10:21:47 +0100	[thread overview]
Message-ID: <5bad57b5-ab05-477e-b8e9-5086139b2326@kernel.org> (raw)
In-Reply-To: <a6a172bc-9f76-4e12-8925-35319baabb62@oss.qualcomm.com>

On 28/11/2025 11:29, Akhil P Oommen wrote:
> On 11/25/2025 1:28 PM, Krzysztof Kozlowski wrote:
>> On 24/11/2025 22:39, Akhil P Oommen wrote:
>>> On 11/22/2025 4:32 PM, Krzysztof Kozlowski wrote:
>>>> On Sat, Nov 22, 2025 at 03:22:16AM +0530, Akhil P Oommen wrote:
>>>>> +
>>>>> +  - if:
>>>>> +      properties:
>>>>> +        compatible:
>>>>> +          contains:
>>>>> +            const: qcom,adreno-612.0
>>>>> +    then:
>>>>> +      properties:
>>>>> +        clocks:
>>>>> +          items:
>>>>> +            - description: GPU Core clock
>>>>> +
>>>>> +        clock-names:
>>>>> +          items:
>>>>> +            - const: core
>>>>> +
>>>>> +      required:
>>>>> +        - clocks
>>>>> +        - clock-names
>>>>> +
>>>>>      else:
>>>>
>>>> I am pretty sure you break not only intention/logic behindi this else,
>>>> but actually cause real warnings to appear.
>>>>
>>>> The else was intentional, right? So the pattern further will not match
>>>> some of devices defined in if:. Now else is for different part, so only
>>>> 612 out of these devices is excluded.
>>>>
>>>> There is a reason we do not want ever else:if: in bindings. If it
>>>> appeared, sure, maybe there is some benefit of it, but it means you need
>>>> to be more careful now.
>>>
>>> Aah! I missed that this comes under an 'allOf'. Not an expert in this
>>
>> The allOf does not matter here. If these were separate if:then: then it
>> would be the same.
>>
>>> syntax, does moving this entire block under an 'else' make sense? Or is
>>
>> No, never nest blocks.
>>
>>> there a saner alternative?
>>
>> Not sure, I don't remember the code. Original code was not easy to read,
>> with your changes it will not be easier. So the only alternative I see
>> is to make it simple and obvious.
> 
> Could you please confirm if the below change would be okay?
> 
> @@ -384,6 +384,31 @@ allOf:
> 
>   - if:
>       properties:
>         compatible:
>           contains:
>             enum:
>               - qcom,adreno-610.0
>               - qcom,adreno-619.1
>               - qcom,adreno-07000200
>     then:
>       properties:
>         clocks:
>           minItems: 6
>           maxItems: 6
> 
>         clock-names:
>           items:
>             - const: core
>               description: GPU Core clock
>             - const: iface
>               description: GPU Interface clock
>             - const: mem_iface
>               description: GPU Memory Interface clock
>             - const: alt_mem_iface
>               description: GPU Alternative Memory Interface clock
>             - const: gmu
>               description: CX GMU clock
>             - const: xo
>               description: GPUCC clocksource clock
> 
>         reg-names:
>           minItems: 1
>           items:
>              - const: kgsl_3d0_reg_memory
>              - const: cx_dbgc
> 
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            const: qcom,adreno-612.0
> +    then:
> +      properties:
> +        clocks:
> +          items:
> +            - description: GPU Core clock
> +
> +        clock-names:
> +          items:
> +            - const: core
> +
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - qcom,adreno-610.0
> +              - qcom,adreno-612.0
> +              - qcom,adreno-619.1
> +              - qcom,adreno-07000200
> +    then:
>       required:
>         - clocks
>         - clock-names

Yes, this should work, but I think it is better to require clocks in the
same block which defines them. You also need to restrict reg/reg-names
for the new device.

> 
>     else:
>       if:
>         properties:
>           compatible:
>             contains:
>               oneOf:
>                 - pattern: '^qcom,adreno-[67][0-9][0-9]\.[0-9]+$'
>                 - pattern: '^qcom,adreno-[0-9a-f]{8}$'

This if:else:if: should be just removed and written in a way to choose
specific devices affected here. The code is not readable and your
mistake was a proof of that.

> 
>       then: # Starting with A6xx, the clocks are usually defined in the
>         properties:
Best regards,
Krzysztof

  reply	other threads:[~2025-11-29  9:21 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-21 21:52 [PATCH v3 0/6] Support for Adreno 612 GPU - Respin Akhil P Oommen
2025-11-21 21:52 ` [PATCH v3 1/6] drm/msm/a6xx: Retrieve gmu core range by index Akhil P Oommen
2025-11-21 22:43   ` Dmitry Baryshkov
2025-11-22 13:38   ` Konrad Dybcio
2025-11-24 22:10     ` Akhil P Oommen
2025-12-04 13:10     ` Akhil P Oommen
2025-12-04 13:30       ` Konrad Dybcio
2025-12-04 14:34         ` Rob Clark
2025-12-05 12:03           ` Konrad Dybcio
2025-11-21 21:52 ` [PATCH v3 2/6] dt-bindings: display/msm: gpu: Document A612 GPU Akhil P Oommen
2025-11-22 11:02   ` Krzysztof Kozlowski
2025-11-24 21:39     ` Akhil P Oommen
2025-11-25  7:58       ` Krzysztof Kozlowski
2025-11-28 10:29         ` Akhil P Oommen
2025-11-29  9:21           ` Krzysztof Kozlowski [this message]
2025-11-21 21:52 ` [PATCH v3 3/6] dt-bindings: display/msm/rgmu: Document A612 RGMU Akhil P Oommen
2025-11-22 11:03   ` Krzysztof Kozlowski
2025-11-21 21:52 ` [PATCH v3 4/6] arm64: dts: qcom: sm6150: add the GPU SMMU node Akhil P Oommen
2025-11-21 22:32   ` Dmitry Baryshkov
2025-11-22 13:59   ` Konrad Dybcio
2025-11-21 21:52 ` [PATCH v3 5/6] arm64: dts: qcom: sm6150: Add gpu and rgmu nodes Akhil P Oommen
2025-11-21 22:43   ` Dmitry Baryshkov
2025-11-22 14:03   ` Konrad Dybcio
2025-11-26  0:42     ` Dmitry Baryshkov
2025-12-04 10:13       ` Akhil P Oommen
2025-12-04 13:31         ` Konrad Dybcio
2025-12-05 13:41           ` Akhil P Oommen
2025-12-05 13:52             ` Konrad Dybcio
2025-12-05 14:05               ` Akhil P Oommen
2025-12-17 12:31                 ` Konrad Dybcio
2025-12-04 14:19         ` Dmitry Baryshkov
2025-12-05 10:29           ` Akhil P Oommen
2025-12-05 20:34             ` Dmitry Baryshkov
2025-12-10 21:10               ` Akhil P Oommen
2025-12-11  0:36                 ` Dmitry Baryshkov
2025-12-11 11:12                   ` Akhil P Oommen
2025-12-11 11:52                     ` Akhil P Oommen
2025-12-11 13:26                       ` Dmitry Baryshkov
2025-12-11 19:31                         ` Akhil P Oommen
2025-12-12 19:28                           ` Dmitry Baryshkov
2025-12-22  7:19                             ` Akhil P Oommen
2025-12-22  9:15                               ` Dmitry Baryshkov
2025-12-22 10:54                                 ` Akhil P Oommen
2025-12-22 11:24                                   ` Dmitry Baryshkov
2025-12-22 18:29                                     ` Akhil P Oommen
2025-12-24  0:37                                       ` Dmitry Baryshkov
2025-11-21 21:52 ` [PATCH v3 6/6] arm64: dts: qcom: qcs615-ride: Enable Adreno 612 GPU Akhil P Oommen
2025-11-21 22:44   ` Dmitry Baryshkov
2025-11-24 14:28 ` [PATCH v3 0/6] Support for Adreno 612 GPU - Respin Rob Herring

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=5bad57b5-ab05-477e-b8e9-5086139b2326@kernel.org \
    --to=krzk@kernel.org \
    --cc=abhinav.kumar@linux.dev \
    --cc=airlied@gmail.com \
    --cc=akhilpo@oss.qualcomm.com \
    --cc=andersson@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=dan.carpenter@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=jesszhan0024@gmail.com \
    --cc=konradybcio@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lumag@kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=marijn.suijten@somainline.org \
    --cc=mripard@kernel.org \
    --cc=robh@kernel.org \
    --cc=robin.clark@oss.qualcomm.com \
    --cc=sean@poorly.run \
    --cc=simona@ffwll.ch \
    --cc=tzimmermann@suse.de \
    /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