On Sat, Aug 09, 2003 at 08:04:50PM +0200, Oliver Neukum wrote:
> Hi,
> 
> two issues
> - checking for an active waitqueue is bad
> - after you've changed your task's state, memory allocation must be atomic
> 
>       Regards
>               Oliver

Thanks, applied.

> 
> 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-08-09 19:58:24+02:00, [EMAIL PROTECTED]
>   - clean up sleeping issues
> 
> 
>  iforce-packets.c |    5 ++---
>  iforce-usb.c     |    6 ++----
>  2 files changed, 4 insertions(+), 7 deletions(-)
> 
> 
> diff -Nru a/drivers/input/joystick/iforce/iforce-packets.c 
> b/drivers/input/joystick/iforce/iforce-packets.c
> --- a/drivers/input/joystick/iforce/iforce-packets.c  Sat Aug  9 20:02:08 2003
> +++ b/drivers/input/joystick/iforce/iforce-packets.c  Sat Aug  9 20:02:08 2003
> @@ -166,8 +166,7 @@
>               iforce->expect_packet = 0;
>               iforce->ecmd = cmd;
>               memcpy(iforce->edata, data, IFORCE_MAX_LENGTH);
> -             if (waitqueue_active(&iforce->wait))
> -                     wake_up(&iforce->wait);
> +             wake_up(&iforce->wait);
>       }
>  #endif
>  
> @@ -264,7 +263,7 @@
>               set_current_state(TASK_INTERRUPTIBLE);
>               add_wait_queue(&iforce->wait, &wait);
>  
> -             if (usb_submit_urb(iforce->ctrl, GFP_KERNEL)) {
> +             if (usb_submit_urb(iforce->ctrl, GFP_ATOMIC)) {
>                       set_current_state(TASK_RUNNING);
>                       remove_wait_queue(&iforce->wait, &wait);
>                       return -1;
> diff -Nru a/drivers/input/joystick/iforce/iforce-usb.c 
> b/drivers/input/joystick/iforce/iforce-usb.c
> --- a/drivers/input/joystick/iforce/iforce-usb.c      Sat Aug  9 20:02:08 2003
> +++ b/drivers/input/joystick/iforce/iforce-usb.c      Sat Aug  9 20:02:08 2003
> @@ -116,8 +116,7 @@
>  
>       iforce_usb_xmit(iforce);
>  
> -     if (waitqueue_active(&iforce->wait))
> -             wake_up(&iforce->wait);
> +     wake_up(&iforce->wait);
>  }
>  
>  static void iforce_usb_ctrl(struct urb *urb, struct pt_regs *regs)
> @@ -125,8 +124,7 @@
>       struct iforce *iforce = urb->context;
>       if (urb->status) return;
>       iforce->ecmd = 0xff00 | urb->actual_length;
> -     if (waitqueue_active(&iforce->wait))
> -             wake_up(&iforce->wait);
> +     wake_up(&iforce->wait);
>  }
>  
>  static int iforce_usb_probe(struct usb_interface *intf,
> 
> ===================================================================
> 
> 
> This BitKeeper patch contains the following changesets:
> 1.2214
> ## Wrapped with gzip_uu ##
> 
> 
> begin 664 bkpatch30865
> M'XL(`"4W-3\``[V5:V^;,!2&/^-?8:G2U*I+\`4P,*5JUVY=M4V-LO;3-$5@
> MG(1!`&&[435^_`QIL[7JJH9,[EMAIL PROTECTED]<]K]N"U%'5HE7EZ(VJP!S^54H66
> M:2]U(HIA(72FE\.RGIO8I"Q-S%Z42V&O!]A7M1#2CC*E90Q,EW&D^`*:B`PM
> M/*2;+^JV$J$U^7!^_>5D`L!H!$\743$7WX2"HQ&(L^-$BWR8U66T:%=K-N&&
> M((0Q)[EMAIL PROTECTED])R89D)8,(N]`,QK,3]>#^?E\N%PBGSD$D(88HWC
> M!02!,XB'A&`'(FHCWT8!Q$'H^B%Q#A$)$8)K><=/Y`$>$CA`X#W<?<^G@,,!
> MY+F("[EMAIL PROTECTED]',AJK28PU1*+23X#!W?#P(P_I,K,[EMAIL PROTECTED]"!S!1^E)ZE:>M-.B
> MTLK^6=Y*E?+,3F=ES<7=8U!%/!-*#GDKAR"&/(2IAVA#'`>SQB,Q#B*351[/
> [EMAIL PROTECTED]'Q"@$LH:P(WIK&IS(R:DE!/["[EMAIL PROTECTED];?
> MFW=:$CKBMTM":XM7J-JC-;[EMAIL PROTECTED],'[EMAIL PROTECTED]:><Q]:#`6([EMAIL 
> PROTECTED]'_
> M:+!5E([EMAIL PROTECTED]&D*BV+*,]ONUA5"W/[EMAIL PROTECTED]:0$3'3=&M`4<BIUO$S55-=Q
> M9T0#X"4<U*ON-KX:;UG.'LX]PUX`";C`#$$,+*O5,=75_IN[N8]64:H.WH$S
> MXC'3X6+]L*QT!O<?*MB_'\%5G;^%YQ_'TY.KRZ\7IP<'\-?+V>SX[LOE%D;<
> M;?Y[$IEKS.?Y%'<D8MP71><54#2$=<=$'\0ZX;WPPFN\2(?7/^G"Q%]W"Y[K
> [EMAIL PROTECTED]@X#>[EMAIL PROTECTED]
> `
> end
> 

-- 
Vojtech Pavlik
SuSE Labs, SuSE CR


-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines
at the same time. Free trial click here:http://www.vmware.com/wl/offer/358/0
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to