mirror of
https://github.com/fail0verflow/switch-linux.git
synced 2025-05-04 02:34:21 -04:00
[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>
This commit is contained in:
parent
11fc04e46a
commit
843dfb4d99
1 changed files with 2 additions and 6 deletions
|
@ -210,9 +210,6 @@ static void sunhv_stop_tx(struct uart_port *port)
|
||||||
static void sunhv_start_tx(struct uart_port *port)
|
static void sunhv_start_tx(struct uart_port *port)
|
||||||
{
|
{
|
||||||
struct circ_buf *xmit = &port->info->xmit;
|
struct circ_buf *xmit = &port->info->xmit;
|
||||||
unsigned long flags;
|
|
||||||
|
|
||||||
spin_lock_irqsave(&port->lock, flags);
|
|
||||||
|
|
||||||
while (!uart_circ_empty(xmit)) {
|
while (!uart_circ_empty(xmit)) {
|
||||||
long status = hypervisor_con_putchar(xmit->buf[xmit->tail]);
|
long status = hypervisor_con_putchar(xmit->buf[xmit->tail]);
|
||||||
|
@ -223,8 +220,6 @@ static void sunhv_start_tx(struct uart_port *port)
|
||||||
xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
|
xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
|
||||||
port->icount.tx++;
|
port->icount.tx++;
|
||||||
}
|
}
|
||||||
|
|
||||||
spin_unlock_irqrestore(&port->lock, flags);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* port->lock is not held. */
|
/* port->lock is not held. */
|
||||||
|
@ -259,7 +254,7 @@ static void sunhv_break_ctl(struct uart_port *port, int break_state)
|
||||||
{
|
{
|
||||||
if (break_state) {
|
if (break_state) {
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
int limit = 10000;
|
int limit = 1000000;
|
||||||
|
|
||||||
spin_lock_irqsave(&port->lock, flags);
|
spin_lock_irqsave(&port->lock, flags);
|
||||||
|
|
||||||
|
@ -267,6 +262,7 @@ static void sunhv_break_ctl(struct uart_port *port, int break_state)
|
||||||
long status = hypervisor_con_putchar(CON_BREAK);
|
long status = hypervisor_con_putchar(CON_BREAK);
|
||||||
if (status == HV_EOK)
|
if (status == HV_EOK)
|
||||||
break;
|
break;
|
||||||
|
udelay(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
spin_unlock_irqrestore(&port->lock, flags);
|
spin_unlock_irqrestore(&port->lock, flags);
|
||||||
|
|
Loading…
Add table
Reference in a new issue