Skip to content

Commit 1a229d8

Browse files
jhovoldgregkh
authored andcommitted
Revert "usb: phy: add usb phy notify port status API"
This reverts commit a08799c. 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: a08799c ("usb: phy: add usb phy notify port status API") Cc: stable@vger.kernel.org # 6.6 Cc: Stanley Chang <stanley_chang@realtek.com> Signed-off-by: Johan Hovold <johan+linaro@kernel.org> Link: https://lore.kernel.org/r/20231106110654.31090-4-johan+linaro@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 7a784bc commit 1a229d8

2 files changed

Lines changed: 0 additions & 36 deletions

File tree

drivers/usb/core/hub.c

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -622,29 +622,6 @@ static int hub_ext_port_status(struct usb_hub *hub, int port1, int type,
622622
ret = 0;
623623
}
624624
mutex_unlock(&hub->status_mutex);
625-
626-
/*
627-
* There is no need to lock status_mutex here, because status_mutex
628-
* protects hub->status, and the phy driver only checks the port
629-
* status without changing the status.
630-
*/
631-
if (!ret) {
632-
struct usb_device *hdev = hub->hdev;
633-
634-
/*
635-
* Only roothub will be notified of port state changes,
636-
* since the USB PHY only cares about changes at the next
637-
* level.
638-
*/
639-
if (is_root_hub(hdev)) {
640-
struct usb_hcd *hcd = bus_to_hcd(hdev->bus);
641-
642-
if (hcd->usb_phy)
643-
usb_phy_notify_port_status(hcd->usb_phy,
644-
port1 - 1, *status, *change);
645-
}
646-
}
647-
648625
return ret;
649626
}
650627

include/linux/usb/phy.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,6 @@ struct usb_phy {
144144
*/
145145
int (*set_wakeup)(struct usb_phy *x, bool enabled);
146146

147-
/* notify phy port status change */
148-
int (*notify_port_status)(struct usb_phy *x, int port,
149-
u16 portstatus, u16 portchange);
150-
151147
/* notify phy connect status change */
152148
int (*notify_connect)(struct usb_phy *x,
153149
enum usb_device_speed speed);
@@ -320,15 +316,6 @@ usb_phy_set_wakeup(struct usb_phy *x, bool enabled)
320316
return 0;
321317
}
322318

323-
static inline int
324-
usb_phy_notify_port_status(struct usb_phy *x, int port, u16 portstatus, u16 portchange)
325-
{
326-
if (x && x->notify_port_status)
327-
return x->notify_port_status(x, port, portstatus, portchange);
328-
else
329-
return 0;
330-
}
331-
332319
static inline int
333320
usb_phy_notify_connect(struct usb_phy *x, enum usb_device_speed speed)
334321
{

0 commit comments

Comments
 (0)