aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/dz.c
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@linux-mips.org>2008-02-07 03:15:07 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-07 11:42:24 -0500
commitdbab81281d3227af3d8a04aa748c5f41befa5d43 (patch)
tree2e496280d54012ea2de8a64e98c8a4a41a688d56 /drivers/serial/dz.c
parentd4dd1467f2053b31e2fbb58763ff9d1e0399af45 (diff)
dz: always check if it is safe to console_putchar()
Polled transmission is tricky enough with the DZ11 design. While "loop" is set to a high value, conceptually you are not allowed to transmit without checking whether the device offers the right transmission line (yes, it is the device that selects the line -- the driver has no control over it other than disabling the transmitter offered if it is the wrong one), so the loop has to be run at least once. Well, the '1977 or PDP11 view of how serial lines should be handled... Except that the serial interface used to be quite an impressive board back then rather than chip. Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org> Cc: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/serial/dz.c')
-rw-r--r--drivers/serial/dz.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/serial/dz.c b/drivers/serial/dz.c
index bbae5a220219..e1a2e413eb7d 100644
--- a/drivers/serial/dz.c
+++ b/drivers/serial/dz.c
@@ -685,7 +685,7 @@ static void dz_console_putchar(struct uart_port *uport, int ch)
685 iob(); 685 iob();
686 spin_unlock_irqrestore(&dport->port.lock, flags); 686 spin_unlock_irqrestore(&dport->port.lock, flags);
687 687
688 while (loops--) { 688 do {
689 trdy = dz_in(dport, DZ_CSR); 689 trdy = dz_in(dport, DZ_CSR);
690 if (!(trdy & DZ_TRDY)) 690 if (!(trdy & DZ_TRDY))
691 continue; 691 continue;
@@ -696,7 +696,7 @@ static void dz_console_putchar(struct uart_port *uport, int ch)
696 dz_out(dport, DZ_TCR, mask); 696 dz_out(dport, DZ_TCR, mask);
697 iob(); 697 iob();
698 udelay(2); 698 udelay(2);
699 } 699 } while (loops--);
700 700
701 if (loops) /* Cannot send otherwise. */ 701 if (loops) /* Cannot send otherwise. */
702 dz_out(dport, DZ_TDR, ch); 702 dz_out(dport, DZ_TDR, ch);