Am Donnerstag, 12. Dezember 2002 00:44 schrieb Greg KH:
> On Wed, Dec 11, 2002 at 11:41:24PM +0100, Oliver Neukum wrote:
> >  /* used when updating list of hcds */
> > -DECLARE_MUTEX (usb_bus_list_lock); /* exported only for usbfs */
> > -EXPORT_SYMBOL_GPL (usb_bus_list_lock);
> > +DECLARE_RWSEM (usb_topology_lock); /* exported only for usbfs */
> > +EXPORT_SYMBOL_GPL (usb_topology_lock);
>
> No, don't change this to a rwlock.  It isn't needed.  I changed this a
> long time ago to a simple semaphore and it should be kept that way.
>
> So without the type change, and the name change, this just adds a few
> places in usb.c to protect the list some more?

Done. Here it is. It turns out to be surprisingly simple.

        Regards
                Oliver

You can import this changeset into BK by piping this whole message to:
'| bk receive [path to repository]' or apply the patch as usual.

===================================================================


[EMAIL PROTECTED], 2002-12-12 16:02:28+01:00, [EMAIL PROTECTED]
   - fix race between devices file read and disconnect


 usb.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)


diff -Nru a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
--- a/drivers/usb/core/usb.c    Thu Dec 12 16:05:23 2002
+++ b/drivers/usb/core/usb.c    Thu Dec 12 16:05:23 2002
@@ -91,9 +91,9 @@
        id = usb_match_id (intf, driver->id_table);
        if (id) {
                dbg ("%s - got id", __FUNCTION__);
-               down (&driver->serialize);
+               down (&usb_bus_list_lock);
                error = driver->probe (intf, id);
-               up (&driver->serialize);
+               up (&usb_bus_list_lock);
        }
        if (!error)
                intf->driver = driver;
@@ -124,10 +124,10 @@
                return -EIO;
        }
 
-       /* if we sleep here on an umanaged driver 
-        * the holder of the lock guards against 
+       /* if we sleep here on an umanaged driver
+        * the holder of the lock guards against
         * module unload */
-       down(&driver->serialize);
+       down(&usb_bus_list_lock);
 
        if (intf->driver && intf->driver->disconnect)
                intf->driver->disconnect(intf);
@@ -136,7 +136,7 @@
        if (intf->driver)
                usb_driver_release_interface(driver, intf);
 
-       up(&driver->serialize);
+       up(&usb_bus_list_lock);
        module_put(driver->owner);
 
        return 0;

===================================================================


This BitKeeper patch contains the following changesets:
1.1101
## Wrapped with gzip_uu ##


begin 664 bkpatch9910
M'XL(`+.E^#T``ZU4;6O;,!#^;/V*@\+86A+KQ2^Q1T:WMFQE@Y6.?BZR=+%-
M'*M(=M.!?_QD9[3K2,O6S98MZ^ZYTW.G!Q_`E4.;!Z:I;]&2`_AD7.>7V)H6
MYY798%.W_=W<V-([+XWQSG`TA[N(L%C/.HOHPJ;A,?&8"]FI"KS+Y0&;BWM+
M]_T&\^#R[./5E_>7A"R7<%+)ML1OV,%R28KUL>ZQF:^MD=6XW7#O'CBEC#$>
M4Q$G+![X0HAH8`DMM/_4/,U619*1TF)YO`M79O,XG#/.&/5WQ`;&DH4@I\#F
MHPDH#]DX@"4YY3E?'%&64PJ[^H[W=0*.&,PH^0#_3OJ$*(`9K.H[L%(A%-AM
M$5O0>%LK=-[1(%B4&F2K0==.F;9%U9'/P`1=<'+QT$8R^\N+$"HI>;>G#&W'
MXEW8NV)\YNJAG(AF+!FXB.)H4`E'C!><I:J0@L;/->U13F4L/B0>3X>S*,YB
M,=`XX=$DC_WX_5IY(=_?-?,\1<HR*FCF*8J([@24IK_H)\[C+(_%G^@G@5GR
MW_3S,OE,??X*,[N=AE?#Q1,M?X&N3K,(&#F?WD&@S;:%UZ]\LNNB=]=-[;KK
MQJCUF[<>F$S`9`+V-T_!&$^!DW/&%WX*PD.H5[!%<`WB#51H$4SK:X1^(UM9
MHOY9"@G@$+H*H3*-1@MF-:W&K%#VTFH'LI1UZSJ_A:`CE=TT<7Z*B\AVP''R
<G/?#[G]\JD*U=OUFF68\3J76Y`?@KMN\=04`````
`
end



-------------------------------------------------------
This sf.net email is sponsored by:
With Great Power, Comes Great Responsibility
Learn to use your power at OSDN's High Performance Computing Channel
http://hpc.devchannel.org/
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to