On Tue, 3 Oct 2006 01:04:25 +0200, Oliver Neukum <[EMAIL PROTECTED]> wrote:
> in the appletouch driver open() races with suspend(). This should > fix it. Nicolas, could you please test it? I agree with the idea, but I think that you can drop rv from this: > @@ -404,11 +407,17 @@ > static int atp_open(struct input_dev *input) > { > struct atp *dev = input->private; > + int rv = 0; > > - if (usb_submit_urb(dev->urb, GFP_ATOMIC)) > - return -EIO; > + mutex_lock(&appletouch_open_mutex); > + if (!dev->suspended && usb_submit_urb(dev->urb, GFP_KERNEL)) { > + rv = -EIO; > + goto done; > + } > > dev->open = 1; > +done: > + mutex_unlock(&appletouch_open_mutex); > return 0; > } I do not remember the precise chain of reasoning now, but IIRC our input open methods must not return non-zero codes (even though they are defined to return error codes). It has something to do with the way input layer is coded. So, it's a GOOD thing that you forgot to use 'rv' after it was set to -EIO. Nicolas can test the patch without waiting for you to resend. -- Pete ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel