diff mbox series

[6.1.y-cip] tty: serial: sh-sci: Fix sleeping in atomic context

Message ID 20230802141919.474558-1-biju.das.jz@bp.renesas.com (mailing list archive)
State Accepted
Delegated to: Nobuhiro Iwamatsu
Headers show
Series [6.1.y-cip] tty: serial: sh-sci: Fix sleeping in atomic context | expand

Commit Message

Biju Das Aug. 2, 2023, 2:19 p.m. UTC
commit 57c984f6fe20ebb9306d6e8c09b4f67fe63298c6 upstream.

Fix sleeping in atomic context warning as reported by the Smatch static
checker tool by replacing disable_irq->disable_irq_nosync.

Reported by: Dan Carpenter <dan.carpenter@linaro.org>

Fixes: 8749061be196 ("tty: serial: sh-sci: Add RZ/G2L SCIFA DMA tx support")
Cc: stable@kernel.org
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20230704154818.406913-1-biju.das.jz@bp.renesas.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
 drivers/tty/serial/sh-sci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Nobuhiro Iwamatsu Aug. 3, 2023, 4:45 a.m. UTC | #1
Hi Biju,

> -----Original Message-----
> From: Biju Das <biju.das.jz@bp.renesas.com>
> Sent: Wednesday, August 2, 2023 11:19 PM
> To: cip-dev@lists.cip-project.org; iwamatsu nobuhiro(岩松 信洋 ○DITC□
> DIT○OST) <nobuhiro1.iwamatsu@toshiba.co.jp>; Pavel Machek
> <pavel@denx.de>
> Cc: Biju Das <biju.das.jz@bp.renesas.com>; Lad Prabhakar
> <prabhakar.mahadev-lad.rj@bp.renesas.com>
> Subject: [PATCH 6.1.y-cip] tty: serial: sh-sci: Fix sleeping in atomic context
> 
> commit 57c984f6fe20ebb9306d6e8c09b4f67fe63298c6 upstream.
> 
> Fix sleeping in atomic context warning as reported by the Smatch static
> checker tool by replacing disable_irq->disable_irq_nosync.
> 
> Reported by: Dan Carpenter <dan.carpenter@linaro.org>
> 
> Fixes: 8749061be196 ("tty: serial: sh-sci: Add RZ/G2L SCIFA DMA tx support")
> Cc: stable@kernel.org
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Link:
> https://lore.kernel.org/r/20230704154818.406913-1-biju.das.jz@bp.renesas.c
> om
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> ---
>  drivers/tty/serial/sh-sci.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index
> 226b1d989314..9df182ec15e1 100644
> --- a/drivers/tty/serial/sh-sci.c
> +++ b/drivers/tty/serial/sh-sci.c
> @@ -590,7 +590,7 @@ static void sci_start_tx(struct uart_port *port)
>  	    dma_submit_error(s->cookie_tx)) {
>  		if (s->cfg->regtype == SCIx_RZ_SCIFA_REGTYPE)
>  			/* Switch irq from SCIF to DMA */
> -			disable_irq(s->irqs[SCIx_TXI_IRQ]);
> +			disable_irq_nosync(s->irqs[SCIx_TXI_IRQ]);
> 
>  		s->cookie_tx = 0;
>  		schedule_work(&s->work_tx);

LGTM. I can apply if there are no comments.

Reviewed-by: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>

Best regards,
  Nobuhiro
Pavel Machek Aug. 3, 2023, 8:12 a.m. UTC | #2
Hi!

> > Fix sleeping in atomic context warning as reported by the Smatch static
> > checker tool by replacing disable_irq->disable_irq_nosync.
> > 
> > Reported by: Dan Carpenter <dan.carpenter@linaro.org>

> LGTM. I can apply if there are no comments.
> 
> Reviewed-by: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>

Looks good to me, too (both 5.10 and 6.1). Go ahead!

Reviewed-by: Pavel Machek <pavel@denx.de>

Best regards,
								Pavel
Nobuhiro Iwamatsu Aug. 9, 2023, 2:07 a.m. UTC | #3
Hi all,

> -----Original Message-----
> From: cip-dev@lists.cip-project.org <cip-dev@lists.cip-project.org> On
> Behalf Of Pavel Machek
> Sent: Thursday, August 3, 2023 5:13 PM
> To: iwamatsu nobuhiro(岩松 信洋 ○DITC□DIT○OST)
> <nobuhiro1.iwamatsu@toshiba.co.jp>
> Cc: biju.das.jz@bp.renesas.com; cip-dev@lists.cip-project.org;
> pavel@denx.de; prabhakar.mahadev-lad.rj@bp.renesas.com
> Subject: Re: [cip-dev] [PATCH 6.1.y-cip] tty: serial: sh-sci: Fix sleeping in
> atomic context
> 
> Hi!
> 
> > > Fix sleeping in atomic context warning as reported by the Smatch
> > > static checker tool by replacing disable_irq->disable_irq_nosync.
> > >
> > > Reported by: Dan Carpenter <dan.carpenter@linaro.org>
> 
> > LGTM. I can apply if there are no comments.
> >
> > Reviewed-by: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>
> 
> Looks good to me, too (both 5.10 and 6.1). Go ahead!
> 
> Reviewed-by: Pavel Machek <pavel@denx.de>
> 

Thank you, both applied.

Best regards,
  Nobuhiro
diff mbox series

Patch

diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index 226b1d989314..9df182ec15e1 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -590,7 +590,7 @@  static void sci_start_tx(struct uart_port *port)
 	    dma_submit_error(s->cookie_tx)) {
 		if (s->cfg->regtype == SCIx_RZ_SCIFA_REGTYPE)
 			/* Switch irq from SCIF to DMA */
-			disable_irq(s->irqs[SCIx_TXI_IRQ]);
+			disable_irq_nosync(s->irqs[SCIx_TXI_IRQ]);
 
 		s->cookie_tx = 0;
 		schedule_work(&s->work_tx);