RE: [PATCH] usb: Skip U1/U2 LPM disable if device is disconnected.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>-----Original Message-----
>From: Sarah Sharp [mailto:sarah.a.sharp@xxxxxxxxxxxxxxx]
>Sent: Friday, January 10, 2014 12:44 AM
>To: Venkatesh Murthy, HemanthX
>Cc: Alan Stern; linux-usb@xxxxxxxxxxxxxxx; Nandibasappa, GirishX
>Subject: Re: [PATCH] usb: Skip U1/U2 LPM disable if device is disconnected.
>
>> Should hub_port_reset also be avoided in Inactive state.
>>
>> 7>[  181.542976] hub 2-0:1.0: port 2 not reset yet, waiting 50ms
>> <7>[  181.593907] hub 2-0:1.0: port 2 not reset yet, waiting 200ms
>> <7>[  181.794881] hub 2-0:1.0: port 2 not reset yet, waiting 200ms
>> <7>[  181.995826] hub 2-0:1.0: port 2 not reset yet, waiting 200ms
>> <7>[  182.196746] hub 2-0:1.0: port 2 not reset yet, waiting 200ms
>> <7>[  182.196766] hub 2-0:1.0: port_wait_reset: err = -16
>
>No, it cannot be avoided.  The port will remain in the Inactive state unless the USB core issues a warm port reset on the port.
>

Yes agree, but I think the multiple loops can be avoided. With the below change in hub_port_wait_reset around 5 secs is saved for disconnect detection.

@@ -2545,15 +2546,15 @@ static int hub_port_wait_reset(struct usb_hub *hub, int port1,
                        port1, warm ? "warm " : "", delay);
        }

-       if ((portstatus & USB_PORT_STAT_RESET))
-               return -EBUSY;
+       /* Device went away? */
+       if (!(portstatus & USB_PORT_STAT_CONNECTION))
+               return -ENOTCONN;

        if (hub_port_warm_reset_required(hub, portstatus))
                return -ENOTCONN;

-       /* Device went away? */
-       if (!(portstatus & USB_PORT_STAT_CONNECTION))
-               return -ENOTCONN;
+       if ((portstatus & USB_PORT_STAT_RESET))
+               return -EBUSY;


I have been testing the above change along with  [PATCH] usb: Skip U1/U2 LPM disable if device is disconnected, and the results have been good.

Thanks
Hemanth
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux