The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
To: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>
Cc: Sebastian Reichel <sebastian.reichel@collabora.com>,
	Vinod Koul <vkoul@kernel.org>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"linux-phy@lists.infradead.org" <linux-phy@lists.infradead.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-arm-msm@vger.kernel.org" <linux-arm-msm@vger.kernel.org>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>
Subject: Re: [PATCH v5 3/5] phy: snps-eusb2: Set phy type to EUSB2
Date: Tue, 4 Aug 2026 22:28:53 +0000	[thread overview]
Message-ID: <anJmrEe9IcV_iaac@vbox> (raw)
In-Reply-To: <49d0e412-4561-4f4f-b00b-b77dc9cf143b@oss.qualcomm.com>

On Sun, Jul 26, 2026, Krishna Kurapati wrote:
> 
> 
> On 7/25/2026 3:21 AM, Sebastian Reichel wrote:
> > Hi,
> > 
> > On Thu, Jul 23, 2026 at 04:09:06PM +0530, Krishna Kurapati wrote:
> > > USB controllers like DWC3 are agnostic of the kind of phy (USB2/eUSB2)
> > > connected to it. Set the phy type to EUSB2 to let the controller know
> > > the phy type when queried during its probe.
> > > 
> > > Signed-off-by: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>
> > > ---
> > >   drivers/phy/phy-snps-eusb2.c | 4 ++++
> > >   1 file changed, 4 insertions(+)
> > > 
> > > diff --git a/drivers/phy/phy-snps-eusb2.c b/drivers/phy/phy-snps-eusb2.c
> > > index f90bf7e95463..e139b17bcda5 100644
> > > --- a/drivers/phy/phy-snps-eusb2.c
> > > +++ b/drivers/phy/phy-snps-eusb2.c
> > > @@ -13,6 +13,8 @@
> > >   #include <linux/regulator/consumer.h>
> > >   #include <linux/reset.h>
> > > +#include <dt-bindings/phy/phy.h>
> > > +
> > >   #define EXYNOS_USB_PHY_HS_PHY_CTRL_RST	(0x0)
> > >   #define USB_PHY_RST_MASK		GENMASK(1, 0)
> > >   #define UTMI_PORT_RST_MASK		GENMASK(5, 4)
> > > @@ -597,6 +599,8 @@ static int snps_eusb2_hsphy_probe(struct platform_device *pdev)
> > >   		return PTR_ERR(generic_phy);
> > >   	}
> > > +	phy_set_type(generic_phy, PHY_TYPE_EUSB2);
> > 
> > Isn't there a potential race condition if it's handled in this way?
> > 
> > 1. phy-snps-eusb2 probe: PHY is registered
> > 2. dwc3 probes
> > 3. phy-snps-eusb2 probe: PHY type is set
> > 
> 
> How about we do this get_type call after dwc3_probe call during
> dwc3_qcom_probe. That way we can ensure phy is up for sure since core init
> has to happen as part of dwc3_probe.
> 

There should be no race here. The phy_set_type() is called before the
phy is registered. dwc3-qcom would get -EPROBE_DEFER if it probes before
the phy is registered.

BR,
Thinh

  reply	other threads:[~2026-08-04 22:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20260723-eusb2-int-handling-v5-v5-0-f32ea6c1a318@oss.qualcomm.com>
     [not found] ` <20260723-eusb2-int-handling-v5-v5-3-f32ea6c1a318@oss.qualcomm.com>
2026-07-24 21:51   ` [PATCH v5 3/5] phy: snps-eusb2: Set phy type to EUSB2 Sebastian Reichel
2026-07-26 17:08     ` Krishna Kurapati
2026-08-04 22:28       ` Thinh Nguyen [this message]
2026-08-05  0:43         ` Sebastian Reichel
     [not found] ` <20260723-eusb2-int-handling-v5-v5-2-f32ea6c1a318@oss.qualcomm.com>
2026-07-26 20:36   ` [PATCH v5 2/5] include: linux: phy: Add phy attribute "type" and associated helpers Dmitry Baryshkov
2026-08-04 22:22     ` Thinh Nguyen
     [not found] ` <20260723-eusb2-int-handling-v5-v5-1-f32ea6c1a318@oss.qualcomm.com>
2026-07-26 20:36   ` [PATCH v5 1/5] dt-bindings: phy: Add PHY_TYPE_EUSB2 definition Dmitry Baryshkov
2026-07-27  7:11   ` Krzysztof Kozlowski
     [not found] ` <20260723-eusb2-int-handling-v5-v5-4-f32ea6c1a318@oss.qualcomm.com>
2026-08-04 21:46   ` [PATCH v5 4/5] phy: qcom: m31-eusb2: Set phy type to EUSB2 Thinh Nguyen
     [not found] ` <20260723-eusb2-int-handling-v5-v5-5-f32ea6c1a318@oss.qualcomm.com>
2026-08-04 22:01   ` [PATCH v5 5/5] usb: dwc3: qcom: Modify interrupt handling for eUSB2 Phy targets Thinh Nguyen

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=anJmrEe9IcV_iaac@vbox \
    --to=thinh.nguyen@synopsys.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=krishna.kurapati@oss.qualcomm.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=robh@kernel.org \
    --cc=sebastian.reichel@collabora.com \
    --cc=vkoul@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