RE: [PATCH 1/2] xHCI: change xhci_reset_device() to allocate new device

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

 



> -----Original Message-----
> From: Alan Stern [mailto:stern@xxxxxxxxxxxxxxxxxxx]
> Sent: Tuesday, August 17, 2010 10:46 PM
> To: Xu, Andiry
> Cc: sarah.a.sharp@xxxxxxxxxxxxxxx; linux-usb@xxxxxxxxxxxxxxx;
> gregkh@xxxxxxx
> Subject: Re: [PATCH 1/2] xHCI: change xhci_reset_device() to allocate
new
> device
> 
> On Tue, 17 Aug 2010, Andiry Xu wrote:
> 
> > >From fb54a4791208d08d42c1bae8f58b2657301a1143 Mon Sep 17 00:00:00
2001
> > From: Andiry Xu <andiry.xu@xxxxxxx>
> > Date: Mon, 16 Aug 2010 15:52:18 +0800
> > Subject: [PATCH 1/2] xHCI: change xhci_reset_device() to allocate
new
> device
> >
> > Rename xhci_reset_device() to xhci_discover_or_reset_device().
> > If xhci_discover_or_reset_device() is called to reset a device which
> does
> > not exist, it calls xhci_alloc_dev() to re-allocate the device.
> >
> > This would prevent the reset device failure, possibly due to the xHC
> restore
> > error during S3/S4 resume. Note this change would affect
> xhci_address_device()
> > behavior: udev->config exists, but the device is actually not
configured
> yet.
> > Add a flag in struct xhci_virt_device to indicate its actual state.
> 
> Hmmm.  This means that the place where the alloc_dev method gets
called
> in core/usb.c:usb_alloc_dev() is now redundant.  Do you think it
should
> get removed?
> 

To remove alloc_dev method calling in usb_alloc_dev(), two more places
need to be modified: xhci_check_args() in
xhci_discover_or_reset_device(), to allow udev with slot_id = 0 to be
allocate; and reset super speed device in hub_port_init(). I tried and
it seems work fine. But I wonder if there will be any potential issue,
especially xhci_discover_or_reset_device() uses udev->slot_id to
allocate or reset device. Will there be any udev->slot_id conflict issue
in certain cases? Sarah, what's your opinion?

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