MLK-9617-6 usb: core: otg: do not break otg device enumeration
authorLi Jun <B47624@freescale.com>
Sat, 27 Sep 2014 14:23:39 +0000 (22:23 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 19:47:12 +0000 (14:47 -0500)
If a HNP capable device STALL b_hnp_enable set feature request, A device
as host should not break otg device enumeration, because this set feature
failure only indicates the B device does not want to be host role for the
moment, A device as host talk to it should be okay.

see charpter 6.2.2.2 of OTG and EH 2.0:
"If the a_hnp_support feature is set, but the b_hnp_enable feature is not set,
then it is likely that b_hnp_enable will be set later when the A-device is
finished using the bus."

Signed-off-by: Li Jun <b47624@freescale.com>
(cherry picked from commit 51317577d16034ba151da8d502319f4befb91278)
(cherry picked from commit 3d5d5139b3aef654e8004a2ad9ce757af50aee57)

drivers/usb/core/hub.c

index 6b4712f..208f221 100644 (file)
@@ -2198,9 +2198,9 @@ static inline void announce_device(struct usb_device *udev) { }
  */
 static int usb_enumerate_device_otg(struct usb_device *udev)
 {
+#ifdef CONFIG_USB_OTG
        int err = 0;
 
-#ifdef CONFIG_USB_OTG
        /*
         * OTG-aware devices on OTG-capable root hubs may be able to use SRP,
         * to wake us after we've powered off VBUS; and HNP, switching roles
@@ -2257,7 +2257,7 @@ static int usb_enumerate_device_otg(struct usb_device *udev)
                }
        }
 #endif
-       return err;
+       return 0;
 }