[PATCH] usb: g_serial: Fix a bug by setting low_latency to 0.

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

 



Fix a scheduling while atomic BUG by setting low_latency to 0.

The low_latency flag determines the amount of latency the 
data transfer is allowed. 

This bug occurs since functions such as mutex_lock() which 
can sleep are used with low_latency set(interrupt context).

The fix removes low_latency flag from u_serial.c and hence 
prevents the BUG.

Tested on OMAP4430 SDP. 

Signed-off-by: Maulik Mankad <x0082077@xxxxxx>
Cc: David Brownell <david-b@xxxxxxxxxxx>
---
Based on 2.6.35-rc3
Index: mainline/drivers/usb/gadget/u_serial.c
===================================================================
--- mainline.orig/drivers/usb/gadget/u_serial.c
+++ mainline/drivers/usb/gadget/u_serial.c
@@ -536,9 +536,6 @@ recycle:
 		list_move(&req->list, &port->read_pool);
 	}
 
-	/* Push from tty to ldisc; this is immediate with low_latency, and
-	 * may trigger callbacks to this driver ... so drop the spinlock.
-	 */
 	if (tty && do_push) {
 		spin_unlock_irq(&port->port_lock);
 		tty_flip_buffer_push(tty);
@@ -784,11 +781,6 @@ static int gs_open(struct tty_struct *tt
 	port->open_count = 1;
 	port->openclose = false;
 
-	/* low_latency means ldiscs work in tasklet context, without
-	 * needing a workqueue schedule ... easier to keep up.
-	 */
-	tty->low_latency = 1;
-
 	/* if connected, start the I/O stream */
 	if (port->port_usb) {
 		struct gserial	*gser = port->port_usb;
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" 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]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux