Title: [7029] trunk/drivers/serial: Fix bug[#5145] Walk around sport rx 32-bit reading underflow error.
Revision
7029
Author
sonicz
Date
2009-07-17 05:32:53 -0500 (Fri, 17 Jul 2009)

Log Message

Fix bug[#5145] Walk around sport rx 32-bit reading underflow error.

Disable local interrupt to walk around the fake RX underflow error
when do 32-bit reading from RX fifois interrupted by other interrupt.
This is a possible hardware anomaly. After it is logged officially,
the official anomaly id should be listed bellow.

16-bit reading is not affected.

Modified Paths

Diff

Modified: trunk/drivers/serial/bfin_sport_uart.c (7028 => 7029)


--- trunk/drivers/serial/bfin_sport_uart.c	2009-07-17 10:30:16 UTC (rev 7028)
+++ trunk/drivers/serial/bfin_sport_uart.c	2009-07-17 10:32:53 UTC (rev 7029)
@@ -419,7 +419,6 @@
 
 	switch (termios->c_cflag & CSIZE) {
 	case CS8:
-		pr_warning("use of 8bit mode often results in sport RX underflows\n");
 		up->csize = 8;
 		break;
 	case CS7:
@@ -437,8 +436,6 @@
 
 	if (termios->c_cflag & CSTOPB) {
 		up->stopb = 1;
-		if (up->csize == 8)
-			pr_warning("2 stop bits and 7/8bit mode often results in sport RX underflows\n");
 	}
 	if (termios->c_cflag & PARENB) {
 		pr_warning("PAREN bits is not supported yet\n");

Modified: trunk/drivers/serial/bfin_sport_uart.h (7028 => 7029)


--- trunk/drivers/serial/bfin_sport_uart.h	2009-07-17 10:30:16 UTC (rev 7028)
+++ trunk/drivers/serial/bfin_sport_uart.h	2009-07-17 10:32:53 UTC (rev 7029)
@@ -43,7 +43,20 @@
 #define SPORT_GET_TFSDIV(sport)		bfin_read16(((sport)->port.membase + OFFSET_TFSDIV))
 #define SPORT_GET_TX(sport)		bfin_read16(((sport)->port.membase + OFFSET_TX))
 #define SPORT_GET_RX(sport)		bfin_read16(((sport)->port.membase + OFFSET_RX))
-#define SPORT_GET_RX32(sport)		bfin_read32(((sport)->port.membase + OFFSET_RX))
+/*
+ * Disable local interrupt to walk around the fake RX underflow error
+ * when do 32-bit reading from RX fifois interrupted by other interrupt.
+ * This is a possible hardware anomaly. After it is logged officially,
+ * the official anomaly id should be listed bellow.
+ */
+#define SPORT_GET_RX32(sport)	\
+({				\
+	unsigned int __ret;		\
+	local_irq_disable();	\
+	__ret = bfin_read32(((sport)->port.membase + OFFSET_RX));	\
+	local_irq_enable();	\
+	__ret;			\
+})
 #define SPORT_GET_RCR1(sport)		bfin_read16(((sport)->port.membase + OFFSET_RCR1))
 #define SPORT_GET_RCR2(sport)		bfin_read16(((sport)->port.membase + OFFSET_RCR2))
 #define SPORT_GET_RCLKDIV(sport)	bfin_read16(((sport)->port.membase + OFFSET_RCLKDIV))
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to