From: Yutaro Ebihara <ebiharaml@si-linux.com>
To: linux-sh@vger.kernel.org
Subject: SH7760,7780,7785 sh-sci.c bugfix
Date: Mon, 10 Mar 2008 09:13:19 +0000 [thread overview]
Message-ID: <24C8828EFB268Eebiharaml@si-linux.com> (raw)
hi all
I found bug in sh-sci.c
$ echo "A" > /dev/ttySC[0-2] open()
write()
close()
send more than 128 bytes into ttySC[0-2] from other machine.
$ echo "A" > /dev/ttySC[0-2] open()
kernel stoped.
Because.
SCRFDR counts upto 0x80 not 0x7F.
if recive fifo has 128 charactors, SCRFDR indicates 0x80.
return sci_in(port, SCRFDR) & 0x7f;
this code returns zero , so ISR 's never finished.
--- linux-2.6.24_cat/drivers/serial/sh-sci.c-old 2008-03-06 19:
40:13.000000000 +0900
+++ linux-2.6.24_cat/drivers/serial/sh-sci.c 2008-03-06 19:40:27.
000000000 +0900
@@ -412,12 +412,12 @@
defined(CONFIG_CPU_SUBTYPE_SH7785)
static inline int scif_txroom(struct uart_port *port)
{
- return SCIF_TXROOM_MAX - (sci_in(port, SCTFDR) & 0x7f);
+ return SCIF_TXROOM_MAX - (sci_in(port, SCTFDR) & 0xff);
}
static inline int scif_rxroom(struct uart_port *port)
{
- return sci_in(port, SCRFDR) & 0x7f;
+ return sci_in(port, SCRFDR) & 0xff;
}
#else
static inline int scif_txroom(struct uart_port *port)
next reply other threads:[~2008-03-10 9:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-10 9:13 Yutaro Ebihara [this message]
2008-03-11 3:43 ` SH7760,7780,7785 sh-sci.c bugfix Paul Mundt
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=24C8828EFB268Eebiharaml@si-linux.com \
--to=ebiharaml@si-linux.com \
--cc=linux-sh@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.