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-next>] [day] [month] [year] [list]
Message-Id: <20221122133551.91536-1-nathan.morrison@timesys.com>
Date:   Tue, 22 Nov 2022 08:35:50 -0500
From:   Nathan Barrett-Morrison <nathan.morrison@...esys.com>
To:     unlisted-recipients:; (no To-header on input)
Cc:     greg.malysa@...esys.com, nathan.morrison@...esys.com,
        p.yadav@...com, vigneshr@...com,
        vadivel.muruganx.ramuthevar@...el.com,
        grmoore@...nsource.altera.com, lftan@...era.com,
        Mark Brown <broonie@...nel.org>,
        linux-spi@...r.kernel.org (open list:SPI SUBSYSTEM),
        linux-kernel@...r.kernel.org (open list)
Subject: [PATCH] spi: cadence-quadspi: Properly pass buswidth through to underlying SPI subsystem via buswidth_override_bits instead of mode_bits.

While trying to enable Octal SPI mode, it was observed that
SPI_RX_OCTAL/SPI_TX_OCTAL were not propagating into the spi_device
spi->mode setting.  This was causing the SPI device to always
operate in 1x mode instead of the desired 8x mode.

Signed-off-by: Nathan Barrett-Morrison <nathan.morrison@...esys.com>
---
 drivers/spi/spi-cadence-quadspi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c
index 447230547945..c92a95bdaa05 100644
--- a/drivers/spi/spi-cadence-quadspi.c
+++ b/drivers/spi/spi-cadence-quadspi.c
@@ -1589,7 +1589,7 @@ static int cqspi_probe(struct platform_device *pdev)
 		dev_err(&pdev->dev, "spi_alloc_master failed\n");
 		return -ENOMEM;
 	}
-	master->mode_bits = SPI_RX_QUAD | SPI_RX_DUAL;
+	master->buswidth_override_bits = SPI_RX_QUAD | SPI_RX_DUAL;
 	master->mem_ops = &cqspi_mem_ops;
 	master->mem_caps = &cqspi_mem_caps;
 	master->dev.of_node = pdev->dev.of_node;
@@ -1686,7 +1686,7 @@ static int cqspi_probe(struct platform_device *pdev)
 			cqspi->wr_delay = 50 * DIV_ROUND_UP(NSEC_PER_SEC,
 						cqspi->master_ref_clk_hz);
 		if (ddata->hwcaps_mask & CQSPI_SUPPORTS_OCTAL)
-			master->mode_bits |= SPI_RX_OCTAL | SPI_TX_OCTAL;
+			master->buswidth_override_bits |= SPI_RX_OCTAL | SPI_TX_OCTAL;
 		if (!(ddata->quirks & CQSPI_DISABLE_DAC_MODE))
 			cqspi->use_direct_mode = true;
 		if (ddata->quirks & CQSPI_SUPPORT_EXTERNAL_DMA)
-- 
2.30.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ