Linux Serial subsystem development
 help / color / mirror / Atom feed
* [bug report] serial: 8250: fix handle_irq locking
@ 2023-02-27  7:16 Dan Carpenter
  2023-02-27  8:52 ` Johan Hovold
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2023-02-27  7:16 UTC (permalink / raw)
  To: johan; +Cc: linux-serial

Hello Johan Hovold,

The patch 853a9ae29e97: "serial: 8250: fix handle_irq locking" from
Jul 14, 2021, leads to the following Smatch static checker warning:

drivers/tty/serial/8250/8250_fsl.c:84 fsl8250_handle_irq() warn: inconsistent returns 'flags'.
  Locked on  : 38,46
  Unlocked on: 84

drivers/tty/serial/8250/8250_fsl.c
    26  int fsl8250_handle_irq(struct uart_port *port)
    27  {
    28          unsigned long flags;
    29          u16 lsr, orig_lsr;
    30          unsigned int iir;
    31          struct uart_8250_port *up = up_to_u8250p(port);
    32  
    33          spin_lock_irqsave(&up->port.lock, flags);
                                                  ^^^^^
    34  
    35          iir = port->serial_in(port, UART_IIR);
    36          if (iir & UART_IIR_NO_INT) {
    37                  spin_unlock(&up->port.lock);
    38                  return 0;

Needs to enable IRQs again.  Same below etc.

    39          }
    40  
    41          /* This is the WAR; if last event was BRK, then read and return */
    42          if (unlikely(up->lsr_saved_flags & UART_LSR_BI)) {
    43                  up->lsr_saved_flags &= ~UART_LSR_BI;
    44                  port->serial_in(port, UART_RX);
    45                  spin_unlock(&up->port.lock);
    46                  return 1;
    47          }
    48  

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-02-27  9:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-27  7:16 [bug report] serial: 8250: fix handle_irq locking Dan Carpenter
2023-02-27  8:52 ` Johan Hovold

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox