diff options
author | Sonic Zhang <sonic.zhang@analog.com> | 2010-03-09 12:25:28 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-05-21 12:34:27 -0400 |
commit | a5a420d207df40226afbf828c12bd9b4c6e058ef (patch) | |
tree | af4d91ce3f0f65728bbf6a7da86a5ee5e867292f /drivers/serial | |
parent | d7dbf4ffee1c7a17e2e5b5f01efe76fbd1671db6 (diff) |
serial: bfin_sport_uart: work around anomaly 05000473 (make 32bit fifo read atomic)
We cannot let a 32-bit RX FIFO read be interrupted otherwise a fake RX
underflow error might be generated.
URL: http://blackfin.uclinux.org/gf/tracker/5145
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/serial')
-rw-r--r-- | drivers/serial/bfin_sport_uart.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/drivers/serial/bfin_sport_uart.h b/drivers/serial/bfin_sport_uart.h index abe03614e4df..9791fcc80a74 100644 --- a/drivers/serial/bfin_sport_uart.h +++ b/drivers/serial/bfin_sport_uart.h | |||
@@ -37,7 +37,21 @@ | |||
37 | #define SPORT_GET_TFSDIV(sport) bfin_read16(((sport)->port.membase + OFFSET_TFSDIV)) | 37 | #define SPORT_GET_TFSDIV(sport) bfin_read16(((sport)->port.membase + OFFSET_TFSDIV)) |
38 | #define SPORT_GET_TX(sport) bfin_read16(((sport)->port.membase + OFFSET_TX)) | 38 | #define SPORT_GET_TX(sport) bfin_read16(((sport)->port.membase + OFFSET_TX)) |
39 | #define SPORT_GET_RX(sport) bfin_read16(((sport)->port.membase + OFFSET_RX)) | 39 | #define SPORT_GET_RX(sport) bfin_read16(((sport)->port.membase + OFFSET_RX)) |
40 | #define SPORT_GET_RX32(sport) bfin_read32(((sport)->port.membase + OFFSET_RX)) | 40 | /* |
41 | * If another interrupt fires while doing a 32-bit read from RX FIFO, | ||
42 | * a fake RX underflow error will be generated. So disable interrupts | ||
43 | * to prevent interruption while reading the FIFO. | ||
44 | */ | ||
45 | #define SPORT_GET_RX32(sport) \ | ||
46 | ({ \ | ||
47 | unsigned int __ret; \ | ||
48 | if (ANOMALY_05000473) \ | ||
49 | local_irq_disable(); \ | ||
50 | __ret = bfin_read32((sport)->port.membase + OFFSET_RX); \ | ||
51 | if (ANOMALY_05000473) \ | ||
52 | local_irq_enable(); \ | ||
53 | __ret; \ | ||
54 | }) | ||
41 | #define SPORT_GET_RCR1(sport) bfin_read16(((sport)->port.membase + OFFSET_RCR1)) | 55 | #define SPORT_GET_RCR1(sport) bfin_read16(((sport)->port.membase + OFFSET_RCR1)) |
42 | #define SPORT_GET_RCR2(sport) bfin_read16(((sport)->port.membase + OFFSET_RCR2)) | 56 | #define SPORT_GET_RCR2(sport) bfin_read16(((sport)->port.membase + OFFSET_RCR2)) |
43 | #define SPORT_GET_RCLKDIV(sport) bfin_read16(((sport)->port.membase + OFFSET_RCLKDIV)) | 57 | #define SPORT_GET_RCLKDIV(sport) bfin_read16(((sport)->port.membase + OFFSET_RCLKDIV)) |