Skip to contentSkip to conversation

mpc52xx_uart: report serial errors to users

PATCH In review René Bürgel 2 participants 3 messages Oct 30, 2008 – Nov 3, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mpc52xx_uart: report serial errors to users

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.

Kind regards, René Bürgel

Signature · 11 lines
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: [email protected]
Internet: www.unicontrol.de
serial/mpc52xx_uart_orig.c renamed from serial/mpc52xx_uart.c +8 -0
@@ -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++;
 		}
 	}
 
#1 lore raw
Quoted 2 lines · On Thu, Oct 30, 2008 at 12:14 AM, Ren=E9 B=FCrgel <[email protected]>=…

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

Quoted 3 lines

requested in userspace by using the ioctl TIOCGICOUNT.

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.

Quoted 11 lines

Kind regards, Ren=E9 B=FCrgel

--
Ren=E9 B=FCrgel
Software Engineer
Unicontrol Systemtechnik GmbH
OT Dittersbach
Sachsenburger Weg 34
09669 Frankenberg

Quoted 8 lines

Tel.: 03 72 06/ 88 73 - 19
Fax: 03 72 06/ 88 73 - 60
E-Mail: [email protected]
Internet: www.unicontrol.de

--- drivers/serial/mpc52xx_uart.c 2008-08-07 15:55:43.000000000 +02=

00

Quoted 1 line

+++ 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.

serial/mpc52xx_uart_orig.c line 757

Quoted 7 lines
serial/mpc52xx_uart_orig.c renamed from serial/mpc52xx_uart.c +2 -0
@@ -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

serial/mpc52xx_uart_orig.c line 762

Quoted 5 lines
serial/mpc52xx_uart_orig.c renamed from serial/mpc52xx_uart.c +3 -0
                               flag =3D TTY_PARITY;
+                               port->icount.parity++;
+                       }
                       else if (status & MPC52xx_PSC_SR_FE)
+                       {

ditto

serial/mpc52xx_uart_orig.c

Quoted 6 lines
serial/mpc52xx_uart_orig.c renamed from serial/mpc52xx_uart.c +2 -0
                               flag =3D TTY_FRAME;
+                               port->icount.frame++;
+                       }
 
                       /* Clear error condition */
                       out_8(&PSC(port)->command, MPC52xx_PSC_RST_ERR_STA=

T);

Quoted 9 lines
serial/mpc52xx_uart_orig.c renamed from serial/mpc52xx_uart.c +1 -0
@@ -769,6 +776,7 @@
                        * affect the current character
                        */
                       tty_insert_flip_char(tty, 0, TTY_OVERRUN);
+                       port->icount.overrun++;
               }
       }
 
Quoted 5 lines

_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://ozlabs.org/mailman/listinfo/linuxppc-dev

--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

#2 lore raw

Re: [PATCH] mpc52xx_uart: report serial errors to users v2

I regenerated the patch with respect to your comments.

Quoted 14 lines · Grant Likely
Quoted 6 lines · René Bürgel

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.

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.

Signature · 16 lines
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: [email protected]
Internet: www.unicontrol.de

Unicontrol Systemtechnik GmbH
Geschäftsführer: Dipl.-Ing. Siegfried Heinze
Sitz der Gesellschaft: Frankenberg
Registergericht: Amtsgericht Chemnitz, HRB 15 475
drivers/serial/mpc52xx_uart.c +8 -2
index 6117d3d..2669aec 100644
@@ -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++;
 		}
 	}