Linux SPI subsystem development
 help / color / mirror / Atom feed
* [PATCH] spi: tegra114: Don't fail set_cs_timing when delays are zero
@ 2025-04-24  2:03 Aaron Kling via B4 Relay
  2025-05-02 22:21 ` Mark Brown
  2025-05-06  9:26 ` Jon Hunter
  0 siblings, 2 replies; 7+ messages in thread
From: Aaron Kling via B4 Relay @ 2025-04-24  2:03 UTC (permalink / raw)
  To: Laxman Dewangan, Mark Brown, Thierry Reding, Jonathan Hunter,
	Mason Zhang
  Cc: linux-spi, linux-tegra, linux-kernel, stable, Aaron Kling

From: Aaron Kling <webgeek1234@gmail.com>

The original code would skip null delay pointers, but when the pointers
were converted to point within the spi_device struct, the check was not
updated to skip delays of zero. Hence all spi devices that didn't set
delays would fail to probe.

Fixes: 04e6bb0d6bb1 ("spi: modify set_cs_timing parameter")
Cc: stable@vger.kernel.org
Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
---
 drivers/spi/spi-tegra114.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/spi/spi-tegra114.c b/drivers/spi/spi-tegra114.c
index 3822d7c8d8edb9730e937df50d1c75e095dd18ec..2a8bb798e95b954fe573f1c50445ed2e7fcbfd78 100644
--- a/drivers/spi/spi-tegra114.c
+++ b/drivers/spi/spi-tegra114.c
@@ -728,9 +728,9 @@ static int tegra_spi_set_hw_cs_timing(struct spi_device *spi)
 	u32 inactive_cycles;
 	u8 cs_state;
 
-	if (setup->unit != SPI_DELAY_UNIT_SCK ||
-	    hold->unit != SPI_DELAY_UNIT_SCK ||
-	    inactive->unit != SPI_DELAY_UNIT_SCK) {
+	if ((setup->unit && setup->unit != SPI_DELAY_UNIT_SCK) ||
+	    (hold->unit && hold->unit != SPI_DELAY_UNIT_SCK) ||
+	    (inactive->unit && inactive->unit != SPI_DELAY_UNIT_SCK)) {
 		dev_err(&spi->dev,
 			"Invalid delay unit %d, should be SPI_DELAY_UNIT_SCK\n",
 			SPI_DELAY_UNIT_SCK);

---
base-commit: a79be02bba5c31f967885c7f3bf3a756d77d11d9
change-id: 20250423-spi-tegra114-b88828c5c0f3

Best regards,
-- 
Aaron Kling <webgeek1234@gmail.com>



^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-05-06 10:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-24  2:03 [PATCH] spi: tegra114: Don't fail set_cs_timing when delays are zero Aaron Kling via B4 Relay
2025-05-02 22:21 ` Mark Brown
2025-05-06  9:26 ` Jon Hunter
2025-05-06  9:50   ` Aaron Kling
2025-05-06 10:06     ` Jon Hunter
2025-05-06 10:12       ` Aaron Kling
2025-05-06 10:31         ` Jon Hunter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox