diff options
author | David S. Miller <davem@sunset.davemloft.net> | 2006-02-18 19:32:22 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-03-20 04:13:38 -0500 |
commit | 843dfb4d99c41116601694f314092b3b6c4511f4 (patch) | |
tree | 44a5b1d757bb796466d0746d13d9fa4c49ad459a | |
parent | 11fc04e46a892563d0a9bb98560339f1672e3213 (diff) |
[SPARC64] sunhv: Fix locking in sunhv_start_tx()
Caller takes the lock already.
Also, fixup the poll loop in sunhv_break_ctl(). Just
like in console write, we udelay(2) and use a loop
limit of 1000000 iterations.
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/serial/sunhv.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/serial/sunhv.c b/drivers/serial/sunhv.c index 378a1784ce9a..8537839f9abb 100644 --- a/drivers/serial/sunhv.c +++ b/drivers/serial/sunhv.c | |||
@@ -210,9 +210,6 @@ static void sunhv_stop_tx(struct uart_port *port) | |||
210 | static void sunhv_start_tx(struct uart_port *port) | 210 | static void sunhv_start_tx(struct uart_port *port) |
211 | { | 211 | { |
212 | struct circ_buf *xmit = &port->info->xmit; | 212 | struct circ_buf *xmit = &port->info->xmit; |
213 | unsigned long flags; | ||
214 | |||
215 | spin_lock_irqsave(&port->lock, flags); | ||
216 | 213 | ||
217 | while (!uart_circ_empty(xmit)) { | 214 | while (!uart_circ_empty(xmit)) { |
218 | long status = hypervisor_con_putchar(xmit->buf[xmit->tail]); | 215 | long status = hypervisor_con_putchar(xmit->buf[xmit->tail]); |
@@ -223,8 +220,6 @@ static void sunhv_start_tx(struct uart_port *port) | |||
223 | xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); | 220 | xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); |
224 | port->icount.tx++; | 221 | port->icount.tx++; |
225 | } | 222 | } |
226 | |||
227 | spin_unlock_irqrestore(&port->lock, flags); | ||
228 | } | 223 | } |
229 | 224 | ||
230 | /* port->lock is not held. */ | 225 | /* port->lock is not held. */ |
@@ -259,7 +254,7 @@ static void sunhv_break_ctl(struct uart_port *port, int break_state) | |||
259 | { | 254 | { |
260 | if (break_state) { | 255 | if (break_state) { |
261 | unsigned long flags; | 256 | unsigned long flags; |
262 | int limit = 10000; | 257 | int limit = 1000000; |
263 | 258 | ||
264 | spin_lock_irqsave(&port->lock, flags); | 259 | spin_lock_irqsave(&port->lock, flags); |
265 | 260 | ||
@@ -267,6 +262,7 @@ static void sunhv_break_ctl(struct uart_port *port, int break_state) | |||
267 | long status = hypervisor_con_putchar(CON_BREAK); | 262 | long status = hypervisor_con_putchar(CON_BREAK); |
268 | if (status == HV_EOK) | 263 | if (status == HV_EOK) |
269 | break; | 264 | break; |
265 | udelay(2); | ||
270 | } | 266 | } |
271 | 267 | ||
272 | spin_unlock_irqrestore(&port->lock, flags); | 268 | spin_unlock_irqrestore(&port->lock, flags); |