All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v19 0/6] usb: dwc3: introduce Rockchip glue driver
@ 2026-11-14  1:01 ` Sebastian Reichel
  0 siblings, 0 replies; 27+ messages in thread
From: Sebastian Reichel @ 2026-11-14  1:01 UTC (permalink / raw)
  To: Thinh Nguyen, Greg Kroah-Hartman, Heiko Stuebner, Vinod Koul,
	Neil Armstrong, Manivannan Sadhasivam
  Cc: Manivannan Sadhasivam, Krishna Kurapati, Chaoyi Chen,
	Igor Paunovic, Alexey Charkov, linux-kernel, linux-usb,
	linux-arm-kernel, linux-rockchip, linux-phy, kernel,
	Sebastian Reichel

The recent Rockchip platforms have a combined PHY, which does USB3 and
DisplayPort as well as muxing the lines in arbitrary order. Changing its
enabled functionality requires a PHY reset and as the PHY provides a
clock to the DWC3 controller, this can result in an SError. Apart from
that the PHY might not start up correctly when the DWC3 PIPE interface
is running. This series prepares a Rockchip specific DWC3 glue driver to
help out with these problems. To become useful more patches are needed
on the Rockchip USBDP PHY side, which are sent separately.

This was split from the USBDP cleanup series. There are some additional
Rockchip USBDP phy fixes, which depend on this series (which is also a
fix itself).

Possible merge strategies:
1: Vinod merges everything; the USB side is mostly a new driver
   and thus there is not much conflict potential
   => acceptable for Vinod, needs Ack from Greg [0]

2: Vinod provides an immutable branch with the first two patches,
   USB tree merges the immutable branch and the remaining series.
   => acceptable for Vinod [0]

3: Everything is merged through USB; this would block the final
   cleanup for USBDP from being applied for yet another cycle.

4: Vinod merges patches 1+2, USB patches are merged one cycle
   later and final USBDP patches are merged two cycles later.

[0] https://lore.kernel.org/linux-phy/avXB6ga-QVfks8RF@parshuram/

Changes in v19:
- Link to v18: https://patch.msgid.link/20261021-b4-rockchip-dwc3-rockchip-glue-v18-0-60000d03fca2@collabora.com
- Collected Reviewed-by from Manivannan Sadhasivam on patch 1 & 2
- Collected Tested-by from Chaoyi Chen on patches 1 - 4
- Use EXPORT_SYMBOL_GPL instead of EXPORT_SYMBOL
- Drop the gadget mode patches for now; they can be handled
  independently once the DWC3 Rockchip glue driver has landed. It's a
  bad idea to let that delay this series further as it fixes SErrors
  and/or stuck USBDP PHY.
- Add new patch ensuring that GUSB3PIPECTL is updated under lock in
  the core (Sashiko)
- Completely rework the reset quirk patch in the dwc3 rockchip glue
  driver; it now blocks PM transitions until reset is done. The
  mechanism is also used to track suspend state as a simple boolean
  (Sashiko)
- No change for Sashiko's concern about GCTL.CoreSoftReset in
  __dwc3_set_mode() racing with the USBDP PHY reset: CoreSoftReset does
  not touch GUSB3PIPECTL (verified on Sige5 across a DRD role switch),
  so it cannot release the PHYSOFTRST held by the quirk.

Changes in v18:
- Link to v17: https://patch.msgid.link/20261016-b4-rockchip-dwc3-rockchip-glue-v17-0-876f96893e2f@collabora.com
- Always clear UDPHY_MODE_USB in rk_udphy_usb3_phy_exit (Sashiko)
- Add reset quirk stub functions for CONFIG_PHY_ROCKCHIP_USBDP=n (Sashiko)
- Add NULL check in phy for loop, possibly needed on older Rockchip platforms (Sashiko)
- Hold DWC3 lock in dwc3_rockchip_vbus_handler (Sashiko)
- Drop 'struct dwc3_rk_phy_nb' left over from prev. versions (Sashiko)
- Rework the runtime PM code to rely on PHY side serializing it for us,
  which simplifies things (Sashiko, myself)
- Skip reset in high-speed only mode, as the USB3 PHY is unused and
  it does not matter that it wouldn't work. (myself)
- Due to the rework, make the reset callback return void (myself)
- Replace useless cleanup from unregister function with WARN_ON; unregister is
  only called after phy_exit and afterwards reset function can no longer
  be called (myself)
- Use modern guard helpers for the spin locks (myself)

Changes in v17:
- Link to v16: https://patch.msgid.link/20260924-b4-rockchip-dwc3-rockchip-glue-v16-0-126a2e9133c3@collabora.com
- Add new patch adding just sw_mode, which was part of the "phy:
  rockchip: usbdp: Fix power state handling" patch in USBDP cleanup
  part 3 series; sw_mode will be used by the dwc3/usbdp reset quirk now
- drop generic PHY reset notifier API; I discussed this series at Linux
  Plumbers Conference with Vinod Koul and he prefers a local driver
  hack/quirk instead
- rework USBDP and DWC3 rockchip glue for the local driver quirk
  using direct function calls
- Ensure that the reset handler in DWC3 is only called when the PHY is
  initialized (and thus DWC3 is running)
- Also set vbus in the last patch when dwc3 is configured to device only
  mode (in contrast to dual-role mode being in device mode).

Changes in v16:
- Link to v15 (sorry, I missed force setting the revision for this
  part in the series split, so the series says v1 in the patch subject):
  https://patch.msgid.link/20260915-b4-rockchip-dwc3-rockchip-glue-v1-0-763bb546824e@collabora.com
- Update first patch to also build the PM functions even when
  PM is disabled
- Add new patch for defining an empty usb_udc_vbus_handler stub
  when USB_GADGET is disabled
- Add dependency to Rockchip DWC3 glue, which disallows the
  configuration with USB_DWC3_ROCKCHIP=y and USB_GADGET=m
- Collect tags

Changes in v15:
 - Link to v14: https://patch.msgid.link/20260813-rockchip-usbdp-cleanup-v14-0-b5ad9c68fa11@collabora.com
 - Avoid #ifdef for CONFIG_PM in the new glue driver (Thinh Nguyen)
 - Do not add #if IS_ENABLED around the DT compatible blacklist in the
   generic driver, using the glue driver should be mandatory as the
   generic driver results in arbitrary system hangs. Thinh Nguyen suggested
   updating Kconfig for this, but did not clarify what that means.
   Current Kconfig works the same way as the other mandatory glue
   drivers.
 - Split series to simplify review

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
---
Sebastian Reichel (6):
      phy: rockchip: usbdp: Track PHY power state
      phy: rockchip: usbdp: Add reset hook support for dwc3
      usb: dwc3: rockchip: introduce glue driver
      usb: dwc3: core: add post PHY registration hook for platform glue
      usb: dwc3: core: only access GUSB3PIPECTL under lock
      usb: dwc3: rockchip: add USBDP PHY reset quirk

 drivers/phy/rockchip/phy-rockchip-usbdp.c |  82 +++++++++-
 drivers/usb/dwc3/Kconfig                  |  12 ++
 drivers/usb/dwc3/Makefile                 |   1 +
 drivers/usb/dwc3/core.c                   |  36 ++++-
 drivers/usb/dwc3/core.h                   |   9 ++
 drivers/usb/dwc3/dwc3-rockchip.c          | 250 ++++++++++++++++++++++++++++++
 drivers/usb/dwc3/glue.h                   |   2 +-
 drivers/usb/dwc3/trace.c                  |   3 +
 include/linux/phy/rockchip-usbdp.h        |  31 ++++
 9 files changed, 416 insertions(+), 10 deletions(-)
---
base-commit: bc71431221f5ba8bb33918399552636e059c2c45
change-id: 20260914-b4-rockchip-dwc3-rockchip-glue-979ea3735d43

Best regards,
--  
Sebastian Reichel <sebastian.reichel@collabora.com>


^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2026-11-14  1:28 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-14  1:01 [PATCH v19 0/6] usb: dwc3: introduce Rockchip glue driver Sebastian Reichel
2026-11-14  1:01 ` Sebastian Reichel
2026-11-14  1:01 ` Sebastian Reichel
2026-11-14  1:02 ` [PATCH v19 1/6] phy: rockchip: usbdp: Track PHY power state Sebastian Reichel
2026-11-14  1:02   ` Sebastian Reichel
2026-11-14  1:02   ` Sebastian Reichel
2026-11-14  1:15   ` sashiko-bot
2026-11-14  1:02 ` [PATCH v19 2/6] phy: rockchip: usbdp: Add reset hook support for dwc3 Sebastian Reichel
2026-11-14  1:02   ` Sebastian Reichel
2026-11-14  1:02   ` Sebastian Reichel
2026-11-14  1:17   ` sashiko-bot
2026-11-14  1:02 ` [PATCH v19 3/6] usb: dwc3: rockchip: introduce glue driver Sebastian Reichel
2026-11-14  1:02   ` Sebastian Reichel
2026-11-14  1:02   ` Sebastian Reichel
2026-11-14  1:08   ` sashiko-bot
2026-11-14  1:02 ` [PATCH v19 4/6] usb: dwc3: core: add post PHY registration hook for platform glue Sebastian Reichel
2026-11-14  1:02   ` Sebastian Reichel
2026-11-14  1:02   ` Sebastian Reichel
2026-11-14  1:05   ` sashiko-bot
2026-11-14  1:02 ` [PATCH v19 5/6] usb: dwc3: core: only access GUSB3PIPECTL under lock Sebastian Reichel
2026-11-14  1:02   ` Sebastian Reichel
2026-11-14  1:02   ` Sebastian Reichel
2026-11-14  1:09   ` sashiko-bot
2026-11-14  1:02 ` [PATCH v19 6/6] usb: dwc3: rockchip: add USBDP PHY reset quirk Sebastian Reichel
2026-11-14  1:02   ` Sebastian Reichel
2026-11-14  1:02   ` Sebastian Reichel
2026-11-14  1:28   ` sashiko-bot

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.