summaryrefslogtreecommitdiff
path: root/src/drivers/uart/uart8250mem.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/drivers/uart/uart8250mem.c')
-rw-r--r--src/drivers/uart/uart8250mem.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/drivers/uart/uart8250mem.c b/src/drivers/uart/uart8250mem.c
index 4e53a92a46..a142cb111a 100644
--- a/src/drivers/uart/uart8250mem.c
+++ b/src/drivers/uart/uart8250mem.c
@@ -82,8 +82,10 @@ static int uart8250_mem_can_rx_byte(void *base)
static unsigned char uart8250_mem_rx_byte(void *base)
{
unsigned long int i = SINGLE_CHAR_TIMEOUT;
- while (i-- && !uart8250_mem_can_rx_byte(base))
+ while (i && !uart8250_mem_can_rx_byte(base)) {
udelay(1);
+ i--;
+ }
if (i)
return uart8250_read(base, UART8250_RBR);
else