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: <a7061967-51b2-79f1-a8bb-b149da306c48@gmail.com>
Date:   Sun, 6 Sep 2020 02:35:02 +0300
From:   Dmitry Osipenko <digetx@...il.com>
To:     Thierry Reding <thierry.reding@...il.com>,
        Jonathan Hunter <jonathanh@...dia.com>,
        Laxman Dewangan <ldewangan@...dia.com>,
        Wolfram Sang <wsa@...-dreams.de>,
        Michał Mirosław <mirq-linux@...e.qmqm.pl>,
        Andy Shevchenko <andy.shevchenko@...il.com>
Cc:     linux-i2c@...r.kernel.org, linux-tegra@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 15/31] i2c: tegra: Remove bogus barrier()

05.09.2020 23:41, Dmitry Osipenko пишет:
> Apparently barrier() was intended to reduce possibility of racing
> with the interrupt handler, but driver's code evolved significantly
> and today's driver enables interrupt only when it waits for completion
> notification. Hence barrier() has no good use anymore, let's remove it.
> 
> Signed-off-by: Dmitry Osipenko <digetx@...il.com>
> ---
>  drivers/i2c/busses/i2c-tegra.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c
> index 33d37a40fa83..f69587ca163b 100644
> --- a/drivers/i2c/busses/i2c-tegra.c
> +++ b/drivers/i2c/busses/i2c-tegra.c
> @@ -600,7 +600,6 @@ static int tegra_i2c_fill_tx_fifo(struct tegra_i2c_dev *i2c_dev)
>  		i2c_dev->msg_buf_remaining = buf_remaining;
>  		i2c_dev->msg_buf = buf +
>  			words_to_transfer * BYTES_PER_FIFO_WORD;
> -		barrier();
>  
>  		i2c_writesl(i2c_dev, buf, I2C_TX_FIFO, words_to_transfer);
>  
> @@ -624,7 +623,6 @@ static int tegra_i2c_fill_tx_fifo(struct tegra_i2c_dev *i2c_dev)
>  		/* Again update before writing to FIFO to make sure isr sees. */
>  		i2c_dev->msg_buf_remaining = 0;
>  		i2c_dev->msg_buf = NULL;
> -		barrier();
>  
>  		i2c_writel(i2c_dev, val, I2C_TX_FIFO);
>  	}
> 

It just caught my eye that there is actually a comment there saying that
barrier() was intended to mitigate the racing with the ISR. Hence that
comment is outdated now and needs to be removed. I'll correct it in v5.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ