Re: [RFC 3/3] USB: Check bandwidth when switching alt settings.

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

 



On Thu, Nov 12, 2009 at 04:02:06PM +0100, Oliver Neukum wrote:
> Am Donnerstag, 12. November 2009 00:10:29 schrieb Sarah Sharp:
> >  > --- a/drivers/usb/core/hcd.c
> >  >
> > > > +++ b/drivers/usb/core/hcd.c
> > >
> > > 
> > >
> > > > @@ -868,6 +869,7 @@ static void usb_bus_init (struct usb_bus *bus)
> > > >     bus->bandwidth_allocated = 0;
> > > >     bus->bandwidth_int_reqs  = 0;
> > > >     bus->bandwidth_isoc_reqs = 0;
> > > > +   mutex_init(&bus->bandwidth_lock);
> > >
> > > 
> > > I'd prefer to put the new mutex into struct usb_hcd rather than 
> > > usb_bus.  The usb_bus structure is a holdover from long ago.
> > > 
> > > Also, since it is a mutex and not a spinlock, perhaps you should name
> > > it something other than "bandwidth_lock".
> > 
> > bandwidth_mutex?  Fine. :)
> 
> I may be dense, but why would bandwidth be connected to either the hcd
> or the bus? It seems to me that you can exceed the bandwidth a hub provides
> long before you max the bus, by using slow or full speed devices on a high
> speed hub.

That is why the xHCI hardware needs to know what devices are hubs and,
for each device, what hub isolates the high speed and USB 1.1 signaling
environment.  But we still need a lock per root hub so that the total
bus bandwidth isn't exceeded by parallel operations.

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