diff options
author | Marc Zyngier <maz@misterjones.org> | 2006-02-27 06:08:00 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-02-27 11:18:04 -0500 |
commit | d904ffd6e0c3ab7631b07c21c9f9234a2e72d1f3 (patch) | |
tree | e872c4fcbbf661cccd40d5c414801544c5ef8a5c /drivers/char | |
parent | e95a9ec1bb66e07b138861c743192f06e7b3e4de (diff) |
[PATCH] Fix Specialix SX corruption
With the latest kernels, I experienced some strange corruption, some
'*****' being randomly inserted in the character flow, like this:
ashes:~#
ashes:~#
a*******shes:~#
ashes:~#
ashes:~#
Further investigation shows that the problem was introduced during
Alan's "TTY layer buffering revamp" patch, the amount of data to be
copied being reduced after buffer allocation. Moving the count fixup
around solves the problem.
Signed-off-by: Marc Zyngier <maz@misterjones.org>
Approved-by: Rogier Wolff <R.E.Wolff@BitWizard.nl>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/sx.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/char/sx.c b/drivers/char/sx.c index 588e75ec1630..a6b4f02bdceb 100644 --- a/drivers/char/sx.c +++ b/drivers/char/sx.c | |||
@@ -1095,17 +1095,17 @@ static inline void sx_receive_chars (struct sx_port *port) | |||
1095 | 1095 | ||
1096 | sx_dprintk (SX_DEBUG_RECEIVE, "rxop=%d, c = %d.\n", rx_op, c); | 1096 | sx_dprintk (SX_DEBUG_RECEIVE, "rxop=%d, c = %d.\n", rx_op, c); |
1097 | 1097 | ||
1098 | /* Don't copy past the end of the hardware receive buffer */ | ||
1099 | if (rx_op + c > 0x100) c = 0x100 - rx_op; | ||
1100 | |||
1101 | sx_dprintk (SX_DEBUG_RECEIVE, "c = %d.\n", c); | ||
1102 | |||
1098 | /* Don't copy more bytes than there is room for in the buffer */ | 1103 | /* Don't copy more bytes than there is room for in the buffer */ |
1099 | 1104 | ||
1100 | c = tty_prepare_flip_string(tty, &rp, c); | 1105 | c = tty_prepare_flip_string(tty, &rp, c); |
1101 | 1106 | ||
1102 | sx_dprintk (SX_DEBUG_RECEIVE, "c = %d.\n", c); | 1107 | sx_dprintk (SX_DEBUG_RECEIVE, "c = %d.\n", c); |
1103 | 1108 | ||
1104 | /* Don't copy past the end of the hardware receive buffer */ | ||
1105 | if (rx_op + c > 0x100) c = 0x100 - rx_op; | ||
1106 | |||
1107 | sx_dprintk (SX_DEBUG_RECEIVE, "c = %d.\n", c); | ||
1108 | |||
1109 | /* If for one reason or another, we can't copy more data, we're done! */ | 1109 | /* If for one reason or another, we can't copy more data, we're done! */ |
1110 | if (c == 0) break; | 1110 | if (c == 0) break; |
1111 | 1111 | ||