Re: Walking the USB tree?

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

 



On Thu, Jun 30, 2011 at 01:53:31PM -0700, Sarah Sharp wrote:
> On Thu, Jun 30, 2011 at 01:43:42PM -0700, Greg KH wrote:
> > On Thu, Jun 30, 2011 at 01:26:37PM -0700, Sarah Sharp wrote:
> > > Hi Alan,
> > > 
> > > In an upcoming patchset, I'm going to need to walk the USB tree in the
> > > xHCI driver in order to gather some information during a device
> > > configuration or alt setting change.  Is there anything stopping the USB
> > > tree from changing while this operation is in progress?
> > 
> > Not if you use the proper "walk the bus for all devices" functions that
> > the driver core provides.  Use them and you should be fine, right?
> 
> Which functions are those?

The bus_for_each_dev() functions.

Or you can do what the USB devices file does, and use the
usb_bus_list_lock and just walk all devices manually.  See the function,
usb_device_read() for an example of how to do that safely.

hope this helps,

greg k-h
--
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