From: Marc Zyngier <maz@misterjones.org>
To: R.E.Wolff@BitWizard.nl
Cc: linux-kernel@vger.kernel.org, akpm@osdl.org, torvalds@osdl.org,
alan@lxorguk.ukuu.org.uk
Subject: [PATCH] Fix Specialix SX corruption
Date: Mon, 27 Feb 2006 12:08:00 +0100 [thread overview]
Message-ID: <wrpk6bh9i0f.fsf@wild-wind.fr.eu.org> (raw)
Roger,
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.
Patch against v2.6.16-rc5.
Signed-off-by: Marc Zyngier <maz@misterjones.org>
diff --git a/drivers/char/sx.c b/drivers/char/sx.c
index 588e75e..a6b4f02 100644
--- a/drivers/char/sx.c
+++ b/drivers/char/sx.c
@@ -1095,17 +1095,17 @@ static inline void sx_receive_chars (str
sx_dprintk (SX_DEBUG_RECEIVE, "rxop=%d, c = %d.\n", rx_op, c);
+ /* Don't copy past the end of the hardware receive buffer */
+ if (rx_op + c > 0x100) c = 0x100 - rx_op;
+
+ sx_dprintk (SX_DEBUG_RECEIVE, "c = %d.\n", c);
+
/* Don't copy more bytes than there is room for in the buffer */
c = tty_prepare_flip_string(tty, &rp, c);
sx_dprintk (SX_DEBUG_RECEIVE, "c = %d.\n", c);
- /* Don't copy past the end of the hardware receive buffer */
- if (rx_op + c > 0x100) c = 0x100 - rx_op;
-
- sx_dprintk (SX_DEBUG_RECEIVE, "c = %d.\n", c);
-
/* If for one reason or another, we can't copy more data, we're done! */
if (c == 0) break;
--
And if you don't know where you're going, any road will take you there...
next reply other threads:[~2006-02-27 11:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-27 11:08 Marc Zyngier [this message]
2006-02-27 12:08 ` Rogier Wolff
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=wrpk6bh9i0f.fsf@wild-wind.fr.eu.org \
--to=maz@misterjones.org \
--cc=R.E.Wolff@BitWizard.nl \
--cc=akpm@osdl.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®