* [PATCH v2 0/2] spi: tegra210-quad: Improve messages on pathological case
@ 2025-04-01 13:47 Breno Leitao
2025-04-01 13:47 ` [PATCH v2 1/2] spi: tegra210-quad: use WARN_ON_ONCE instead of WARN_ON for timeouts Breno Leitao
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Breno Leitao @ 2025-04-01 13:47 UTC (permalink / raw)
To: Thierry Reding, Jonathan Hunter, Sowjanya Komatineni,
Laxman Dewangan, Mark Brown
Cc: linux-tegra, linux-spi, linux-kernel, rmikey, Breno Leitao, kernel-team
I maintain several hosts with tegra210-quad controllers, some of which
experience data transmission failures. Debugging these issues has been
challenging due to excessive log messages from the driver.
Since these devices do not have a way to reset[1], then we want to avoid
warning and printing a bunch of messages, otherwise the host will
overflow the serial. Fix it by:
1. Using WARN_ON_ONCE instead of WARN_ON to reduce stack trace spam
2. Rate-limiting error messages and removing redundant information
These improvements maintain necessary error reporting while
significantly reducing log noise, making debugging of actual issues more
feasible.
Link: https://lore.kernel.org/all/q53apce4sltvnyd75j4o7taatocxiduq56fqsoxp3vrjmaqphk@o5kce2wb3dnz/ [1]
Signed-off-by: Breno Leitao <leitao@debian.org>
---
Changes in v2:
- Dropped patch 1, which is still being discussed.
* See https://lore.kernel.org/all/20250328-cinnamon-mushroom-of-proficiency-a17ba8@leitao/
- Link to v1: https://lore.kernel.org/r/20250317-tegra-v1-0-78474efc0386@debian.org
---
Breno Leitao (2):
spi: tegra210-quad: use WARN_ON_ONCE instead of WARN_ON for timeouts
spi: tegra210-quad: add rate limiting and simplify timeout error message
drivers/spi/spi-tegra210-quad.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
---
base-commit: 4701f33a10702d5fc577c32434eb62adde0a1ae1
change-id: 20250317-tegra-1712e60604e6
Best regards,
--
Breno Leitao <leitao@debian.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2 1/2] spi: tegra210-quad: use WARN_ON_ONCE instead of WARN_ON for timeouts
2025-04-01 13:47 [PATCH v2 0/2] spi: tegra210-quad: Improve messages on pathological case Breno Leitao
@ 2025-04-01 13:47 ` Breno Leitao
2025-04-01 13:47 ` [PATCH v2 2/2] spi: tegra210-quad: add rate limiting and simplify timeout error message Breno Leitao
2025-04-15 20:12 ` [PATCH v2 0/2] spi: tegra210-quad: Improve messages on pathological case Mark Brown
2 siblings, 0 replies; 4+ messages in thread
From: Breno Leitao @ 2025-04-01 13:47 UTC (permalink / raw)
To: Thierry Reding, Jonathan Hunter, Sowjanya Komatineni,
Laxman Dewangan, Mark Brown
Cc: linux-tegra, linux-spi, linux-kernel, rmikey, Breno Leitao, kernel-team
Some machines with tegra_qspi_combined_seq_xfer hardware issues generate
excessive kernel warnings, severely polluting the logs:
dmesg | grep -i "WARNING:.*tegra_qspi_transfer_one_message" | wc -l
94451
This patch replaces WARN_ON with WARN_ON_ONCE for timeout conditions to
reduce log spam. The subsequent error message still prints on each
occurrence, providing sufficient information about the failure, while
the stack trace is only needed once for debugging purposes.
Signed-off-by: Breno Leitao <leitao@debian.org>
---
drivers/spi/spi-tegra210-quad.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/spi/spi-tegra210-quad.c b/drivers/spi/spi-tegra210-quad.c
index 08e49a8768943..2d320fbb8875f 100644
--- a/drivers/spi/spi-tegra210-quad.c
+++ b/drivers/spi/spi-tegra210-quad.c
@@ -1117,7 +1117,7 @@ static int tegra_qspi_combined_seq_xfer(struct tegra_qspi *tqspi,
(&tqspi->xfer_completion,
QSPI_DMA_TIMEOUT);
- if (WARN_ON(ret == 0)) {
+ if (WARN_ON_ONCE(ret == 0)) {
dev_err(tqspi->dev, "QSPI Transfer failed with timeout: %d\n",
ret);
if (tqspi->is_curr_dma_xfer &&
--
2.47.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2 2/2] spi: tegra210-quad: add rate limiting and simplify timeout error message
2025-04-01 13:47 [PATCH v2 0/2] spi: tegra210-quad: Improve messages on pathological case Breno Leitao
2025-04-01 13:47 ` [PATCH v2 1/2] spi: tegra210-quad: use WARN_ON_ONCE instead of WARN_ON for timeouts Breno Leitao
@ 2025-04-01 13:47 ` Breno Leitao
2025-04-15 20:12 ` [PATCH v2 0/2] spi: tegra210-quad: Improve messages on pathological case Mark Brown
2 siblings, 0 replies; 4+ messages in thread
From: Breno Leitao @ 2025-04-01 13:47 UTC (permalink / raw)
To: Thierry Reding, Jonathan Hunter, Sowjanya Komatineni,
Laxman Dewangan, Mark Brown
Cc: linux-tegra, linux-spi, linux-kernel, rmikey, Breno Leitao, kernel-team
On malfunctioning hardware, timeout error messages can appear thousands
of times, creating unnecessary system pressure and log bloat. This patch
makes two improvements:
1. Replace dev_err() with dev_err_ratelimited() to prevent log flooding
when hardware errors persist
2. Remove the redundant timeout value parameter from the error message,
as 'ret' is always zero in this error path
These changes reduce logging overhead while maintaining necessary error
reporting for debugging purposes.
Signed-off-by: Breno Leitao <leitao@debian.org>
---
drivers/spi/spi-tegra210-quad.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/spi/spi-tegra210-quad.c b/drivers/spi/spi-tegra210-quad.c
index 2d320fbb8875f..64e1b2f8a0001 100644
--- a/drivers/spi/spi-tegra210-quad.c
+++ b/drivers/spi/spi-tegra210-quad.c
@@ -1118,8 +1118,8 @@ static int tegra_qspi_combined_seq_xfer(struct tegra_qspi *tqspi,
QSPI_DMA_TIMEOUT);
if (WARN_ON_ONCE(ret == 0)) {
- dev_err(tqspi->dev, "QSPI Transfer failed with timeout: %d\n",
- ret);
+ dev_err_ratelimited(tqspi->dev,
+ "QSPI Transfer failed with timeout\n");
if (tqspi->is_curr_dma_xfer &&
(tqspi->cur_direction & DATA_DIR_TX))
dmaengine_terminate_all
--
2.47.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2 0/2] spi: tegra210-quad: Improve messages on pathological case
2025-04-01 13:47 [PATCH v2 0/2] spi: tegra210-quad: Improve messages on pathological case Breno Leitao
2025-04-01 13:47 ` [PATCH v2 1/2] spi: tegra210-quad: use WARN_ON_ONCE instead of WARN_ON for timeouts Breno Leitao
2025-04-01 13:47 ` [PATCH v2 2/2] spi: tegra210-quad: add rate limiting and simplify timeout error message Breno Leitao
@ 2025-04-15 20:12 ` Mark Brown
2 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2025-04-15 20:12 UTC (permalink / raw)
To: Thierry Reding, Jonathan Hunter, Sowjanya Komatineni,
Laxman Dewangan, Breno Leitao
Cc: linux-tegra, linux-spi, linux-kernel, rmikey, kernel-team
On Tue, 01 Apr 2025 06:47:48 -0700, Breno Leitao wrote:
> I maintain several hosts with tegra210-quad controllers, some of which
> experience data transmission failures. Debugging these issues has been
> challenging due to excessive log messages from the driver.
>
> Since these devices do not have a way to reset[1], then we want to avoid
> warning and printing a bunch of messages, otherwise the host will
> overflow the serial. Fix it by:
>
> [...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next
Thanks!
[1/2] spi: tegra210-quad: use WARN_ON_ONCE instead of WARN_ON for timeouts
commit: 41c721fc093938745d116c3a21326a0ee03bb491
[2/2] spi: tegra210-quad: add rate limiting and simplify timeout error message
commit: 21f4314e66ed8d40b2ee24185d1a06a07a512eb1
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-04-15 20:12 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-01 13:47 [PATCH v2 0/2] spi: tegra210-quad: Improve messages on pathological case Breno Leitao
2025-04-01 13:47 ` [PATCH v2 1/2] spi: tegra210-quad: use WARN_ON_ONCE instead of WARN_ON for timeouts Breno Leitao
2025-04-01 13:47 ` [PATCH v2 2/2] spi: tegra210-quad: add rate limiting and simplify timeout error message Breno Leitao
2025-04-15 20:12 ` [PATCH v2 0/2] spi: tegra210-quad: Improve messages on pathological case Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®