lkml.org 
[lkml]   [2022]   [Jun]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/3] serial: 8250_dw: Take port lock while accessing LSR
On Wed, Jun 15, 2022 at 12:06:50PM +0300, Ilpo Järvinen wrote:
> Accessing LSR requires port lock because it mutates lsr_saved_flags
> in serial_lsr_in().

I got this as patch 2/3, where are the 1/3 and 3/3?

...

> @@ -266,7 +266,10 @@ static int dw8250_handle_irq(struct uart_port *p)
>
> /* Manually stop the Rx DMA transfer when acting as flow controller */
> if (quirks & DW_UART_QUIRK_IS_DMA_FC && up->dma && up->dma->rx_running && rx_timeout) {
> + spin_lock_irqsave(&p->lock, flags);
> status = serial_lsr_in(up);
> + spin_unlock_irqrestore(&p->lock, flags);

This reminds me the question, why do we need to save flags here? Aren't we in
IRQ context already? (Perhaps another patch might be issued.)

--
With Best Regards,
Andy Shevchenko


\
 
 \ /
  Last update: 2022-06-15 12:08    [W:0.060 / U:0.260 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site