Re: [V2 PATCH 01/10] added media agnostic (MA) USB HCD driver

Alan Stern
2014-11-12T22:03:21Z

On Wed, 12 Nov 2014, Sean O. Stalley wrote:

> On Tue, Nov 11, 2014 at 10:54:30AM -0500, Alan Stern wrote:
> > On Mon, 10 Nov 2014, Stephanie Wallick wrote:
> >
> > > +static struct mausb_hcd mhcd;
> >
> > Only one statically-allocated structure? What if somebody wants to
> > have more than one of these things in their system?
> >
>
> Our plan to support multiple MA devices is to have them all connected
> to the same virtual host controller, so only 1 would be needed.
>
> Would you prefer we have 1 host controller instance per MA device?
> We are definitely open to suggestions on how this should be architected.

I haven't read the MA USB spec, so I don't know how it's intended to
work. Still, what happens if you create a virtual host controller
with, say, 16 ports, and then someone wants to connect a 17th MA
device?

Also, I noticed that your patch adds a new bus type for these MA host
controllers. It really seems like overkill to have a whole new bus
type if there's only going to be one device on it.

> If we get rid of these locks, endpoints can't run simultaneously.
> MA USB IN endpoints have to copy data, which could take a while.

I don't know what you mean by "run simultaneously". Certainly multiple
network packets can be transmitted and received concurrently even if
you use a single spinlock, since your locking won't affect the
networking subsystem.

> Couldn't this cause a bottleneck?

Probably not enough to matter. After all, the other host controller
drivers rely on a single spinlock. And if it did matter, you could
drop the spinlock while copying the data.

Alan Stern