Devicetree
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Gokul Praveen <g-praveen@ti.com>
Cc: conor+dt@kernel.org, devicetree@vger.kernel.org,
	krzk+dt@kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org,
	neil.armstrong@linaro.org, nm@ti.com, robh@kernel.org,
	sjakhade@cadence.com, kristo@kernel.org, vigneshr@ti.com,
	vkoul@kernel.org, yamonkar@cadence.com
Subject: Re: [PATCH v4 net-next 1/2] dt-bindings: phy: cadence-torrent: Update property values to support 3 clocks
Date: Thu, 2 Jul 2026 09:38:36 +0200	[thread overview]
Message-ID: <b0415193-76c8-4b1b-9582-8a4a220eae9f@kernel.org> (raw)
In-Reply-To: <f40839d9-445e-4e48-ada9-97feb8e40584@ti.com>

On 02/07/2026 09:35, Gokul Praveen wrote:
> Hi Krzystof,
> 
> On 02/07/26 11:53, Krzysztof Kozlowski wrote:
>> On Wed, Jul 01, 2026 at 07:54:56PM +0530, Gokul Praveen wrote:
>>> Update maxItems value of "clocks" property to 3 as description of
>>> this parameter already indicates 3 clocks(refclk,pll1_refclk(optional)
>>> and phy_en_refclk(optional)).
>> But what if description is wrong? You need to provide rationale why you
>> are doing it and you cannot use existing code alone as that rationale,
>> because as you pointed out - existing code is not fully correct.
> 
> The description is correct because not all device may have 2 input  

I do not see how you proved it in the commit msg.

> reference clocks , hence keeping the requirement of the 2nd reference 
> clock(pll1_refclk) optional.
> 
> Just as a note: phy_en_refclk is an output clock.

output clocks do not go to input clocks property.

> 
> In those cases the multilink serdes configurations requiring 2 different 
> input reference clocks will not work due to the limitation of having 
> only 1 clock.
> 
> However, when it comes to devices where 2 different input reference 
> clocks are supported and a multilink serdes configuration is 
> needed(where the links require separate reference clocks for each 
> protocol so as to cater to the  different clocking speed requirements of 
> these links).
> 
> Hence, in this case ,2 different input clocks are needed so as to cater 
> to 2 different clock speeds.
> 
> For eg: In the USXGMII+SGMII multilink serdes configuration which I had 
> tested, it failed because
> 
> USXGMII requires an input clock speed of 156.25 Mhz and SGMII protocol 
> requires an input clock speed of 100 Mhz.
> 
> But, since there was only one input clock(refclk) mentioned in the 
> clocks and clock-name parameter , this multilink serdes configuration 
> failed.
> 
> Hence, to make it work, the pll1_refclk had to be added which provided a 
> clock speed of 156.25 Mhz for USXGMI and the refclk provided
> 
> a clock speed of 100 Mhz  for SGMII.
> 
>>> Update the maxItems and items value of "clock-names" property with multiple
>>> combination of clock-names possible since pll1_refclk and phy_en_refclk are
>>> optional clocks.
>> Why? You need to describe why you are doing this, not what you are
>> doing.
> Sure , Krzysztof, I will be careful about that and prioritize that in 
> the commit message.
>>> Signed-off-by: Gokul Praveen <g-praveen@ti.com>
>>> ---
>>>   .../bindings/phy/phy-cadence-torrent.yaml        | 16 ++++++++++++----
>>>   1 file changed, 12 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/Documentation/devicetree/bindings/phy/phy-cadence-torrent.yaml b/Documentation/devicetree/bindings/phy/phy-cadence-torrent.yaml
>>> index 9af39b33646a..96c664d50629 100644
>>> --- a/Documentation/devicetree/bindings/phy/phy-cadence-torrent.yaml
>>> +++ b/Documentation/devicetree/bindings/phy/phy-cadence-torrent.yaml
>>> @@ -34,7 +34,7 @@ properties:
>>>   
>>>     clocks:
>>>       minItems: 1
>>> -    maxItems: 2
>>> +    maxItems: 3
>>>       description:
>>>         PHY input reference clocks - refclk (for PLL0) & pll1_refclk (for PLL1).
>>>         pll1_refclk is optional and used for multi-protocol configurations requiring
>>> @@ -45,9 +45,17 @@ properties:
>>>   
>>>     clock-names:
>>>       minItems: 1
>>> -    items:
>>> -      - const: refclk
>>> -      - enum: [ pll1_refclk, phy_en_refclk ]
>>> +    maxItems: 3
>> Drop
> Sure, i will do that Krzysztof.
>>> +    oneOf:
>>> +      - items:
>>> +          - const: refclk
>>> +      - items:
>>> +          - const: refclk
>>> +          - enum: [ pll1_refclk, phy_en_refclk ]
>> Drop these, pointless. You were supposed to grow existing syntax.
>>
>>> +      - items:
>>> +          - const: refclk
>>> +          - const: pll1_refclk
>> So here is the enum.
>>
>>> +          - const: phy_en_refclk
>> And this stays.
>>
>> You make changes which do not make the binding better and are not
>> explained in commit msg. Focus on WHY you are doing things and also
>> explain WHY you did such complicated syntax (if you insist on rewriting
>> correct code into something odd we do not expect).
> 
> So, the reason I added the oneOf property is to support the following 
> combinations because pll1_refclk and phy_en_refclk are optional clocks. 
> With the earlier enum , only either of pll1_refclk or phy_en_refclk
> 
> can be used and both cannot be used at the same time.
> 
> Combination 1: refclk
> 
> Combination 2 : refclk, pll1_refclk
> 
> Combination 3: reclk, phy_en_refclk
> 
> Combination 4: refclk, pll1_refclk, phy_en_refclk
> 
> 
> Please feel free to suggest any alternative solution to support these 
> combinations .

I already did. Read the feedback carefully.

Best regards,
Krzysztof

  reply	other threads:[~2026-07-02  7:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-01 14:24 [PATCH v4 net-next 0/2] Add multilink SERDES configuration support Gokul Praveen
2026-07-01 14:24 ` [PATCH v4 net-next 1/2] dt-bindings: phy: cadence-torrent: Update property values to support 3 clocks Gokul Praveen
2026-07-02  6:23   ` Krzysztof Kozlowski
2026-07-02  7:35     ` Gokul Praveen
2026-07-02  7:38       ` Krzysztof Kozlowski [this message]
2026-07-02  8:56     ` Gokul Praveen
2026-07-01 14:24 ` [PATCH v4 net-next 2/2] arm64: dts: ti: Add PLL1 refclk to J784S4 SoC SERDES node Gokul Praveen
2026-07-01 14:34   ` sashiko-bot

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=b0415193-76c8-4b1b-9582-8a4a220eae9f@kernel.org \
    --to=krzk@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=g-praveen@ti.com \
    --cc=kristo@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=neil.armstrong@linaro.org \
    --cc=nm@ti.com \
    --cc=robh@kernel.org \
    --cc=sjakhade@cadence.com \
    --cc=vigneshr@ti.com \
    --cc=vkoul@kernel.org \
    --cc=yamonkar@cadence.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