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: <c849eb7a-d019-b88e-583a-78e1eba7624c@microchip.com>
Date:   Tue, 29 Jun 2021 17:01:57 +0000
From:   <Dan.Sneddon@...rochip.com>
To:     <broonie@...nel.org>, <Dan.Sneddon@...rochip.com>
CC:     <linux-spi@...r.kernel.org>,
        <linux-arm-kernel@...ts.infradead.org>,
        <linux-kernel@...r.kernel.org>, <Tudor.Ambarus@...rochip.com>,
        <Nicolas.Ferre@...rochip.com>, <alexandre.belloni@...tlin.com>,
        <Ludovic.Desroches@...rochip.com>
Subject: Re: [PATCH] spi: atmel: Fix CS and initialization bug

On 6/29/21 9:47 AM, Mark Brown wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
 > On Tue, Jun 29, 2021 at 09:29:14AM -0700, Dan Sneddon wrote:
 >
 >> spi_setup won't get programmed into the hardware.  This patch makes
 >> sure the cs_activate call is made even with a gpio controlled chip
 >> select.
 >
 >In what way does it do that?  I can't tell what the patch is supposed >to
 >do.

The SPI_MASTER_GPIO_SS flag has to be set so that the set_cs function 
gets called even when using gpio cs pins.

 >
 >> -	enable =3D (!!(spi->mode & SPI_CS_HIGH) =3D=3D enable);
 >> =20
 >> -	if (enable) {
 >> +	if ((enable && (spi->mode & SPI_CS_HIGH))
 >> +			|| (!enable && !(spi->mode & SPI_CS_HIGH))) {
 >
 >This looks especially suspicious.
It's due to the fact that the spi core tells set_cs if the cs should be 
high or low, not active or disabled.  This logic is to convert from 
high/low to active/disabled.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ