Am Samstag, 3. April 2004 03:54 schrieb David Brownell:
> >>>>>We've talked about this before on the mailing lists... we've never
> >>>>> come up with a good solution.
> >>>>
> >>>>It seems to me that the problem screams for a semaphore. The question
> >>>> is just which semaphore.
> >>>
> >>>That, and coming up with reasonable semantics to impose on every driver.
>
> Let's see what usage fits well with dev->serialize.  There should be
> no reason to want another semaphore with that scope.  In fact, Duncan

Yes, the number of semaphores should be kept down. IMHO the perfect
model would be a per bus and a per device semaphore.

> had a patch to replace the usbfs devsem with dev->serialize ... and
> suggested making it a shared-or-exclusive lock (rwsem), which could
> useful in this case.

Hm. The by far most common case should be no contention, which means
we shouldn't increase cost there. down() is cheaper than down_read() and
down_write()

> For most devices, endpoints (including ep0) are independent of each
> other, so I/O could get a readlock and concurrent requests could be
> posted.  But with this quirk, they need to be single-threaded ... so
> I/O could writelock, instead.

Do we care in terms of performance? The number of devices with
multiple interfaces and a regular need to access ep0 should be very small.

[..]
> Drivers that issue control requests from non-task contexts might have
> some difficulty using an rwsem, but that would be OK and shouldn't make
> any problems making sure usbfs and usb-storage don't stomp on each other.

Right. Such drivers will have a hard time in any case.

        Regards
                Oliver



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to