> Well I asked Pat, and he said it was ok to use. > > I'd prefer that, as we would not have to grab yet-another-lock in the > probe sequence. Just document it well :)
Here it is. This time locking and doing the operation is seperated. Some firmware loaders need to do a reset during probe. 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], 2003-03-29 17:46:46+01:00, [EMAIL PROTECTED] - mutual exclusion between reset() and probe() hub.c | 17 ++++++++++++++++- 1 files changed, 16 insertions(+), 1 deletion(-) diff -Nru a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c --- a/drivers/usb/core/hub.c Sat Mar 29 17:51:15 2003 +++ b/drivers/usb/core/hub.c Sat Mar 29 17:51:15 2003 @@ -1175,8 +1175,10 @@ * * Take a look at proc_resetdevice in devio.c for some sample code to * do this. + * Use this only from within your probe function, otherwise use + * usb_reset_device() below, which ensure proper locking */ -int usb_reset_device(struct usb_device *dev) +int usb_physical_reset_device(struct usb_device *dev) { struct usb_device *parent = dev->parent; struct usb_device_descriptor *descriptor; @@ -1305,4 +1307,17 @@ return 0; } + +int usb_reset_device(struct usb_device *udev) +{ + struct device *gdev = &udev->dev; + int r; + + down_read(&gdev->bus->subsys.rwsem); + r = usb_physical_reset_device(udev); + up_read(&gdev->bus->subsys.rwsem); + + return r; +} + =================================================================== This BitKeeper patch contains the following changesets: 1.1563 ## Wrapped with gzip_uu ## begin 664 bkpatch14495 M'XL(``//A3X``\56;6_;-A#^;/Z*`PH425O+?-&;/3A(W[`.';[EMAIL PROTECTED] MC$58)@U2C&M,_>\[R6G2=FJR>0-F$R;[EMAIL PROTECTED],;&-OE:./((W MUK=XJ8PU*JKM1C7:A(^1=2LT7EJ+QEF_/3M$S,KUM'5*^5GP)4\(.ET4K:P! M;7XQ89&XW6GW6[687+[^\=W/SR\)62[A95V8E?I5M;!<DG)[EMAIL PROTECTED]&MGB[H_ MK[LU=YQ2QAA/J$A2EG0\%R+N6$K+"I<5S^9793HG57&MJVEYOBUDJ9HF,ACY M%8:@@N><TRSA'>*)G+P"%K$D%4#%#`>?`\L6<8KC*64+2N&0Y?E8/>`IARDE M+^#?,W]))$QA$]I0-*`^RB9X;0V4JMTI9<`IK]J34RA,!5MG2W5R2MX"XWG. MR<5=%<GT'WX(H04E9R,)O-#M6Z6VV%_5RIE>&>O4M[F(.)F++DXR&9=4556> M9['([ZO8=V'[QLQ9&J<Q[6A,,:TQ4I7KD0>ES>I01O*.44PQO!,LYJ*3K$BO MDDS$<54F29;<R^A+3(EL[H"_Y-2CS0?)CF4PKM[C2TA63JW.#TC2;NZM6L(I MDF,[EMAIL PROTECTED]<QT[\C9O9?BOEY5:D*/A=7*Z68F,<S&W0DH;[EMAIL PROTECTED] MWZ*:AZ[_`E.W&P:*\V*TV$>(_"?&8F!DG,W0U7$5C/?U2!62F^(;%=9A$YEB MHW[K^_S[`Q),..N_'4]I)H8&S[,C&YS"E/[EMAIL PROTECTED];*WWNM2-;O>] M&`9_J(+39G4(0#T<;KEO!#%>JN,DD67`"3SIWW\H1^W!FF8/5\YN8*=QP\#> [EMAIL PROTECTED]>MV&H."5WT\<ODP9/"A4M=:8K)8B,;NGL&NUOC:4\8' ME#GBH)"AL7*-:9)72`#;-Q#I9VW:`6E;[[V61?,UI&]=D`>'PPX\P?D4HP7- [EMAIL PROTECTED];@H;@P!/Y!)C>VS_LK7,`2'O?VZ1G^_$`F/:;#F4PJNS,(750GCU># M0QG\],R'TN]]Y'9>;4[1SR'`]Y,83D:OL'T0Z3UBJ38XTQ__"2]O_T3(6LFU 3#YLED_,[EMAIL PROTECTED]@KP@@````` ` end ------------------------------------------------------- This SF.net email is sponsored by: The Definitive IT and Networking Event. Be There! NetWorld+Interop Las Vegas 2003 -- Register today! http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel