Re: [PATCH] USB: xhci - also free streams when resetting devices

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

 



On Wed, Apr 13, 2011 at 11:49:43AM -0700, Greg KH wrote:
> On Wed, Apr 13, 2011 at 09:57:37AM -0700, Dmitry Torokhov wrote:
> > On Wed, Apr 13, 2011 at 09:52:26AM -0700, Sarah Sharp wrote:
> > > On Wed, Apr 13, 2011 at 09:48:41AM -0700, Dmitry Torokhov wrote:
> > > > On Wed, Apr 13, 2011 at 09:38:18AM -0700, Sarah Sharp wrote:
> > > > > On Tue, Apr 12, 2011 at 11:06:28PM -0700, Dmitry Torokhov wrote:
> > > > > > Currently, when resetting a device, xHCI driver disables all but one
> > > > > > endpoints and frees their rings, but leaves alone any streams that
> > > > > > might have been allocated. Later, when users try to free allocated
> > > > > > streams, we oops in xhci_setup_no_streams_ep_input_ctx() because
> > > > > > ep->ring is NULL.
> > > > > > 
> > > > > > Let's free not only rings but also stream data as well, so that
> > > > > > calling free_streams() on a device that was reset will be safe.
> > > > > 
> > > > > Thanks for catching this.  I think Matthew Wilcox sent me a similar
> > > > > patch months ago and it got lost in my inbox somewhere. :(  I'll queue
> > > > > this as soon as I get the other USB 3.0 hub fixes settled.
> > > > 
> > > > Thanks Sarah.
> > > > 
> > > > Do you think we should also mark it for stable? Latest Ubuntu enabled
> > > > UAS driver so this issue might bite people in cases when the device is
> > > > coming and going for some reason.
> > > 
> > > Yes, I'll mark it for stable, and Matthew's patch too.  Interesting that
> > > Ubuntu decided to turn it on, even though there are (to my knowledge) no
> > > devices available commercially yet.  Have you see any?
> > 
> > I have here XIGMATEK Secure USD03 2.5" & 3.5" USB 3.0 External Docking
> > Station:
> > 
> > http://www.newegg.com/Product/Product.aspx?Item=N82E16817815011
> 
> Wow, is that really a UAS device?  I've seen, and bought, a bunch of USB
> 3.0 disk devices but have not seen a UAS one "in the wild" yet.

Yep, and here is lsusb for it if you are curious (look at the 2nd
interface descriptor - 98 = 0x62 = USB_PR_UAS):

[dtor@dtor-ws linus]$ sudo lsusb -v -d 1759:5002

Bus 003 Device 012: ID 1759:5002 LucidPort Technology, Inc. 
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               3.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0         9
  idVendor           0x1759 LucidPort Technology, Inc.
  idProduct          0x5002 
  bcdDevice           22.70
  iManufacturer           1 USB 3.0
  iProduct                2 MassStorage Device
  iSerial                 3       SB248DHJHYM26H
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength          121
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xc0
      Self Powered
    MaxPower                0mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         8 Mass Storage
      bInterfaceSubClass      6 SCSI
      bInterfaceProtocol     80 Bulk (Zip)
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               0
        bMaxBurst               8
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               0
        bMaxBurst               2
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       1
      bNumEndpoints           4
      bInterfaceClass         8 Mass Storage
      bInterfaceSubClass      6 SCSI
      bInterfaceProtocol     98 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               0
        bMaxBurst               1
        INTERFACE CLASS:  04 24 01 00
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               0
        bMaxBurst               2
        INTERFACE CLASS:  04 24 03 00
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               0
        bMaxBurst               6
        INTERFACE CLASS:  04 24 04 00
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               0
        bMaxBurst               1
        INTERFACE CLASS:  04 24 02 00
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.10
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  bNumConfigurations      1
Device Status:     0x0001
  Self Powered

Thanks.

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