On Wed, 12 Apr 2000, David Brownell wrote:
> Thomas Sailer wrote:
> >
> > David Brownell wrote:
> >
> > > If issuing GET_* messages causes troubles as you said, then
> > > "cat devices" should be able to trigger them sometimes when
> > > it causes string descriptor requests.
> >
> > Yes; it was however not my decision to put the strings
> > into devices, I was never too happy with it, as it gave
> > oopses in the past.
>
> Well, it can be done correctly, and IMHO should be, but
> an "Oops" doesn't fall into that category. Removing strings
> from "devices" would be a workaround, not a solution.
>
> > > I've not heard of such a thing. But if it does happen, the
> > > reason will either be bad serialization of control messages
> >
> > As far as I know this is still not solved, i.e. control
> > msgs aren't serialized so far. I think this should happen
> > either in the HCD or the usbcore sync->async wrappers...
Woah... okay, I'm joining in this discussion a little late, so forgive my
ignorance. But this piece of e-mail finally caught my attention.
I always assumed (albeit with much ignorance) that usbdevfs cached the
strings which described the device in it's own personal copy. Is that not
the case?
If not, then we can have a real problem that definately requires a global
lock, rather than a serialization issue. Consider usb-storage, which
conducts multi-stage transactions with a device. With just serialization
in place, if I send the control message to a CBI device to initiate the
transaction, and then get interrupted by someone doing a 'cat devices',
we're dead. I don't even want to think of what will happen to usbdevfs or
to the data on the storage device.
The only ways I see to solve this is:
(a) Only the device which claims the interface can actually issue
commands (this means hands-off to usbdevfs), or
(b) a global lock, which means possibly non-trivial code changes to most
(if not all) drivers
I think the question comes down to this: Is this a usbdevfs-specific
problem, or not? Are there other cases where we can have multiple drivers
(kernelspace or userspace) fighting for control of a device?
Matt Dharm
--
Matthew Dharm Home: [EMAIL PROTECTED]
Engineer, Qualcomm, Inc. Work: [EMAIL PROTECTED]
I'm a pink gumdrop! How can anything be worse?!!
-- Erwin
User Friendly, 10/4/1998
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]