diff options
author | Tilman Schmidt <tilman@imap.cc> | 2015-07-13 18:37:13 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-07-15 20:24:45 -0400 |
commit | fd98e9419d8d622a4de91f76b306af6aa627aa9c (patch) | |
tree | e9047d514d1ba80a6aad4027860dd1c4d4e3f42a | |
parent | 052cbda41fdc243a8d40cce7ab3a6327b4b2887e (diff) |
isdn/gigaset: reset tty->receive_room when attaching ser_gigaset
Commit 79901317ce80 ("n_tty: Don't flush buffer when closing ldisc"),
first merged in kernel release 3.10, caused the following regression
in the Gigaset M101 driver:
Before that commit, when closing the N_TTY line discipline in
preparation to switching to N_GIGASET_M101, receive_room would be
reset to a non-zero value by the call to n_tty_flush_buffer() in
n_tty's close method. With the removal of that call, receive_room
might be left at zero, blocking data reception on the serial line.
The present patch fixes that regression by setting receive_room
to an appropriate value in the ldisc open method.
Fixes: 79901317ce80 ("n_tty: Don't flush buffer when closing ldisc")
Signed-off-by: Tilman Schmidt <tilman@imap.cc>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/isdn/gigaset/ser-gigaset.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/isdn/gigaset/ser-gigaset.c b/drivers/isdn/gigaset/ser-gigaset.c index 8c91fd5eb6fd..3ac9c4194814 100644 --- a/drivers/isdn/gigaset/ser-gigaset.c +++ b/drivers/isdn/gigaset/ser-gigaset.c | |||
@@ -524,9 +524,18 @@ gigaset_tty_open(struct tty_struct *tty) | |||
524 | cs->hw.ser->tty = tty; | 524 | cs->hw.ser->tty = tty; |
525 | atomic_set(&cs->hw.ser->refcnt, 1); | 525 | atomic_set(&cs->hw.ser->refcnt, 1); |
526 | init_completion(&cs->hw.ser->dead_cmp); | 526 | init_completion(&cs->hw.ser->dead_cmp); |
527 | |||
528 | tty->disc_data = cs; | 527 | tty->disc_data = cs; |
529 | 528 | ||
529 | /* Set the amount of data we're willing to receive per call | ||
530 | * from the hardware driver to half of the input buffer size | ||
531 | * to leave some reserve. | ||
532 | * Note: We don't do flow control towards the hardware driver. | ||
533 | * If more data is received than will fit into the input buffer, | ||
534 | * it will be dropped and an error will be logged. This should | ||
535 | * never happen as the device is slow and the buffer size ample. | ||
536 | */ | ||
537 | tty->receive_room = RBUFSIZE/2; | ||
538 | |||
530 | /* OK.. Initialization of the datastructures and the HW is done.. Now | 539 | /* OK.. Initialization of the datastructures and the HW is done.. Now |
531 | * startup system and notify the LL that we are ready to run | 540 | * startup system and notify the LL that we are ready to run |
532 | */ | 541 | */ |