Re: [PATCH 2/3 v2 RESEND] xHCI: change xhci_reset_device() to allocate new device

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

 



On Fri, 8 Oct 2010, Sarah Sharp wrote:

> I've done some more testing, and Andiry's seven PM patches (mostly)
> work, when I apply the two extra patches that are attached.  The first
> patch fixes the control endpoint issue I described, and the second patch
> fixes an issue with persistent USB 3.0 devices across suspend with a
> power loss and hibernate.
> 
> Alan, could you look over the second patch?  It fixes the issue I was
> seeing, but I'm not sure if there are further-reaching implications for
> khubd when a USB 3.0 port is not disabled after a hub reset-resume.

It looks okay to me.  Telling usbcore that a SuperSpeed port isn't
enabled when it really is shouldn't cause too many problems.  This
happens anyway when a device is first plugged in.

> The quick fix is to pretend the port is disabled in hub_activate(), by
> clearing the local variable.  But I'm not sure what other parts of the hub
> driver need to be changed because they have assumptions about when ports
> will be disabled.
> 
> Signed-off-by: Sarah Sharp <sarah.a.sharp@xxxxxxxxxxxxxxx>
> ---
>  drivers/usb/core/hub.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
> index 6035fe3..b5f46fb 100644
> --- a/drivers/usb/core/hub.c
> +++ b/drivers/usb/core/hub.c
> @@ -758,6 +758,9 @@ static void hub_activate(struct usb_hub *hub, enum hub_activation_type type)
>  				clear_port_feature(hdev, port1,
>  						   USB_PORT_FEAT_ENABLE);
>  				portstatus &= ~USB_PORT_STAT_ENABLE;
> +			} else {
> +				/* Pretend that power was lost for USB3 devs */
> +				portstatus &= ~USB_PORT_STAT_ENABLE;
>  			}

Instead of duplicating the assignment to portstatus, you could move the
existing assignment outside the "if" statement.  That would reflect
what's really going on -- you're telling the hub driver that the port
is disabled, even though you can't actually disable a SuperSpeed port.

Alan Stern

--
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