Re: [PATCH] serial: pxa: hold port.lock when reporting modem line changes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dmitry Eremin-Solenikov <dbaryshkov@xxxxxxxxx> writes:

> diff --git a/drivers/tty/serial/pxa.c b/drivers/tty/serial/pxa.c
> index 2f4c329..b59dcb1 100644
> --- a/drivers/tty/serial/pxa.c
> +++ b/drivers/tty/serial/pxa.c
> @@ -223,6 +223,7 @@ static void serial_pxa_start_tx(struct uart_port *port)
>  	}
>  }
>  
> +/* should hold up->port.lock */
>  static inline void check_modem_status(struct uart_pxa_port *up)
>  {
>  	int status;
> @@ -258,7 +259,9 @@ static inline irqreturn_t serial_pxa_irq(int irq, void
>  *dev_id)
The spin_lock() should be here I think. As the spinlock price has to be paid,
let's have the whole function under spinlock().

>  	lsr = serial_in(up, UART_LSR);
>  	if (lsr & UART_LSR_DR)
>  		receive_chars(up, &lsr);
> +	spin_lock(&up->port.lock);
>  	check_modem_status(up);
> +	spin_unlock(&up->port.lock);
>  	if (lsr & UART_LSR_THRE)
>  		transmit_chars(up);
The spin_unlock() should be there, after transmission IMO.

Cheers.

-- 
Robert
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux