Linux Tegra architecture development
 help / color / mirror / Atom feed
From: Breno Leitao <leitao@debian.org>
To: Thierry Reding <thierry.reding@gmail.com>,
	 Jonathan Hunter <jonathanh@nvidia.com>,
	 Sowjanya Komatineni <skomatineni@nvidia.com>,
	 Laxman Dewangan <ldewangan@nvidia.com>,
	Mark Brown <broonie@kernel.org>
Cc: linux-tegra@vger.kernel.org, linux-spi@vger.kernel.org,
	 linux-kernel@vger.kernel.org, rmikey@meta.com,
	 Breno Leitao <leitao@debian.org>,
	kernel-team@meta.com
Subject: [PATCH 1/3] spi: tegra210-quad: use device_reset_optional() instead of device_reset()
Date: Mon, 17 Mar 2025 08:44:01 -0700	[thread overview]
Message-ID: <20250317-tegra-v1-1-78474efc0386@debian.org> (raw)
In-Reply-To: <20250317-tegra-v1-0-78474efc0386@debian.org>

My UEFI machines with tegra210-quad consistently report "device reset
failed". Investigation showed this isn't an actual failure
- __device_reset() returns -ENOENT because ACPI has no "*_RST" method.

Replace device_reset() with device_reset_optional() to prevent
errors when the reset method doesn't exist. With this change, the
function only fails if the actual device reset operation fails when
called.

Signed-off-by: Breno Leitao <leitao@debian.org>
---
 drivers/spi/spi-tegra210-quad.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/spi/spi-tegra210-quad.c b/drivers/spi/spi-tegra210-quad.c
index 08e49a8768943..9027f995a6669 100644
--- a/drivers/spi/spi-tegra210-quad.c
+++ b/drivers/spi/spi-tegra210-quad.c
@@ -999,7 +999,7 @@ static void tegra_qspi_handle_error(struct tegra_qspi *tqspi)
 	dev_err(tqspi->dev, "error in transfer, fifo status 0x%08x\n", tqspi->status_reg);
 	tegra_qspi_dump_regs(tqspi);
 	tegra_qspi_flush_fifos(tqspi, true);
-	if (device_reset(tqspi->dev) < 0)
+	if (device_reset_optional(tqspi->dev) < 0)
 		dev_warn_once(tqspi->dev, "device reset failed\n");
 }
 
@@ -1149,7 +1149,7 @@ static int tegra_qspi_combined_seq_xfer(struct tegra_qspi *tqspi,
 				}
 
 				/* Reset controller if timeout happens */
-				if (device_reset(tqspi->dev) < 0)
+				if (device_reset_optional(tqspi->dev) < 0)
 					dev_warn_once(tqspi->dev,
 						      "device reset failed\n");
 				ret = -EIO;
@@ -1606,7 +1606,7 @@ static int tegra_qspi_probe(struct platform_device *pdev)
 		goto exit_pm_disable;
 	}
 
-	if (device_reset(tqspi->dev) < 0)
+	if (device_reset_optional(tqspi->dev) < 0)
 		dev_warn_once(tqspi->dev, "device reset failed\n");
 
 	tqspi->def_command1_reg = QSPI_M_S | QSPI_CS_SW_HW |  QSPI_CS_SW_VAL;

-- 
2.47.1


  reply	other threads:[~2025-03-17 15:44 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-17 15:44 [PATCH 0/3] spi: tegra210-quad: Improve reset and tx failures Breno Leitao
2025-03-17 15:44 ` Breno Leitao [this message]
2025-03-17 16:45   ` [PATCH 1/3] spi: tegra210-quad: use device_reset_optional() instead of device_reset() Mark Brown
2025-03-17 16:56     ` Breno Leitao
2025-03-17 17:24       ` Mark Brown
2025-03-18 10:36         ` Breno Leitao
2025-03-18 12:48           ` Mark Brown
2025-03-18 17:02             ` Breno Leitao
2025-03-18 17:34               ` Mark Brown
2025-03-18 18:29                 ` Breno Leitao
2025-03-18 18:32                   ` Breno Leitao
2025-03-18 19:00                     ` Arnd Bergmann
2025-03-18 19:13                       ` Mark Brown
2025-03-18 20:07                         ` Arnd Bergmann
2025-03-19 10:09                           ` Breno Leitao
2025-03-19 18:26                             ` Thierry Reding
2025-03-19 18:53                               ` Breno Leitao
2025-03-21 12:40                                 ` Thierry Reding
2025-03-21 16:28                                   ` Breno Leitao
2025-03-24 13:17                                     ` Thierry Reding
2025-03-25 16:56                                       ` Breno Leitao
2025-03-25 17:05                                         ` Thierry Reding
2025-03-28 13:18                                           ` Breno Leitao
2025-03-19 13:11                           ` Mark Brown
2025-03-18 18:35                   ` Mark Brown
2025-03-18 19:08                     ` Breno Leitao
2025-03-18 19:16                       ` Mark Brown
2025-03-17 15:44 ` [PATCH 2/3] spi: tegra210-quad: use WARN_ON_ONCE instead of WARN_ON for timeouts Breno Leitao
2025-03-17 15:44 ` [PATCH 3/3] spi: tegra210-quad: add rate limiting and simplify timeout error message Breno Leitao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250317-tegra-v1-1-78474efc0386@debian.org \
    --to=leitao@debian.org \
    --cc=broonie@kernel.org \
    --cc=jonathanh@nvidia.com \
    --cc=kernel-team@meta.com \
    --cc=ldewangan@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=rmikey@meta.com \
    --cc=skomatineni@nvidia.com \
    --cc=thierry.reding@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox