All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vinod Koul <vkoul@kernel.org>
To: Sebastian Reichel <sebastian.reichel@collabora.com>
Cc: Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Heiko Stuebner <heiko@sntech.de>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Manivannan Sadhasivam <mani@kernel.org>,
	Igor Paunovic <royalnet026@gmail.com>,
	linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-rockchip@lists.infradead.org,
	linux-phy@lists.infradead.org, kernel@collabora.com
Subject: Re: [PATCH v16 1/6] phy: core: add notifier infrastructure
Date: Mon, 5 Oct 2026 10:30:24 +0200	[thread overview]
Message-ID: <asNgINDic6A3Gvtq@parshuram> (raw)
In-Reply-To: <asJGziv0N3qtXo6_@venus>

On 04-10-26, 14:44, Sebastian Reichel wrote:
> Hello Vinod,
> 
> On Sat, Oct 03, 2026 at 11:04:13AM +0200, Vinod Koul wrote:
> > On 24-09-26, 19:25, Sebastian Reichel wrote:
> > > Some PHY devices with multiple ports (e.g. USB3 and DP) require a reset
> > > if the configuration changes or cable orientation changes. This is a
> > > problem, as the consumer device will run into undefined behavior.
> > > 
> > > With the new PHY notifier API introduced in this patch, the consumer
> > > driver can hook into reset events coming from a PHY device to handle the
> > > PHY going down gracefully.
> > > 
> > > Note that this uses -ENOSYS instead of the more sensible -ENOTSUP for
> > > the stub functions when GENERIC_PHY is disabled to stay consistent with
> > > the existing ones.
> > 
> > I dont think this series has the usage of this.
> > 
> > I think I am still not convinced why a phy should notify as I dont feel
> > we have any mechanism to notifying. Checking status and letting people
> > know if not really a notification mechanism... Maybe add a status call
> > instead?
> 
> This series contains the infrastructure and the consumer of the PHY
> reset notification (dwc3 rockchip glue driver). The producer/sender
> of the PHY reset notification is the first patch in the USBDP part 3
> series. I grouped the patches like this, so that this series has PHY
> patches followed by USB patches instead of PHY - USB - PHY. Patches
> must be applied in the exact order (i.e. first the patches added the
> PHY reset notifier infrastructure, then the DWC3 notification
> consumer and then the USBDP notification producer).
> 
> The broader picture solved by this is (pre-existing race condition
> issue in USBDP):

Thanks, this is helpful to understand the context. Few questions on
below to help me understand more...

> 
> 1. USBDP PHY provides critical resources to DWC3 USB controller

what resources are these?

> 2. USBDP PHY needs to reset to reconfigure (e.g. enable/disable DP side),
>    which means the resource is temporarily not available

Who invokes reset, I guess the controller (dwc3), so it ought to be
aware of the reset condition.

> 3. DWC3 accesses its registers during the reset -> SError, because PHY is off

I would assume that dwc3 should know about it as invoking entity..

> 
> This series combined with the first patch of USBDP part 3 changes
> things, so that it works like this:
> 
> 1. USBDP PHY provides critical resources to DWC3 USB controller
> 2. USBDP PHY needs to reset to reconfigure (e.g. enable/disable DP side),
>    which means the resource is temporarily not available
> 3. USBDP PHY driver sends pre-reset notification
> 4. DWC3 goes into a safe mode after receiving the pre-reset notifiaction
> 5. USBDP PHY does the reset
> 6. USBDP PHY reset finishes, USBDP PHY driver sends post-reset nofication
> 7. DWC3 returns to normal mode after receiving the post-reset notification

> 
> This avoids running into the SError.
> 
> Greetings,
> 
> -- Sebastian



-- 
~Vinod

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

WARNING: multiple messages have this Message-ID (diff)
From: Vinod Koul <vkoul@kernel.org>
To: Sebastian Reichel <sebastian.reichel@collabora.com>
Cc: Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Heiko Stuebner <heiko@sntech.de>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Manivannan Sadhasivam <mani@kernel.org>,
	Igor Paunovic <royalnet026@gmail.com>,
	linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-rockchip@lists.infradead.org,
	linux-phy@lists.infradead.org, kernel@collabora.com
Subject: Re: [PATCH v16 1/6] phy: core: add notifier infrastructure
Date: Mon, 5 Oct 2026 10:30:24 +0200	[thread overview]
Message-ID: <asNgINDic6A3Gvtq@parshuram> (raw)
In-Reply-To: <asJGziv0N3qtXo6_@venus>

On 04-10-26, 14:44, Sebastian Reichel wrote:
> Hello Vinod,
> 
> On Sat, Oct 03, 2026 at 11:04:13AM +0200, Vinod Koul wrote:
> > On 24-09-26, 19:25, Sebastian Reichel wrote:
> > > Some PHY devices with multiple ports (e.g. USB3 and DP) require a reset
> > > if the configuration changes or cable orientation changes. This is a
> > > problem, as the consumer device will run into undefined behavior.
> > > 
> > > With the new PHY notifier API introduced in this patch, the consumer
> > > driver can hook into reset events coming from a PHY device to handle the
> > > PHY going down gracefully.
> > > 
> > > Note that this uses -ENOSYS instead of the more sensible -ENOTSUP for
> > > the stub functions when GENERIC_PHY is disabled to stay consistent with
> > > the existing ones.
> > 
> > I dont think this series has the usage of this.
> > 
> > I think I am still not convinced why a phy should notify as I dont feel
> > we have any mechanism to notifying. Checking status and letting people
> > know if not really a notification mechanism... Maybe add a status call
> > instead?
> 
> This series contains the infrastructure and the consumer of the PHY
> reset notification (dwc3 rockchip glue driver). The producer/sender
> of the PHY reset notification is the first patch in the USBDP part 3
> series. I grouped the patches like this, so that this series has PHY
> patches followed by USB patches instead of PHY - USB - PHY. Patches
> must be applied in the exact order (i.e. first the patches added the
> PHY reset notifier infrastructure, then the DWC3 notification
> consumer and then the USBDP notification producer).
> 
> The broader picture solved by this is (pre-existing race condition
> issue in USBDP):

Thanks, this is helpful to understand the context. Few questions on
below to help me understand more...

> 
> 1. USBDP PHY provides critical resources to DWC3 USB controller

what resources are these?

> 2. USBDP PHY needs to reset to reconfigure (e.g. enable/disable DP side),
>    which means the resource is temporarily not available

Who invokes reset, I guess the controller (dwc3), so it ought to be
aware of the reset condition.

> 3. DWC3 accesses its registers during the reset -> SError, because PHY is off

I would assume that dwc3 should know about it as invoking entity..

> 
> This series combined with the first patch of USBDP part 3 changes
> things, so that it works like this:
> 
> 1. USBDP PHY provides critical resources to DWC3 USB controller
> 2. USBDP PHY needs to reset to reconfigure (e.g. enable/disable DP side),
>    which means the resource is temporarily not available
> 3. USBDP PHY driver sends pre-reset notification
> 4. DWC3 goes into a safe mode after receiving the pre-reset notifiaction
> 5. USBDP PHY does the reset
> 6. USBDP PHY reset finishes, USBDP PHY driver sends post-reset nofication
> 7. DWC3 returns to normal mode after receiving the post-reset notification

> 
> This avoids running into the SError.
> 
> Greetings,
> 
> -- Sebastian



-- 
~Vinod


WARNING: multiple messages have this Message-ID (diff)
From: Vinod Koul <vkoul@kernel.org>
To: Sebastian Reichel <sebastian.reichel@collabora.com>
Cc: Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Heiko Stuebner <heiko@sntech.de>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Manivannan Sadhasivam <mani@kernel.org>,
	Igor Paunovic <royalnet026@gmail.com>,
	linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-rockchip@lists.infradead.org,
	linux-phy@lists.infradead.org, kernel@collabora.com
Subject: Re: [PATCH v16 1/6] phy: core: add notifier infrastructure
Date: Mon, 5 Oct 2026 10:30:24 +0200	[thread overview]
Message-ID: <asNgINDic6A3Gvtq@parshuram> (raw)
In-Reply-To: <asJGziv0N3qtXo6_@venus>

On 04-10-26, 14:44, Sebastian Reichel wrote:
> Hello Vinod,
> 
> On Sat, Oct 03, 2026 at 11:04:13AM +0200, Vinod Koul wrote:
> > On 24-09-26, 19:25, Sebastian Reichel wrote:
> > > Some PHY devices with multiple ports (e.g. USB3 and DP) require a reset
> > > if the configuration changes or cable orientation changes. This is a
> > > problem, as the consumer device will run into undefined behavior.
> > > 
> > > With the new PHY notifier API introduced in this patch, the consumer
> > > driver can hook into reset events coming from a PHY device to handle the
> > > PHY going down gracefully.
> > > 
> > > Note that this uses -ENOSYS instead of the more sensible -ENOTSUP for
> > > the stub functions when GENERIC_PHY is disabled to stay consistent with
> > > the existing ones.
> > 
> > I dont think this series has the usage of this.
> > 
> > I think I am still not convinced why a phy should notify as I dont feel
> > we have any mechanism to notifying. Checking status and letting people
> > know if not really a notification mechanism... Maybe add a status call
> > instead?
> 
> This series contains the infrastructure and the consumer of the PHY
> reset notification (dwc3 rockchip glue driver). The producer/sender
> of the PHY reset notification is the first patch in the USBDP part 3
> series. I grouped the patches like this, so that this series has PHY
> patches followed by USB patches instead of PHY - USB - PHY. Patches
> must be applied in the exact order (i.e. first the patches added the
> PHY reset notifier infrastructure, then the DWC3 notification
> consumer and then the USBDP notification producer).
> 
> The broader picture solved by this is (pre-existing race condition
> issue in USBDP):

Thanks, this is helpful to understand the context. Few questions on
below to help me understand more...

> 
> 1. USBDP PHY provides critical resources to DWC3 USB controller

what resources are these?

> 2. USBDP PHY needs to reset to reconfigure (e.g. enable/disable DP side),
>    which means the resource is temporarily not available

Who invokes reset, I guess the controller (dwc3), so it ought to be
aware of the reset condition.

> 3. DWC3 accesses its registers during the reset -> SError, because PHY is off

I would assume that dwc3 should know about it as invoking entity..

> 
> This series combined with the first patch of USBDP part 3 changes
> things, so that it works like this:
> 
> 1. USBDP PHY provides critical resources to DWC3 USB controller
> 2. USBDP PHY needs to reset to reconfigure (e.g. enable/disable DP side),
>    which means the resource is temporarily not available
> 3. USBDP PHY driver sends pre-reset notification
> 4. DWC3 goes into a safe mode after receiving the pre-reset notifiaction
> 5. USBDP PHY does the reset
> 6. USBDP PHY reset finishes, USBDP PHY driver sends post-reset nofication
> 7. DWC3 returns to normal mode after receiving the post-reset notification

> 
> This avoids running into the SError.
> 
> Greetings,
> 
> -- Sebastian



-- 
~Vinod

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

  reply	other threads:[~2026-10-05  8:30 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-24 17:25 [PATCH v16 0/6] usb: dwc3: introduce Rockchip glue driver Sebastian Reichel
2026-09-24 17:25 ` Sebastian Reichel
2026-09-24 17:25 ` Sebastian Reichel
2026-09-24 17:25 ` [PATCH v16 1/6] phy: core: add notifier infrastructure Sebastian Reichel
2026-09-24 17:25   ` Sebastian Reichel
2026-09-24 17:25   ` Sebastian Reichel
2026-09-24 17:35   ` sashiko-bot
2026-09-26  7:47   ` Manivannan Sadhasivam
2026-09-26  7:47     ` Manivannan Sadhasivam
2026-09-26  7:47     ` Manivannan Sadhasivam
2026-10-03  9:04   ` Vinod Koul
2026-10-03  9:04     ` Vinod Koul
2026-10-03  9:04     ` Vinod Koul
2026-10-04 12:44     ` Sebastian Reichel
2026-10-04 12:44       ` Sebastian Reichel
2026-10-04 12:44       ` Sebastian Reichel
2026-10-05  8:30       ` Vinod Koul [this message]
2026-10-05  8:30         ` Vinod Koul
2026-10-05  8:30         ` Vinod Koul
2026-10-06  1:11         ` Sebastian Reichel
2026-10-06  1:11           ` Sebastian Reichel
2026-10-06  1:11           ` Sebastian Reichel
2026-09-24 17:25 ` [PATCH v16 2/6] usb: dwc3: rockchip: introduce glue driver Sebastian Reichel
2026-09-24 17:25   ` Sebastian Reichel
2026-09-24 17:25   ` Sebastian Reichel
2026-09-24 17:36   ` sashiko-bot
2026-09-24 17:25 ` [PATCH v16 3/6] usb: dwc3: core: add post PHY registration hook for platform glue Sebastian Reichel
2026-09-24 17:25   ` Sebastian Reichel
2026-09-24 17:25   ` Sebastian Reichel
2026-09-24 17:25 ` [PATCH v16 4/6] usb: dwc3: rockchip: support PHY reset notifications Sebastian Reichel
2026-09-24 17:25   ` Sebastian Reichel
2026-09-24 17:25   ` Sebastian Reichel
2026-09-24 17:38   ` sashiko-bot
2026-09-26  7:51   ` Manivannan Sadhasivam
2026-09-26  7:51     ` Manivannan Sadhasivam
2026-09-26  7:51     ` Manivannan Sadhasivam
2026-10-02 23:39   ` Thinh Nguyen
2026-10-02 23:39     ` Thinh Nguyen
2026-10-02 23:39     ` Thinh Nguyen
2026-09-24 17:25 ` [PATCH v16 5/6] usb: gadget: define stub for usb_udc_vbus_handler Sebastian Reichel
2026-09-24 17:25   ` Sebastian Reichel
2026-09-24 17:25   ` Sebastian Reichel
2026-09-24 17:25 ` [PATCH v16 6/6] usb: dwc3: rockchip: fix USB-C reconnect in gadget mode Sebastian Reichel
2026-09-24 17:25   ` Sebastian Reichel
2026-09-24 17:25   ` Sebastian Reichel
2026-09-24 17:40   ` sashiko-bot
2026-09-27 12:02   ` Igor Paunovic
2026-09-27 12:02     ` Igor Paunovic
2026-09-27 12:02     ` Igor Paunovic
2026-10-02 22:57   ` Thinh Nguyen
2026-10-02 22:57     ` Thinh Nguyen
2026-10-02 22:57     ` Thinh Nguyen
2026-09-27 12:02 ` [PATCH v16 0/6] usb: dwc3: introduce Rockchip glue driver Igor Paunovic
2026-09-27 12:02   ` Igor Paunovic
2026-09-27 12:02   ` Igor Paunovic

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=asNgINDic6A3Gvtq@parshuram \
    --to=vkoul@kernel.org \
    --cc=Thinh.Nguyen@synopsys.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=heiko@sntech.de \
    --cc=kernel@collabora.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mani@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=royalnet026@gmail.com \
    --cc=sebastian.reichel@collabora.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.