RE: Possible issue in hub.c

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

 



> -----Original Message-----
> From: Sarah Sharp [mailto:sarah.a.sharp@xxxxxxxxxxxxxxx]
> Sent: Tuesday, March 22, 2011 10:34 PM
> To: Xu, Andiry
> Cc: Alan Stern; linux-usb@xxxxxxxxxxxxxxx
> Subject: Re: Possible issue in hub.c
> 
> On Tue, Mar 22, 2011 at 06:26:42PM +0800, Xu, Andiry wrote:
> > Hi,
> >
> > I'm checking the latest usb-next with USB3.0 hub changes. Following code
> from hub_port_status() in hub.c:
> >
> > 	if (*status & USB_SS_PORT_STAT_POWER)
> > 		tmp |= USB_PORT_STAT_POWER;
> >
> > Here the driver checks if portstatus reports USB_SS_PORT_STAT_POWER.
> >
> > However, in GetPortStatus in xhci-hub.c, the driver does not report
> USB_SS_PORT_STAT_POWER, it reports USB_PORT_STAT_POWER instead. Note their
> definitions are different. So the judgment will never be true.
> >
> > I think there is a legacy issue: USB3.0 spec has different wPortStatus
> and wPortChange definition from USB2.0 spec, but the xHCI driver uses the
> definitions in USB2.0 spec for a long time. Shouldn't we comply with
> USB3.0 specification?
> 
> Yes, the xHCI driver's hub emulation should comply with the USB 3.0
> specification, but only for the USB 3.0 roothub portion.  The USB 2.0
> roothub portion should still report port status like a USB 2.0 hub.
> Please patch any behavior that doesn't comply with that.
> 

I agree. But the PLS field in PORTSC register also apply to USB2 protocol ports, do we need to report them too?

> > (By doing that xHCI driver can report port link state of USB3 protocol
> ports to the usbcore too... Currently I'm debugging an issue in which I
> need usbcore to know the port link state of the ports, but xHCI driver
> does not report it.)
> 
> Yes, the xHCI driver doesn't report link port states yet.  Patches
> welcome. :)  Are you working on Link PM patches then?
> 

Link PM patches definitely need PLS report, but now I'm looking into a Kingston USB3.0 flash drive issue. When hot plug the device to the USB3 port, it cannot be detected. The port link goes into Recovery state, then into Inactive state. Current Linux driver does not know how to handle that state, and the emulation ends. According to USB3.0 spec, the driver should issue a warm reset if this happens. I've verified that warm reset the port can transition it to U0 state and emulation will succeed. When I'm making the patches, I find that we need to get the USB3.0 roothub portion report the port status comply to the USB3.0 specification.

Thanks,
Andiry

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