On Tue, Nov 04, 2014 at 10:46:11AM +0800, Peter Chen wrote:
> It is safe to call notify disconnect when the usb core
> thinks the device is disconnected.
> 
> This commit also fixes one bug found at below situation:
> we have not enabled usb wakeup, we do system suspend when
> there is an usb device at the port, after suspend, we plug out
> the usb device, then plug in device again. At that time,
> the nofity disconnect was not called at current code, as
> the controller doesn't know the usb device was disconnected
> during the suspend, but USB core knows the port has changed
> during that periods.
> 
> So to fix this problem, and let the usb core call notify disconnect.
> 
> Cc: 3.17+ <sta...@vger.kernel.org>
> Signed-off-by: Peter Chen <peter.c...@freescale.com>
> ---
> 
> Changes for v2:
> - Rebase on the newest usb-linus, and change "hcd->phy" to "hcd->usb_phy".
> 
>  drivers/usb/core/hub.c |    5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
> index 65a8e50..00912a5 100644
> --- a/drivers/usb/core/hub.c
> +++ b/drivers/usb/core/hub.c
> @@ -4624,9 +4624,8 @@ static void hub_port_connect(struct usb_hub *hub, int 
> port1, u16 portstatus,
>  
>       /* Disconnect any existing devices under this port */
>       if (udev) {
> -             if (hcd->usb_phy && !hdev->parent &&
> -                             !(portstatus & USB_PORT_STAT_CONNECTION))
> -                     usb_phy_notify_disconnect(hcd->usb_phy, udev->speed);
> +             if (hcd->phy && !hdev->parent)

Why is this now hcd->phy and not hcd->usb_phy?

Did you test this?

And why does it need to go to stable?  Who has reported problems with
this?

thanks,

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

Reply via email to