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: <PH8PR12MB6675A433C8B129AA96B5C853E17E9@PH8PR12MB6675.namprd12.prod.outlook.com>
Date:   Wed, 17 May 2023 05:24:10 +0000
From:   "Goud, Srinivas" <srinivas.goud@....com>
To:     Charles Keepax <ckeepax@...nsource.cirrus.com>
CC:     "broonie@...nel.org" <broonie@...nel.org>,
        "linux-spi@...r.kernel.org" <linux-spi@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "patches@...nsource.cirrus.com" <patches@...nsource.cirrus.com>
Subject: RE: [PATCH 1/2] spi: spi-cadence: Avoid read of RX FIFO before its
 ready

Hi,

>-----Original Message-----
>From: Charles Keepax <ckeepax@...nsource.cirrus.com>
>Sent: Monday, May 15, 2023 6:25 PM
>To: Goud, Srinivas <srinivas.goud@....com>
>Cc: broonie@...nel.org; linux-spi@...r.kernel.org; linux-
>kernel@...r.kernel.org; patches@...nsource.cirrus.com
>Subject: Re: [PATCH 1/2] spi: spi-cadence: Avoid read of RX FIFO before its
>ready
>
>On Mon, May 15, 2023 at 12:04:38PM +0000, Goud, Srinivas wrote:
>> >-----Original Message-----
>> >From: Charles Keepax <ckeepax@...nsource.cirrus.com>
>> >Sent: Tuesday, May 9, 2023 10:12 PM
>> >To: broonie@...nel.org
>> >Cc: Goud, Srinivas <srinivas.goud@....com>;
>> >linux-spi@...r.kernel.org; linux-kernel@...r.kernel.org;
>> >patches@...nsource.cirrus.com
>> >Subject: [PATCH 1/2] spi: spi-cadence: Avoid read of RX FIFO before its ready
>> >-		while (trans_cnt) {
>> >-			cdns_spi_read_rx_fifo(xspi, 1);
>> >-
>> >-			if (xspi->tx_bytes) {
>> >-				if (xspi->txbuf)
>> >-					cdns_spi_write(xspi, CDNS_SPI_TXD,
>> >-						       *xspi->txbuf++);
>> >-				else
>> >-					cdns_spi_write(xspi, CDNS_SPI_TXD,
>> >0);
>> >-				xspi->tx_bytes--;
>> >-			}
>> >-			trans_cnt--;
>> >-		}
>> >-		if (!xspi->tx_bytes) {
>> >-			/* Fixed delay due to controller limitation with
>> >-			 * RX_NEMPTY incorrect status
>> >-			 * Xilinx AR:65885 contains more details
>> >-			 */
>> >-			udelay(10);
>> >-			cdns_spi_read_rx_fifo(xspi, xspi->rx_bytes);
>> >+		cdns_spi_read_rx_fifo(xspi, trans_cnt);
>> Cadence SPI configured in Slave mode,  when threshold is half of FIFO
>> depth cdns_spi_read_rx_fifo() function continuously in read mode, due to
>this we see incorrect data received on the Master side as Slave is failed to
>update the TX FIFO on time.
>
>Apologies I am having a little trouble following this are you saying this part of
>the patch cases issues for you running in slave mode?
Yes, we see issue with this patch when we run in Slave mode.

When any master is in continuous read mode (anything > FIFO depth), 
with updated logic cdns_spi_read_rx_fifo() function in cdns_spi_irq
continuously in read loop to read complete half FIFO data.
due to this Slave failed to write the TX FIFO on time and result in
incorrect data in Master receive. 
Whereas in my previous patch, data read and write happening byte wise,
by which we are making sure data availability in TXFIFO on time.
>
>Thanks,
>Charles

Thanks,
Srinivas

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ