[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200302173512.2743-1-digetx@gmail.com>
Date: Mon, 2 Mar 2020 20:35:12 +0300
From: Dmitry Osipenko <digetx@...il.com>
To: Thierry Reding <thierry.reding@...il.com>,
Jonathan Hunter <jonathanh@...dia.com>,
Laxman Dewangan <ldewangan@...dia.com>,
Wolfram Sang <wsa@...-dreams.de>
Cc: linux-i2c@...r.kernel.org, linux-tegra@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH v1] i2c: tegra: Make timeout error more informative
The I2C timeout error message doesn't tell us what exactly failed and some
I2C client drivers do not clarify the error either. Adding WARN_ON_ONCE()
results in a stacktrace being dumped into KMSG, which is very useful for
debugging purposes.
Signed-off-by: Dmitry Osipenko <digetx@...il.com>
---
drivers/i2c/busses/i2c-tegra.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c
index cbc2ad49043e..b2bb19e05248 100644
--- a/drivers/i2c/busses/i2c-tegra.c
+++ b/drivers/i2c/busses/i2c-tegra.c
@@ -1245,7 +1245,7 @@ static int tegra_i2c_xfer_msg(struct tegra_i2c_dev *i2c_dev,
tegra_i2c_mask_irq(i2c_dev, int_mask);
- if (time_left == 0) {
+ if (WARN_ON_ONCE(time_left == 0)) {
dev_err(i2c_dev->dev, "i2c transfer timed out\n");
tegra_i2c_init(i2c_dev, true);
return -ETIMEDOUT;
--
2.25.1
Powered by blists - more mailing lists