On Fri, Jun 27, 2003 at 12:15:04PM +0200, Oliver Neukum wrote: > > > On Fri, 27 Jun 2003, Manuel Estrada Sainz wrote: > > > On Thu, Jun 26, 2003 at 11:41:18PM +0200, Oliver Neukum wrote: > > > /* We don't like racing :) */ > > > ctx->outurb->transfer_flags &= ~URB_ASYNC_UNLINK; > > > usb_unlink_urb(ctx->outurb); > > > del_timer_sync(&ctx->timer); > > > > > > But neither do we like sleeping in interrupt. You can't simply unset the flag > > > if somebody else may be needing it. > > > > > > More when I am rested :-) > > > > How about the attached patch, not pretty, but it should work. > > It is much too ugly. Please use a struct completion or a waitqueue. How about this? The other choice is to just wait on the completion unconditionally and let timers expire on their own if needed. That would probably be more robust, and waiting a few extra seconds on module removal (which would just happen when the card hangs) is probably OK. What do you think? Thanks Manuel PS: Ideas on how to make the PCMCIA vs. USB integration (specially the locking) cleaner would be very, very welcomed. -- --- Manuel Estrada Sainz ------------------------ ------------------- Let us have the serenity to accept the things we cannot change, courage to change the things we can, and wisdom to know the difference.