lkml.org 
[lkml]   [2009]   [Dec]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectlinux-next: manual merge of the usb tree with Linus' tree
Hi Greg,

Today's linux-next merge of the usb tree got a conflict in
drivers/usb/serial/generic.c between commit
119eecc831a42bd090543568932e440c6831f1bb ("Fix usb_serial_probe() problem
introduced by the recent kfifo changes") from Linus' tree and commit
40b2ba0dfb62bed0f7cc6f699053d18ca4553e91 ("USB: serial: mct_usb232: add
drain on close") from the usb tree.

I fixed it up (see below) and can carry the fix for a while. The result
needs checking.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au

diff --cc drivers/usb/serial/generic.c
index f1ea3a3,3eea1d8..0000000
--- a/drivers/usb/serial/generic.c
+++ b/drivers/usb/serial/generic.c
@@@ -386,12 -386,15 +386,15 @@@ int usb_serial_generic_chars_in_buffer(

dbg("%s - port %d", __func__, port->number);

+ spin_lock_irqsave(&port->lock, flags);
if (serial->type->max_in_flight_urbs) {
- spin_lock_irqsave(&port->lock, flags);
chars = port->tx_bytes_flight;
- spin_unlock_irqrestore(&port->lock, flags);
- } else if (serial->num_bulk_out)
+ } else if (serial->num_bulk_out) {
+ /* This overcounts badly, but is good enough for drain wait. */
- chars = __kfifo_len(port->write_fifo);
+ chars = kfifo_len(&port->write_fifo);
+ chars += port->write_urb_busy * port->bulk_out_size;
+ }
+ spin_unlock_irqrestore(&port->lock, flags);

dbg("%s - returns %d", __func__, chars);
return chars;


\
 
 \ /
  Last update: 2009-12-23 23:33    [W:0.027 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site