Re: [PATCH] usbmouse: random freeze/hangup; synchronize irq completion

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 15 Feb 2011, Jordi Pujol wrote:

> A Dilluns 14 Febrer 2011 16:00:24, Alan Stern va escriure:
> > 	It calls mutex_lock(), which can sleep, from within an URB
> > 	completion routine, which runs with interrupts disabled.
> > 
> > 	It doesn't synchronize the completion _with_ anything else,
> > 	i.e., it calls mutex_lock() in only one place.
> this routine is synchronized with himself.

No.  The code you added does not perform _any_ additional 
synchronization.  If it did, you'd see a big fat error message in the 
kernel log because the mutex_lock call would try to sleep while in 
interrupt context.

> I said synchronize thinking about synchronized routines that are pieces of 
> code scheduled to be executed only in a single thread simultaneously; 
> therefore a new call to this routine can not be executed until a previous call 
> has been completed.

That is true even without your patch.  Go ahead and add a pair of
debugging printouts to the usb_mouse_irq() routine (without your
patch); print the value of urb upon entry and exit.  You'll see that
there are never two instances of the routine running comcurrently for
the same URB.  In fact, if you have only one USB mouse, you'll see that
there are never two instances of the routine running concurrently at
all.

> > Whatever is causing your problem, this is not the proper solution.
> Yes, that this is not a patch to be included in the kernel, it's only a 
> testing patch, but it solves the hangup. and so this probes that there is some 
> kind of problem related to the urb update process; I think the problem should 
> be external to this routine.
> 
> searching the web, some people has found problems like this, example:
> - [ubuntu] Ubuntu 10.04 (Lucid Lynx) Random Freeze / Hang-up
> 
> Consider this as an idea to point out the problem and, if possible, someone 
> more expert help to look for a good solution.

More to the point, why are you using the usbmouse driver in the first
place?  You should be using usbhid instead.  See the warnings in the
Kconfig help text for USB_MOUSE.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux