Revert "msm: tty: update receive room just before writing data to the ldisc"

This reverts commit 913565a83d.

This change seems to be a hack introduced for some corner cases seen on
certain old fusion targets. The change is no longer applicable and is
being reverted to bring the driver closer to the upstream implementation.
The presence of this causes several merge conflicts when pulling upstream
fixes. It has already been reverted on mainline.

Change-Id: I9c08c96d77f478d21ca0b91ef2a8a3d5bf06cb00
Signed-off-by: Syed Rameez Mustafa <rameezmustafa@codeaurora.org>
This commit is contained in:
Syed Rameez Mustafa
2013-09-20 11:53:24 -07:00
parent fd60540395
commit d3f311d9ac
3 changed files with 2 additions and 29 deletions
+2 -26
View File
@@ -463,8 +463,6 @@ static void flush_to_ldisc(struct work_struct *work)
int count;
char *char_buf;
unsigned char *flag_buf;
unsigned int left = 0;
unsigned int max_space;
count = head->commit - head->read;
if (!count) {
@@ -475,32 +473,10 @@ static void flush_to_ldisc(struct work_struct *work)
continue;
}
/* update receive room */
spin_lock(&tty->read_lock);
if (tty->update_room_in_ldisc) {
if ((tty->read_cnt == N_TTY_BUF_SIZE - 1) &&
(tty->receive_room ==
N_TTY_BUF_SIZE - 1))
tty->rr_bug++;
left = N_TTY_BUF_SIZE - tty->read_cnt - 1;
}
spin_unlock(&tty->read_lock);
if (!tty->receive_room)
break;
if (tty->update_room_in_ldisc && !left) {
schedule_work(&tty->buf.work);
break;
}
if (tty->update_room_in_ldisc)
max_space = min(left, tty->receive_room);
else
max_space = tty->receive_room;
if (count > max_space)
count = max_space;
if (count > tty->receive_room)
count = tty->receive_room;
char_buf = head->char_buf_ptr + head->read;
flag_buf = head->flag_buf_ptr + head->read;
head->read += count;
-1
View File
@@ -516,7 +516,6 @@ int usb_wwan_open(struct tty_struct *tty, struct usb_serial_port *port)
/* explicitly set the driver mode to raw */
tty->raw = 1;
tty->real_raw = 1;
tty->update_room_in_ldisc = 1;
set_bit(TTY_NO_WRITE_SPLIT, &tty->flags);
dbg("%s", __func__);
-2
View File
@@ -282,10 +282,8 @@ struct tty_struct {
struct winsize winsize; /* termios mutex */
unsigned char stopped:1, hw_stopped:1, flow_stopped:1, packet:1;
unsigned char low_latency:1, warned:1;
unsigned char update_room_in_ldisc:1;
unsigned char ctrl_status; /* ctrl_lock */
unsigned int receive_room; /* Bytes free for queue */
unsigned int rr_bug;
struct tty_struct *link;
struct fasync_struct *fasync;