lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75VcopwQgUQVF_uGwddzioTJqddwuft11+HBwH25e1kQEyw@mail.gmail.com>
Date:   Mon, 15 Mar 2021 20:16:00 +0200
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Krzysztof Kozlowski <krzysztof.kozlowski@...onical.com>
Cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Jiri Slaby <jirislaby@...nel.org>,
        linux-arm Mailing List <linux-arm-kernel@...ts.infradead.org>,
        Linux Samsung SOC <linux-samsung-soc@...r.kernel.org>,
        "open list:SERIAL DRIVERS" <linux-serial@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Hector Martin <marcan@...can.st>,
        Arnd Bergmann <arnd@...nel.org>
Subject: Re: [PATCH] tty: serial: samsung_tty: remove spinlock flags in
 interrupt handlers

On Mon, Mar 15, 2021 at 8:12 PM Krzysztof Kozlowski
<krzysztof.kozlowski@...onical.com> wrote:
>
> Since interrupt handler is called with disabled local interrupts, there
> is no need to use the spinlock primitives disabling interrupts as well.

Thanks!
Reviewed-by: Andy Shevchenko <andy.shevchenko@...il.com>

> Suggested-by: Andy Shevchenko <andy.shevchenko@...il.com>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@...onical.com>
> ---
>  drivers/tty/serial/samsung_tty.c | 15 ++++++---------
>  1 file changed, 6 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c
> index 80df842bf4c7..d9e4b67a12a0 100644
> --- a/drivers/tty/serial/samsung_tty.c
> +++ b/drivers/tty/serial/samsung_tty.c
> @@ -715,13 +715,12 @@ static irqreturn_t s3c24xx_serial_rx_chars_dma(void *dev_id)
>         struct s3c24xx_uart_dma *dma = ourport->dma;
>         struct tty_struct *tty = tty_port_tty_get(&ourport->port.state->port);
>         struct tty_port *t = &port->state->port;
> -       unsigned long flags;
>         struct dma_tx_state state;
>
>         utrstat = rd_regl(port, S3C2410_UTRSTAT);
>         rd_regl(port, S3C2410_UFSTAT);
>
> -       spin_lock_irqsave(&port->lock, flags);
> +       spin_lock(&port->lock);
>
>         if (!(utrstat & S3C2410_UTRSTAT_TIMEOUT)) {
>                 s3c64xx_start_rx_dma(ourport);
> @@ -750,7 +749,7 @@ static irqreturn_t s3c24xx_serial_rx_chars_dma(void *dev_id)
>         wr_regl(port, S3C2410_UTRSTAT, S3C2410_UTRSTAT_TIMEOUT);
>
>  finish:
> -       spin_unlock_irqrestore(&port->lock, flags);
> +       spin_unlock(&port->lock);
>
>         return IRQ_HANDLED;
>  }
> @@ -846,11 +845,10 @@ static irqreturn_t s3c24xx_serial_rx_chars_pio(void *dev_id)
>  {
>         struct s3c24xx_uart_port *ourport = dev_id;
>         struct uart_port *port = &ourport->port;
> -       unsigned long flags;
>
> -       spin_lock_irqsave(&port->lock, flags);
> +       spin_lock(&port->lock);
>         s3c24xx_serial_rx_drain_fifo(ourport);
> -       spin_unlock_irqrestore(&port->lock, flags);
> +       spin_unlock(&port->lock);
>
>         return IRQ_HANDLED;
>  }
> @@ -934,13 +932,12 @@ static irqreturn_t s3c24xx_serial_tx_irq(int irq, void *id)
>  {
>         struct s3c24xx_uart_port *ourport = id;
>         struct uart_port *port = &ourport->port;
> -       unsigned long flags;
>
> -       spin_lock_irqsave(&port->lock, flags);
> +       spin_lock(&port->lock);
>
>         s3c24xx_serial_tx_chars(ourport);
>
> -       spin_unlock_irqrestore(&port->lock, flags);
> +       spin_unlock(&port->lock);
>         return IRQ_HANDLED;
>  }
>
> --
> 2.25.1
>


-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ