RE: [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 Dan Carpenter,

Thanks for the feedback.

> -----Original Message-----
> From: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> Sent: Tuesday, July 4, 2023 2:20 PM
> To: Biju Das <biju.das.jz@xxxxxxxxxxxxxx>
> Cc: linux-serial@xxxxxxxxxxxxxxx; linux-renesas-soc@xxxxxxxxxxxxxxx
> Subject: [bug report] tty: serial: sh-sci: Add RZ/G2L SCIFA DMA tx
> support
> 
> 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().

Ok, will change disable_irq->disable_irq_nosync, so that it can be called from atomic context.

Cheers,
Biju                  

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




[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux