Hi, this patch fixes a bug where submitting an sg request could get a task stuck in state D if the first submission fails.
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-01-20 21:32:53+01:00, [EMAIL PROTECTED] - fix task stuck in state D in usb_sg_wait() message.c | 14 +++++++++++--- 1 files changed, 11 insertions(+), 3 deletions(-) diff -Nru a/drivers/usb/core/message.c b/drivers/usb/core/message.c --- a/drivers/usb/core/message.c Mon Jan 20 21:36:57 2003 +++ b/drivers/usb/core/message.c Mon Jan 20 21:36:57 2003 @@ -412,8 +412,10 @@ */ void usb_sg_wait (struct usb_sg_request *io) { - int i; + int i,retries; unsigned long flags; + + retries = 0; /* queue the urbs. */ spin_lock_irqsave (&io->lock, flags); @@ -433,10 +435,14 @@ case -ENOMEM: retval = 0; i--; + retries++; + if (retries > 5) { + usb_sg_cancel(io); + goto give_up_and_exit; + } // FIXME: should it usb_sg_cancel() on INTERRUPT? // how about imposing a backoff? - set_current_state (TASK_UNINTERRUPTIBLE); - schedule (); + yield(); break; /* no error? continue immediately. @@ -447,6 +453,7 @@ */ case 0: cpu_relax (); + retries = 0; break; /* fail any uncompleted urbs */ @@ -467,6 +474,7 @@ */ wait_for_completion (&io->complete); +give_up_and_exit: sg_clean (io); } =================================================================== This BitKeeper patch contains the following changesets: 1.1286 ## Wrapped with gzip_uu ## begin 664 bkpatch5004 M'XL(`.I=+#X``\54;6O;,!#^+/V*@WY)R!+KQ9(=EY1L[=C&!@L9_1P<6W&$ M$ZO8\IHR[[]/2M*6E2UEW6#&X--SI[OG[AY\!M>-JA-D-OJKJO$9O#>-=4=5 MF4J-UF:K-KIJ=R-3%\XY-\8Y`P\'AQO!LAS:6JDF:)LE$]@%S5*;K<'YF@31 M$7]`[-V-2M#\[;OK3Z_G&$\F<+E.JT)]418F$[PLIWFK-J.R-NG:U^L>W!TC MA%+*!.%"4M&QF/.PHY(L<V?F+!JOEG*,#XRFO^+^<R[NLHVI#"6+NY#$XPA? M`1U1%DL@/"`T8`0833A+!!\0FA`")W+#@,*0X#?P]QU<X@R&L-([L&E30F/; MK`1=.2.U"JZ\Z<:\:(K%;:IMKX\_@N=/\>QQEGCXAP_&)"7X`HI:%=,#]\QL MN[SV'>_W&F2F5L%6-4U:J%'FFV%$$DY%&%+942+#<;>2(N1Q&,D\IC'ARU,C M>R:YVP]S%3@3O!."$[%7R^_O>/G\8_8GQ?0L>Z<N2DCHU.5RL;VZ.'VAMIRX M^/\2UV'XGV%8W^Y?)Y;9B3V\0'I7(15`\8?#!^G*(J1?U<K66C7G'I?`,,+H M",$$B(>Y`($1NH<'@W-_TBOHW0=>@.C#-X^B8UM96F5JT].FOP]&A;$&"M?, MHKU9I%6^4#MM]Z[OCA>/76%7:.QY(72GU2;O]7WM\`@]H20]_#1=\OA'S-8J 4*YMV.\E3+J(HRO$/(=KV17T%```` ` end ------------------------------------------------------- This SF.NET email is sponsored by: FREE SSL Guide from Thawte are you planning your Web Server Security? Click here to get a FREE Thawte SSL guide and find the answers to all your SSL security issues. http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0026en _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel