* mpc52xx_uart.c - Port Overruns
@ 2009-07-03 1:23 Damien Dusha
2009-07-03 11:42 ` Detlev Zundel
0 siblings, 1 reply; 2+ messages in thread
From: Damien Dusha @ 2009-07-03 1:23 UTC (permalink / raw)
To: Linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 1865 bytes --]
Dear List,
I am writing to ask about some particular behaviour we saw with the MPC5121
PSC UART, using the 2.6.24 Freescle BSP kernel, although examining the code
of the linux-2.6-denx tree (git commit
7cb16ec2590815a67e5fb5c8994ead536613d922), the behavior is almost identical
except for incrementing an overrrun counter.
In particular, yesterday we observed a port overrun (from the overrun flags
being set when looking with the BDI) on one of our PSC Ports. When it was
observed, we saw that every second byte coming from the serial port was
0x00.
Examining the interrupt routine of the mpc52xx_uart.c:
static inline int
mpc52xx_uart_int_rx_chars(struct uart_port *port)
{
<snip>
tty_insert_flip_char(tty, ch, flag);
if (status & MPC52xx_PSC_SR_OE) {
/*
* Overrun is special, since it's
* reported immediately, and doesn't
* affect the current character
*/
tty_insert_flip_char(tty, 0, TTY_OVERRUN);
port->icount.overrun++;
}
<snip>
}
So, from my deduction, it is inserting a 0x00 for every overrun error that
occurs, however, the overrun flag is never cleared. Therefore fro every
byte that is received, the overrup flag is still set and therefore we're
observing the 0x00 being inserted for every "real" byte coming into the port
Is there a particular reason why the overrun flag is not cleared? That is,
parity, framing and breaks are acknowledged with:
/* Clear error condition */
out_8(&PSC(port)->command, MPC52xx_PSC_RST_ERR_STAT);
But the overrun isn't cleared. Is there are particular reason why? Is
userspace meant to detect this condition and reset the port? Was it
automatically cleared on the 5200 when reading the status, but the 5121 is
exhibiting strange behavior?
Best regards,
Damien Dusha.
[-- Attachment #2: Type: text/html, Size: 2075 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: mpc52xx_uart.c - Port Overruns
2009-07-03 1:23 mpc52xx_uart.c - Port Overruns Damien Dusha
@ 2009-07-03 11:42 ` Detlev Zundel
0 siblings, 0 replies; 2+ messages in thread
From: Detlev Zundel @ 2009-07-03 11:42 UTC (permalink / raw)
To: linuxppc-dev
Hi Damien,
> I am writing to ask about some particular behaviour we saw with the MPC5121 PSC
> UART, using the 2.6.24 Freescle BSP kernel, although examining the code of the
> linux-2.6-denx tree (git commit 7cb16ec2590815a67e5fb5c8994ead536613d922), the
> behavior is almost identical except for incrementing an overrrun counter.
>
> In particular, yesterday we observed a port overrun (from the overrun flags
> being set when looking with the BDI) on one of our PSC Ports. When it was
> observed, we saw that every second byte coming from the serial port was 0x00.
>
> Examining the interrupt routine of the mpc52xx_uart.c:
>
> static inline int
> mpc52xx_uart_int_rx_chars(struct uart_port *port)
> {
> <snip>
> tty_insert_flip_char(tty, ch, flag);
> if (status & MPC52xx_PSC_SR_OE) {
> /*
> * Overrun is special, since it's
> * reported immediately, and doesn't
> * affect the current character
> */
> tty_insert_flip_char(tty, 0, TTY_OVERRUN);
> port->icount.overrun++;
> }
> <snip>
> }
>
> So, from my deduction, it is inserting a 0x00 for every overrun error that
> occurs, however, the overrun flag is never cleared. Therefore fro every byte
> that is received, the overrup flag is still set and therefore we're observing
> the 0x00 being inserted for every "real" byte coming into the port
>
> Is there a particular reason why the overrun flag is not cleared? That is,
> parity, framing and breaks are acknowledged with:
>
> /* Clear error condition */
> out_8(&PSC(port)->command, MPC52xx_PSC_RST_ERR_STAT);
>
> But the overrun isn't cleared. Is there are particular reason why? Is
> userspace meant to detect this condition and reset the port? Was it
> automatically cleared on the 5200 when reading the status, but the 5121 is
> exhibiting strange behavior?
This is likely only forgotten in the driver. I remember fixing this in
our 2.4 kernel tree a long time ago[1].
Cheers
Detlev
[1] http://git.denx.de/?p=linuxppc_2_4_devel.git;a=commitdiff;h=00097a16641865b88568b807c9680b50c74bda84
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu@denx.de
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-07-03 11:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-03 1:23 mpc52xx_uart.c - Port Overruns Damien Dusha
2009-07-03 11:42 ` Detlev Zundel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox