Skip to content

Commit d2ec94f

Browse files
Xu Yanggregkh
authored andcommitted
usb: core: hcd: only check primary hcd skip_phy_initialization
Before commit 53a2d95 ("usb: core: add phy notify connect and disconnect"), phy initialization will be skipped even when shared hcd doesn't set skip_phy_initialization flag. However, the situation is changed after the commit. The hcd.c will initialize phy when add shared hcd. This behavior is unexpected for some platforms which will handle phy initialization by themselves. To avoid the issue, this will only check skip_phy_initialization flag of primary hcd since shared hcd normally follow primary hcd setting. Fixes: 53a2d95 ("usb: core: add phy notify connect and disconnect") Cc: [email protected] Signed-off-by: Xu Yang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 8293705 commit d2ec94f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/usb/core/hcd.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2794,8 +2794,14 @@ int usb_add_hcd(struct usb_hcd *hcd,
27942794
int retval;
27952795
struct usb_device *rhdev;
27962796
struct usb_hcd *shared_hcd;
2797+
int skip_phy_initialization;
27972798

2798-
if (!hcd->skip_phy_initialization) {
2799+
if (usb_hcd_is_primary_hcd(hcd))
2800+
skip_phy_initialization = hcd->skip_phy_initialization;
2801+
else
2802+
skip_phy_initialization = hcd->primary_hcd->skip_phy_initialization;
2803+
2804+
if (!skip_phy_initialization) {
27992805
if (usb_hcd_is_primary_hcd(hcd)) {
28002806
hcd->phy_roothub = usb_phy_roothub_alloc(hcd->self.sysdev);
28012807
if (IS_ERR(hcd->phy_roothub))

0 commit comments

Comments
 (0)