[bug report] tty: serial: sh-sci: Add RZ/G2L SCIFA DMA tx support

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

 



Hello Biju Das,

The patch 8749061be196: "tty: serial: sh-sci: Add RZ/G2L SCIFA DMA tx
support" from Apr 12, 2023, leads to the following Smatch static
checker warning:

	drivers/tty/serial/sh-sci.c:593 sci_start_tx()
	warn: sleeping in atomic context

drivers/tty/serial/sh-sci.c
    573 static void sci_start_tx(struct uart_port *port)
    574 {
    575         struct sci_port *s = to_sci_port(port);
    576         unsigned short ctrl;
    577 
    578 #ifdef CONFIG_SERIAL_SH_SCI_DMA
    579         if (port->type == PORT_SCIFA || port->type == PORT_SCIFB) {
    580                 u16 new, scr = serial_port_in(port, SCSCR);
    581                 if (s->chan_tx)
    582                         new = scr | SCSCR_TDRQE;
    583                 else
    584                         new = scr & ~SCSCR_TDRQE;
    585                 if (new != scr)
    586                         serial_port_out(port, SCSCR, new);
    587         }
    588 
    589         if (s->chan_tx && !uart_circ_empty(&s->port.state->xmit) &&
    590             dma_submit_error(s->cookie_tx)) {
    591                 if (s->cfg->regtype == SCIx_RZ_SCIFA_REGTYPE)
    592                         /* Switch irq from SCIF to DMA */
--> 593                         disable_irq(s->irqs[SCIx_TXI_IRQ]);

disable_irq() is a might_sleep() function so it can't be called while
holding a spinlock, but the sci_dma_tx_work_fn() function is holding a
spinlock when it calls sci_start_tx().

    594 
    595                 s->cookie_tx = 0;
    596                 schedule_work(&s->work_tx);
    597         }
    598 #endif


regards,
dan carpenter



[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