Devicetree
 help / color / mirror / Atom feed
From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
To: Krzysztof Kozlowski <krzk@kernel.org>
Cc: Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
	Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>,
	Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Wesley Cheng <quic_wcheng@quicinc.com>,
	"linux-arm-msm@vger.kernel.org" <linux-arm-msm@vger.kernel.org>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v4 1/2] dt-bindings: qcom,snps-dwc3: Add property indicating presence of eUSB2 phy
Date: Fri, 10 Jul 2026 21:02:29 +0000	[thread overview]
Message-ID: <alFTxg0HLyke0gCK@vbox> (raw)
In-Reply-To: <7a099224-ea95-40ec-b279-f8834f261e23@kernel.org>

On Fri, Jul 10, 2026, Krzysztof Kozlowski wrote:
> On 10/07/2026 09:16, Krzysztof Kozlowski wrote:
> > On Fri, Jul 10, 2026 at 01:52:45AM +0000, Thinh Nguyen wrote:
> >> On Thu, Jul 09, 2026, Dmitry Baryshkov wrote:
> >>> On Thu, Jul 09, 2026 at 02:22:36PM +0530, Krishna Kurapati wrote:
> >>>> Add property "qcom,has-eusb2-phy" to indicate whether the SoC has eUSB2 phy
> >>>> or not. This is used to modify dp/dm interrupts during host mode suspend.
> >>>>
> >>>> Signed-off-by: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>
> >>>> ---
> >>>>  Documentation/devicetree/bindings/usb/qcom,snps-dwc3.yaml | 7 +++++++
> >>>>  1 file changed, 7 insertions(+)
> >>>>
> >>>> diff --git a/Documentation/devicetree/bindings/usb/qcom,snps-dwc3.yaml b/Documentation/devicetree/bindings/usb/qcom,snps-dwc3.yaml
> >>>> index 8201656b41ed..0c6a839be82f 100644
> >>>> --- a/Documentation/devicetree/bindings/usb/qcom,snps-dwc3.yaml
> >>>> +++ b/Documentation/devicetree/bindings/usb/qcom,snps-dwc3.yaml
> >>>> @@ -152,6 +152,13 @@ properties:
> >>>>        HS/FS/LS modes are supported.
> >>>>      type: boolean
> >>>>  
> >>>> +  qcom,has-eusb2-phy:
> >>>> +    description:
> >>>> +      If present, it indicates that the controller is working with eUSB2
> >>>> +      phy. This property is used to modify dp/dm interrupt configurations
> >>>> +      while entering suspend.
> >>>> +    type: boolean
> >>>
> >>> I still have exactly the same concern. This information is already
> >>> present in the DT.
> >>>
> >>
> >> Could you clarify what you mean by "this information is already present
> >> in the DT"? Are you suggesting we use the dwc3 node's compatible string
> >> to infer the phy type?
> >>
> >> The dwc3 glue compatible describes the controller, not the phy. They are
> >> separate IP blocks. A board variant could reuse the same dwc3 compatible
> >> with a different phy attached, making that inference silently wrong.
> >>
> >> The phy type is described somewhere else in the DT (in the phy node
> >> itself), referenced via the phy's phandle on the dwc3 core child node.
> >> We could walk that phandle and check whether the phy node's compatible
> >> contains "eusb2". However, that relies on a naming convention that isn't
> >> enforced anywhere. All current eusb2 phy compatibles happen to follow it
> >> (qcom,sm8550-snps-eusb2-phy, qcom,sm8750-m31-eusb2-phy,
> >> samsung,exynos2200-eusb2-phy, etc.), but a future phy driver could break
> > 
> > You have a fixed/finite list of phys which needs something special, so
> > that information as Dmitry said is in DT already.

Are you referring to a fixed list of eusb2 phy compatibles, or a fixed
list of dwc3 node compatibles?

Either way, the list is not fixed. New eusb2 SoC variants are added
regularly, and there are already 12 eusb2 phy compatible strings in the
DT bindings but only 3 in the PHY driver of_match tables, they don't
land at the same time. As for what information is already in DT, I've
addressed this above and in my earlier response.

> > 
> > Anyway, the commit msg and property field have insufficient description
> > of actual hardware problem being represented by this property, so it
> > looks way too much as SW policy.

That's fair feedback to raise with Krishna.

> 
> 
> And Dmitry already said this at v3.

And I've already responded to his comment in v3:
https://lore.kernel.org/linux-usb/ahjYwJtiMsm0BcCh@vbox/

> 
> And Sashiko gave the same review:
> "[Medium] The `qcom,has-eusb2-phy` property introduces a redundant
> boolean flag that duplicates existing hardware topology information, and
> its description incorrectly encodes software behavior."
> 

Are we relying on AI for expert reviews now? If so, here's what Claude
says:
    The DWC3 glue compatible is not a proxy for PHY type. It identifies
    the controller IP, while the PHY is an entirely separate block
    connected via phandle. With a single fallback compatible
    (qcom,snps-dwc3) covering 50+ SoC variants, there is no reliable
    mapping from DWC3 compatible to PHY type — the same string can
    appear on platforms with different PHYs.

    Inferring from the PHY node's compatible string is equally
    problematic. The "eusb2" substring appears consistently today, but
    this is coincidence, not a binding contract. Nothing in the DT
    schema enforces it. An allowlist in dwc3-qcom.c would need updating
    every time a new eUSB2 PHY is introduced — and as the gap between DT
    bindings and PHY driver of_match tables shows, those additions don't
    always land together.

    A boolean property on the DWC3 node is unambiguous,
    schema-validated, and places the decision with the DT author who has
    full knowledge of the platform's PHY topology.

BR,
Thinh

  reply	other threads:[~2026-07-10 22:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-09  8:52 [PATCH v4 0/2] Modify interrupt handling for eUSB2 Phy targets Krishna Kurapati
2026-07-09  8:52 ` [PATCH v4 1/2] dt-bindings: qcom,snps-dwc3: Add property indicating presence of eUSB2 phy Krishna Kurapati
2026-07-09  9:01   ` sashiko-bot
2026-07-09 13:47   ` Dmitry Baryshkov
2026-07-10  1:52     ` Thinh Nguyen
2026-07-10  7:16       ` Krzysztof Kozlowski
2026-07-10  7:19         ` Krzysztof Kozlowski
2026-07-10 21:02           ` Thinh Nguyen [this message]
2026-07-09  8:52 ` [PATCH v4 2/2] usb: dwc3: qcom: Modify interrupt handling for eUSB2 Phy targets Krishna Kurapati
2026-07-09  9:07   ` 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=alFTxg0HLyke0gCK@vbox \
    --to=thinh.nguyen@synopsys.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.baryshkov@oss.qualcomm.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=krishna.kurapati@oss.qualcomm.com \
    --cc=krzk+dt@kernel.org \
    --cc=krzk@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=quic_wcheng@quicinc.com \
    --cc=robh@kernel.org \
    /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