Am Montag, 19. April 2004 04:55 schrieb Alan Stern:
> On Sun, 18 Apr 2004, Oliver Neukum wrote:
> > Am Sonntag, 18. April 2004 16:36 schrieb Alan Stern:
> > > > A spinlock could replace it. But that is a small detail.
> > >
> > > Yes it could.  Then the driver would start to resemble its original
> > > form again, defeating Greg's point.
> >
> > Where's the difference between
> > lock_kernel();
> > vs.
> > spin_lock(&skel_open_lock);
>
> Ah, but if you use a spinlock (or semaphore) instead of lock_kernel() then
> you have to lock _both_ the open() and disconnect() routines.  Otherwise
> the lock won't do anything useful.

That's an advantage. Using the knowledge that sys_open() takes BKL in
an example driver is not nice.

[..]
> Okay, I agree with you.  James Bottomley would disagree partially;
> according to him it's okay to increase the reference counter while in the
> "undead" state because (1) such things will happen only rarely as the
> window is rather short, (2) all attempted I/O in this state will fail
> anyhow, and (3) it's not worth the effort to prevent it.

He may have a point.

[..]
> What I mean is that once a driver is no longer bound to an interface it
> ought to be prevented from doing I/O to ep0 as well -- even though other
> drivers bound to other interfaces might still be allowed to use ep0.  In

Right.

> other words, URBs should be addressed to an interface-endpoint pair.  For
> endpoints other than ep0 this doesn't matter, since such eps only belong
> to a single interface, but with ep0 it does matter.

No, you are repeating the old error on a new level.
You cannot tell from an interface-endpoint whether the submission is legal
or not. The binding of an interface to a driver can change an arbitrary
number of times, even rebinding to the same driver is legal.

You need to record the binding somewhere and use it during submission.
I see two options to allow that.
1. You really make a new data structure like usb_driver_binding
2. You record it in the URB meaning changes to usb_alloc_urb()

        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