* [PATCH] mpc52xx_uart: report serial errors to users
@ 2008-10-30 6:14 René Bürgel
2008-10-30 15:19 ` Grant Likely
0 siblings, 1 reply; 3+ messages in thread
From: René Bürgel @ 2008-10-30 6:14 UTC (permalink / raw)
To: linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 524 bytes --]
Hi! This patch adds the capability to the mpc52xx-uart to report framing
errors, parity errors, breaks and overruns to userspace. These values
may be requested in userspace by using the ioctl TIOCGICOUNT.
Signed-off-by: René Bürgel <r.buergel@unicontrol.de>
Kind regards, René Bürgel
--
René Bürgel
Software Engineer
Unicontrol Systemtechnik GmbH
OT Dittersbach
Sachsenburger Weg 34
09669 Frankenberg
Tel.: 03 72 06/ 88 73 - 19
Fax: 03 72 06/ 88 73 - 60
E-Mail: r.buergel@unicontrol.de
Internet: www.unicontrol.de
[-- Attachment #2: 121-mpc52xx_serial_icounter.patch --]
[-- Type: text/plain, Size: 735 bytes --]
--- drivers/serial/mpc52xx_uart.c 2008-08-07 15:55:43.000000000 +0200
+++ drivers/serial/mpc52xx_uart_orig.c 2008-09-11 13:19:12.000000000 +0200
@@ -752,10 +752,17 @@
if (status & MPC52xx_PSC_SR_RB) {
flag = TTY_BREAK;
uart_handle_break(port);
+ port->icount.brk++;
} else if (status & MPC52xx_PSC_SR_PE)
+ {
flag = TTY_PARITY;
+ port->icount.parity++;
+ }
else if (status & MPC52xx_PSC_SR_FE)
+ {
flag = TTY_FRAME;
+ port->icount.frame++;
+ }
/* Clear error condition */
out_8(&PSC(port)->command, MPC52xx_PSC_RST_ERR_STAT);
@@ -769,6 +776,7 @@
* affect the current character
*/
tty_insert_flip_char(tty, 0, TTY_OVERRUN);
+ port->icount.overrun++;
}
}
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] mpc52xx_uart: report serial errors to users
2008-10-30 6:14 [PATCH] mpc52xx_uart: report serial errors to users René Bürgel
@ 2008-10-30 15:19 ` Grant Likely
2008-11-03 9:35 ` [PATCH] mpc52xx_uart: report serial errors to users v2 René Bürgel
0 siblings, 1 reply; 3+ messages in thread
From: Grant Likely @ 2008-10-30 15:19 UTC (permalink / raw)
To: René Bürgel; +Cc: linuxppc-dev
On Thu, Oct 30, 2008 at 12:14 AM, Ren=E9 B=FCrgel <r.buergel@unicontrol.de>=
wrote:
> Hi! This patch adds the capability to the mpc52xx-uart to report framing
> errors, parity errors, breaks and overruns to userspace. These values may=
be
> requested in userspace by using the ioctl TIOCGICOUNT.
>
> Signed-off-by: Ren=E9 B=FCrgel <r.buergel@unicontrol.de>
Looks mostly good. A few comments below. Make sure you CC: me when
you send the next version (which goes for all 5xxx patches).
g.
>
> Kind regards, Ren=E9 B=FCrgel
>
> --
> Ren=E9 B=FCrgel
> Software Engineer
> Unicontrol Systemtechnik GmbH
> OT Dittersbach
> Sachsenburger Weg 34
> 09669 Frankenberg
>
> Tel.: 03 72 06/ 88 73 - 19
> Fax: 03 72 06/ 88 73 - 60
> E-Mail: r.buergel@unicontrol.de
> Internet: www.unicontrol.de
>
>
>
> --- drivers/serial/mpc52xx_uart.c 2008-08-07 15:55:43.000000000 +02=
00
> +++ drivers/serial/mpc52xx_uart_orig.c 2008-09-11 13:19:12.000000000 +02=
00
Patch is one level too shallow; for regular tools to work without
manual intervention you should be generating the patch from the
directory above the kernel source.
> @@ -752,10 +752,17 @@
> if (status & MPC52xx_PSC_SR_RB) {
> flag =3D TTY_BREAK;
> uart_handle_break(port);
> + port->icount.brk++;
> } else if (status & MPC52xx_PSC_SR_PE)
> + {
Please use '} else if () {' form
> flag =3D TTY_PARITY;
> + port->icount.parity++;
> + }
> else if (status & MPC52xx_PSC_SR_FE)
> + {
ditto
> flag =3D TTY_FRAME;
> + port->icount.frame++;
> + }
>
> /* Clear error condition */
> out_8(&PSC(port)->command, MPC52xx_PSC_RST_ERR_STA=
T);
> @@ -769,6 +776,7 @@
> * affect the current character
> */
> tty_insert_flip_char(tty, 0, TTY_OVERRUN);
> + port->icount.overrun++;
> }
> }
>
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
>
--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] mpc52xx_uart: report serial errors to users v2
2008-10-30 15:19 ` Grant Likely
@ 2008-11-03 9:35 ` René Bürgel
0 siblings, 0 replies; 3+ messages in thread
From: René Bürgel @ 2008-11-03 9:35 UTC (permalink / raw)
To: Grant Likely; +Cc: linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 987 bytes --]
I regenerated the patch with respect to your comments.
Grant Likely wrote:
> On Thu, Oct 30, 2008 at 12:14 AM, René Bürgel <r.buergel@unicontrol.de> wrote:
>
>> Hi! This patch adds the capability to the mpc52xx-uart to report framing
>> errors, parity errors, breaks and overruns to userspace. These values may be
>> requested in userspace by using the ioctl TIOCGICOUNT.
>>
>> Signed-off-by: René Bürgel <r.buergel@unicontrol.de>
>>
>
> Looks mostly good. A few comments below. Make sure you CC: me when
> you send the next version (which goes for all 5xxx patches).
>
> g.
>
--
René Bürgel
Software Engineer
Unicontrol Systemtechnik GmbH
OT Dittersbach
Sachsenburger Weg 34
09669 Frankenberg
Tel.: 03 72 06/ 88 73 - 19
Fax: 03 72 06/ 88 73 - 60
E-Mail: r.buergel@unicontrol.de
Internet: www.unicontrol.de
Unicontrol Systemtechnik GmbH
Geschäftsführer: Dipl.-Ing. Siegfried Heinze
Sitz der Gesellschaft: Frankenberg
Registergericht: Amtsgericht Chemnitz, HRB 15 475
[-- Attachment #2: 121-mpc52xx_serial_icounter.patch --]
[-- Type: text/plain, Size: 943 bytes --]
diff --git a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.c
index 6117d3d..2669aec 100644
--- a/drivers/serial/mpc52xx_uart.c
+++ b/drivers/serial/mpc52xx_uart.c
@@ -752,10 +752,15 @@ mpc52xx_uart_int_rx_chars(struct uart_port *port)
if (status & MPC52xx_PSC_SR_RB) {
flag = TTY_BREAK;
uart_handle_break(port);
- } else if (status & MPC52xx_PSC_SR_PE)
+ port->icount.brk++;
+ } else if (status & MPC52xx_PSC_SR_PE) {
flag = TTY_PARITY;
- else if (status & MPC52xx_PSC_SR_FE)
+ port->icount.parity++;
+ }
+ else if (status & MPC52xx_PSC_SR_FE) {
flag = TTY_FRAME;
+ port->icount.frame++;
+ }
/* Clear error condition */
out_8(&PSC(port)->command, MPC52xx_PSC_RST_ERR_STAT);
@@ -769,6 +774,7 @@ mpc52xx_uart_int_rx_chars(struct uart_port *port)
* affect the current character
*/
tty_insert_flip_char(tty, 0, TTY_OVERRUN);
+ port->icount.overrun++;
}
}
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-11-03 9:36 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-30 6:14 [PATCH] mpc52xx_uart: report serial errors to users René Bürgel
2008-10-30 15:19 ` Grant Likely
2008-11-03 9:35 ` [PATCH] mpc52xx_uart: report serial errors to users v2 René Bürgel
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.