Skip to contentSkip to conversation

Revert "usb: phy: add usb phy notify port status API"

PATCH In review Johan Hovold 5 participants 12 messages Nov 6, 2023 – Nov 7, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover Revert "usb: phy: add usb phy notify port status API"

The recently added Realtek PHY drivers depend on the new port status notification mechanism which was built on the deprecated USB PHY implementation and devicetree binding.

Specifically, using these PHYs would require describing the very same PHY using both the generic "phy" property and the deprecated "usb-phy" property which is clearly wrong.

We should not be building new functionality on top of the legacy USB PHY implementation even if it is currently stuck in some kind of transitional limbo.

Revert the new Realtek PHY drivers for now so that the port status notification interface can be reverted and replaced before we dig ourselves into an even deeper hole with this PHY mess.

Note that there are no upstream users of these PHYs and the drivers were only included in 6.6 so there should still be time to undo this.

Preferably these should go in through Greg's tree for 6.7-rc1.

Johan

Johan Hovold (3):
Revert "phy: realtek: usb: Add driver for the Realtek SoC USB 3.0 PHY" Revert "phy: realtek: usb: Add driver for the Realtek SoC USB 2.0 PHY" Revert "usb: phy: add usb phy notify port status API"

 drivers/phy/Kconfig                |    1 -
 drivers/phy/Makefile               |    1 -
 drivers/phy/realtek/Kconfig        |   32 -
 drivers/phy/realtek/Makefile       |    3 -
 drivers/phy/realtek/phy-rtk-usb2.c | 1325 ----------------------------
 drivers/phy/realtek/phy-rtk-usb3.c |  761 ----------------
 drivers/usb/core/hub.c             |   23 -
 include/linux/usb/phy.h            |   13 -
 8 files changed, 2159 deletions(-)
 delete mode 100644 drivers/phy/realtek/Kconfig
 delete mode 100644 drivers/phy/realtek/Makefile
 delete mode 100644 drivers/phy/realtek/phy-rtk-usb2.c
 delete mode 100644 drivers/phy/realtek/phy-rtk-usb3.c
Signature · 1 line
2.41.0
#1 lore raw

PATCH 1/3 Revert "phy: realtek: usb: Add driver for the Realtek SoC USB 3.0 PHY"

This reverts commit adda6e82a7de7d6d478f6c8ef127f0ac51c510a1.

The recently added Realtek PHY drivers depend on the new port status notification mechanism which was built on the deprecated USB PHY implementation and devicetree binding.

Specifically, using these PHYs would require describing the very same PHY using both the generic "phy" property and the deprecated "usb-phy" property which is clearly wrong.

We should not be building new functionality on top of the legacy USB PHY implementation even if it is currently stuck in some kind of transitional limbo.

Revert the new Realtek PHY drivers for now so that the port status notification interface can be reverted and replaced.

Fixes adda6e82a7de ("phy: realtek: usb: Add driver for the Realtek SoC USB 3.0 PHY")
Cc Stanley Chang <[email protected]>
---
 drivers/phy/realtek/Kconfig        |  12 -
 drivers/phy/realtek/Makefile       |   1 -
 drivers/phy/realtek/phy-rtk-usb3.c | 761 -----------------------------
 3 files changed, 774 deletions(-)
 delete mode 100644 drivers/phy/realtek/phy-rtk-usb3.c
drivers/phy/realtek/Kconfig +0 -12
index 75ac7e7c31ae..745587751070 100644
@@ -17,16 +17,4 @@ config PHY_RTK_RTD_USB2PHY
 	  DWC3 USB IP. This driver will do the PHY initialization
 	  of the parameters.
 
-config PHY_RTK_RTD_USB3PHY
-	tristate "Realtek RTD USB3 PHY Transceiver Driver"
-	depends on USB_SUPPORT
-	select GENERIC_PHY
-	select USB_PHY
-	select USB_COMMON
-	help
-	  Enable this to support Realtek SoC USB3 phy transceiver.
-	  The DHC (digital home center) RTD series SoCs used the Synopsys
-	  DWC3 USB IP. This driver will do the PHY initialization
-	  of the parameters.
-
 endif # ARCH_REALTEK || COMPILE_TEST
drivers/phy/realtek/Makefile +0 -1
index ed7b47ff8a26..cf5d440841a2 100644
@@ -1,3 +1,2 @@
 # SPDX-License-Identifier: GPL-2.0
 obj-$(CONFIG_PHY_RTK_RTD_USB2PHY)	+= phy-rtk-usb2.o
-obj-$(CONFIG_PHY_RTK_RTD_USB3PHY)	+= phy-rtk-usb3.o
drivers/phy/realtek/phy-rtk-usb3.c deleted +0 -761

761 lines not on this page · raw message

Signature · 1 line
2.41.0
#2 lore raw

PATCH 2/3 Revert "phy: realtek: usb: Add driver for the Realtek SoC USB 2.0 PHY"

In reply to Johan Hovold

This reverts commit 134e6d25f6bd06071e5aac0a7eefcea6f7713955.

The recently added Realtek PHY drivers depend on the new port status notification mechanism which was built on the deprecated USB PHY implementation and devicetree binding.

Specifically, using these PHYs would require describing the very same PHY using both the generic "phy" property and the deprecated "usb-phy" property which is clearly wrong.

We should not be building new functionality on top of the legacy USB PHY implementation even if it is currently stuck in some kind of transitional limbo.

Revert the new Realtek PHY drivers for now so that the port status notification interface can be reverted and replaced.

Fixes 134e6d25f6bd ("phy: realtek: usb: Add driver for the Realtek SoC USB 2.0 PHY")
Cc Stanley Chang <[email protected]>
---
 drivers/phy/Kconfig                |    1 -
 drivers/phy/Makefile               |    1 -
 drivers/phy/realtek/Kconfig        |   20 -
 drivers/phy/realtek/Makefile       |    2 -
 drivers/phy/realtek/phy-rtk-usb2.c | 1325 ----------------------------
 5 files changed, 1349 deletions(-)
 delete mode 100644 drivers/phy/realtek/Kconfig
 delete mode 100644 drivers/phy/realtek/Makefile
 delete mode 100644 drivers/phy/realtek/phy-rtk-usb2.c
drivers/phy/Kconfig +0 -1
index d1670bbe6d6b..e4502958fd62 100644
@@ -87,7 +87,6 @@ source "drivers/phy/motorola/Kconfig"
 source "drivers/phy/mscc/Kconfig"
 source "drivers/phy/qualcomm/Kconfig"
 source "drivers/phy/ralink/Kconfig"
-source "drivers/phy/realtek/Kconfig"
 source "drivers/phy/renesas/Kconfig"
 source "drivers/phy/rockchip/Kconfig"
 source "drivers/phy/samsung/Kconfig"
drivers/phy/Makefile +0 -1
index 868a220ed0f6..fb3dc9de6111 100644
@@ -26,7 +26,6 @@ obj-y					+= allwinner/	\
 					   mscc/	\
 					   qualcomm/	\
 					   ralink/	\
-					   realtek/	\
 					   renesas/	\
 					   rockchip/	\
 					   samsung/	\
drivers/phy/realtek/Kconfig deleted +0 -20
deleted file mode 100644
index 745587751070..000000000000
@@ -1,20 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-#
-# Phy drivers for Realtek platforms
-#
-
-if ARCH_REALTEK || COMPILE_TEST
-
-config PHY_RTK_RTD_USB2PHY
-	tristate "Realtek RTD USB2 PHY Transceiver Driver"
-	depends on USB_SUPPORT
-	select GENERIC_PHY
-	select USB_PHY
-	select USB_COMMON
-	help
-	  Enable this to support Realtek SoC USB2 phy transceiver.
-	  The DHC (digital home center) RTD series SoCs used the Synopsys
-	  DWC3 USB IP. This driver will do the PHY initialization
-	  of the parameters.
-
-endif # ARCH_REALTEK || COMPILE_TEST
drivers/phy/realtek/Makefile deleted +0 -2
deleted file mode 100644
index cf5d440841a2..000000000000
@@ -1,2 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-obj-$(CONFIG_PHY_RTK_RTD_USB2PHY)	+= phy-rtk-usb2.o
drivers/phy/realtek/phy-rtk-usb2.c deleted +0 -1325

1,325 lines not on this page · raw message

Signature · 1 line
2.41.0
#3 lore raw

PATCH 3/3 Revert "usb: phy: add usb phy notify port status API"

In reply to Johan Hovold

This reverts commit a08799cf17c22375752abfad3b4a2b34b3acb287.

The recently added Realtek PHY drivers depend on the new port status notification mechanism which was built on the deprecated USB PHY implementation and devicetree binding.

Specifically, using these PHYs would require describing the very same PHY using both the generic "phy" property and the deprecated "usb-phy" property which is clearly wrong.

We should not be building new functionality on top of the legacy USB PHY implementation even if it is currently stuck in some kind of transitional limbo.

Revert the new notification interface which is broken by design.

Fixes a08799cf17c2 ("usb: phy: add usb phy notify port status API")
Cc Stanley Chang <[email protected]>
---
 drivers/usb/core/hub.c  | 23 -----------------------
 include/linux/usb/phy.h | 13 -------------
 2 files changed, 36 deletions(-)
drivers/usb/core/hub.c +0 -23
index 0ff47eeffb49..dfc30cebd4c4 100644
@@ -622,29 +622,6 @@ static int hub_ext_port_status(struct usb_hub *hub, int port1, int type,
 		ret = 0;
 	}
 	mutex_unlock(&hub->status_mutex);
-
-	/*
-	 * There is no need to lock status_mutex here, because status_mutex
-	 * protects hub->status, and the phy driver only checks the port
-	 * status without changing the status.
-	 */
-	if (!ret) {
-		struct usb_device *hdev = hub->hdev;
-
-		/*
-		 * Only roothub will be notified of port state changes,
-		 * since the USB PHY only cares about changes at the next
-		 * level.
-		 */
-		if (is_root_hub(hdev)) {
-			struct usb_hcd *hcd = bus_to_hcd(hdev->bus);
-
-			if (hcd->usb_phy)
-				usb_phy_notify_port_status(hcd->usb_phy,
-							   port1 - 1, *status, *change);
-		}
-	}
-
 	return ret;
 }
 
include/linux/usb/phy.h +0 -13
index b513749582d7..e4de6bc1f69b 100644
@@ -144,10 +144,6 @@ struct usb_phy {
 	 */
 	int	(*set_wakeup)(struct usb_phy *x, bool enabled);
 
-	/* notify phy port status change */
-	int	(*notify_port_status)(struct usb_phy *x, int port,
-				      u16 portstatus, u16 portchange);
-
 	/* notify phy connect status change */
 	int	(*notify_connect)(struct usb_phy *x,
 			enum usb_device_speed speed);
@@ -320,15 +316,6 @@ usb_phy_set_wakeup(struct usb_phy *x, bool enabled)
 		return 0;
 }
 
-static inline int
-usb_phy_notify_port_status(struct usb_phy *x, int port, u16 portstatus, u16 portchange)
-{
-	if (x && x->notify_port_status)
-		return x->notify_port_status(x, port, portstatus, portchange);
-	else
-		return 0;
-}
-
 static inline int
 usb_phy_notify_connect(struct usb_phy *x, enum usb_device_speed speed)
 {
Signature · 1 line
2.41.0
#4 lore raw
In reply to Johan Hovold
Quoted 12 lines · Johan Hovold

The recently added Realtek PHY drivers depend on the new port status notification mechanism which was built on the deprecated USB PHY implementation and devicetree binding.

Specifically, using these PHYs would require describing the very same PHY using both the generic "phy" property and the deprecated "usb-phy" property which is clearly wrong.

We should not be building new functionality on top of the legacy USB PHY implementation even if it is currently stuck in some kind of transitional limbo.

Quoted 6 lines

Revert the new Realtek PHY drivers for now so that the port status notification interface can be reverted and replaced before we dig ourselves into an even deeper hole with this PHY mess.

Note that there are no upstream users of these PHYs and the drivers were only included in 6.6 so there should still be time to undo this.

No users of these phy drivers yet? Why were they added?

Quoted 1 line

Preferably these should go in through Greg's tree for 6.7-rc1.

I'll be glad to take this if I can get an ack for it.

thanks,

greg k-h

#5 lore raw
Quoted 13 lines · Greg Kroah-Hartman
Quoted 12 lines · Johan Hovold

The recently added Realtek PHY drivers depend on the new port status notification mechanism which was built on the deprecated USB PHY implementation and devicetree binding.

Specifically, using these PHYs would require describing the very same PHY using both the generic "phy" property and the deprecated "usb-phy" property which is clearly wrong.

We should not be building new functionality on top of the legacy USB PHY implementation even if it is currently stuck in some kind of transitional limbo.

Quoted 8 lines
Quoted 6 lines

Revert the new Realtek PHY drivers for now so that the port status notification interface can be reverted and replaced before we dig ourselves into an even deeper hole with this PHY mess.

Note that there are no upstream users of these PHYs and the drivers were only included in 6.6 so there should still be time to undo this.

No users of these phy drivers yet? Why were they added?

The devicetree bindings were also merged in 6.6 (and are left in place), but there are no devicetrees that actually use these new bindings in mainline yet.

Quoted 3 lines
Quoted 1 line

Preferably these should go in through Greg's tree for 6.7-rc1.

I'll be glad to take this if I can get an ack for it.

They went in through your tree, but note that you may now get a conflict with

7e909370a5cd ("phy: realtek: Replace of_device.h with explicit includes")

in the phy tree.

Johan

#6 lore raw
Quoted 29 lines · Johan Hovold
Quoted 13 lines · Greg Kroah-Hartman
Quoted 12 lines · Johan Hovold

The recently added Realtek PHY drivers depend on the new port status notification mechanism which was built on the deprecated USB PHY implementation and devicetree binding.

Specifically, using these PHYs would require describing the very same PHY using both the generic "phy" property and the deprecated "usb-phy" property which is clearly wrong.

We should not be building new functionality on top of the legacy USB PHY implementation even if it is currently stuck in some kind of transitional limbo.

Quoted 8 lines
Quoted 6 lines

Revert the new Realtek PHY drivers for now so that the port status notification interface can be reverted and replaced before we dig ourselves into an even deeper hole with this PHY mess.

Note that there are no upstream users of these PHYs and the drivers were only included in 6.6 so there should still be time to undo this.

No users of these phy drivers yet? Why were they added?

The devicetree bindings were also merged in 6.6 (and are left in place), but there are no devicetrees that actually use these new bindings in mainline yet.

Quoted 2 lines
Quoted 1 line

Preferably these should go in through Greg's tree for 6.7-rc1.

Quoted 8 lines
Quoted 1 line

I'll be glad to take this if I can get an ack for it.

They went in through your tree, but note that you may now get a conflict with

7e909370a5cd ("phy: realtek: Replace of_device.h with explicit includes")

in the phy tree.

I fixed it up by hand, should be good now, thanks.

greg k-h

maintainer Acked-by
#7 lore raw
In reply to Greg Kroah-Hartman
Quoted 13 lines · Greg Kroah-Hartman
Quoted 12 lines · Johan Hovold

The recently added Realtek PHY drivers depend on the new port status notification mechanism which was built on the deprecated USB PHY implementation and devicetree binding.

Specifically, using these PHYs would require describing the very same PHY using both the generic "phy" property and the deprecated "usb-phy" property which is clearly wrong.

We should not be building new functionality on top of the legacy USB PHY implementation even if it is currently stuck in some kind of transitional limbo.

Quoted 8 lines
Quoted 6 lines

Revert the new Realtek PHY drivers for now so that the port status notification interface can be reverted and replaced before we dig ourselves into an even deeper hole with this PHY mess.

Note that there are no upstream users of these PHYs and the drivers were only included in 6.6 so there should still be time to undo this.

No users of these phy drivers yet? Why were they added?

Not sure why, they didnt go thru phy ss!

Quoted 4 lines
Quoted 2 lines

Preferably these should go in through Greg's tree for 6.7-rc1.

I'll be glad to take this if I can get an ack for it.

Pls do drop this:

Signature · 1 line
~Vinod
#8 lore raw

Hi Johan and Vinod,

I modified the Realtek phy to solve this issue and only use the generic PHY. And submitted these patches today as follows
https://lore.kernel.org/linux-usb/[email protected]/
https://lore.kernel.org/linux-usb/[email protected]/
https://lore.kernel.org/linux-usb/[email protected]/
https://lore.kernel.org/linux-usb/[email protected]/

I don't think this patch is needed to revert a08799cf17c2 ("usb:phy: New usb phy notification port status API").

Thanks,
Stanley

Quoted 37 lines · Greg Kroah-Hartman
Quoted 7 lines · Johan Hovold
Quoted 6 lines

The recently added Realtek PHY drivers depend on the new port status notification mechanism which was built on the deprecated USB PHY implementation and devicetree binding.

Specifically, using these PHYs would require describing the very same PHY using both the generic "phy" property and the deprecated

"usb-phy"

Quoted 6 lines
Quoted 6 lines

property which is clearly wrong.

We should not be building new functionality on top of the legacy USB PHY implementation even if it is currently stuck in some kind of transitional limbo.

Quoted 8 lines
Quoted 6 lines

Revert the new Realtek PHY drivers for now so that the port status notification interface can be reverted and replaced before we dig ourselves into an even deeper hole with this PHY mess.

Note that there are no upstream users of these PHYs and the drivers were only included in 6.6 so there should still be time to undo this.

No users of these phy drivers yet? Why were they added?

Not sure why, they didnt go thru phy ss!

Quoted 4 lines
Quoted 2 lines

Preferably these should go in through Greg's tree for 6.7-rc1.

I'll be glad to take this if I can get an ack for it.

Pls do drop this:

--
~Vinod

#9 lore raw
Quoted 10 lines · Stanley Chang[昌育德]

Hi Johan and Vinod,

I modified the Realtek phy to solve this issue and only use the generic PHY. And submitted these patches today as follows
https://lore.kernel.org/linux-usb/[email protected]/
https://lore.kernel.org/linux-usb/[email protected]/
https://lore.kernel.org/linux-usb/[email protected]/
https://lore.kernel.org/linux-usb/[email protected]/

I don't think this patch is needed to revert a08799cf17c2 ("usb:phy: New usb phy notification port status API").

I had already applied those reverts yesterday, but forgot to push them out (sorry about that, now fixed.) Let's start over here and you can rebase your new series on the 6.7-rc1.

thanks,

greg k-h

#10 lore raw

Hi Greg,

Quoted 14 lines · Stanley Chang[昌育德]
Quoted 13 lines

Hi Johan and Vinod,

I modified the Realtek phy to solve this issue and only use the generic PHY. And submitted these patches today as follows
https://lore.kernel.org/linux-usb/20231107063518.27824-1-stanley_chang
@realtek.com/
https://lore.kernel.org/linux-usb/20231107063518.27824-2-stanley_chang
@realtek.com/
https://lore.kernel.org/linux-usb/20231107063518.27824-3-stanley_chang
@realtek.com/
https://lore.kernel.org/linux-usb/20231107063518.27824-4-stanley_chang
@realtek.com/

Quoted 6 lines
Quoted 1 line

I don't think this patch is needed to revert a08799cf17c2 ("usb:phy: New usb

phy notification port status API").

I had already applied those reverts yesterday, but forgot to push them out (sorry about that, now fixed.) Let's start over here and you can rebase your new series on the 6.7-rc1.

Okay, I will resubmit later.

Thanks,
Stanley

Quoted 3 lines

thanks,

greg k-h

#11 lore raw
In reply to Vinod Koul
Quoted 26 lines · Vinod Koul
Quoted 13 lines · Greg Kroah-Hartman
Quoted 12 lines · Johan Hovold

The recently added Realtek PHY drivers depend on the new port status notification mechanism which was built on the deprecated USB PHY implementation and devicetree binding.

Specifically, using these PHYs would require describing the very same PHY using both the generic "phy" property and the deprecated "usb-phy" property which is clearly wrong.

We should not be building new functionality on top of the legacy USB PHY implementation even if it is currently stuck in some kind of transitional limbo.

Quoted 8 lines
Quoted 6 lines

Revert the new Realtek PHY drivers for now so that the port status notification interface can be reverted and replaced before we dig ourselves into an even deeper hole with this PHY mess.

Note that there are no upstream users of these PHYs and the drivers were only included in 6.6 so there should still be time to undo this.

No users of these phy drivers yet? Why were they added?

Not sure why, they didnt go thru phy ss!

Quoted 1 line
Quoted 7 lines
Quoted 3 lines
Quoted 1 line

Preferably these should go in through Greg's tree for 6.7-rc1.

I'll be glad to take this if I can get an ack for it.

Pls do drop this:

Thanks, now applied.

greg k-h