Skip to contentSkip to conversation

i2c: tegra: remove warning dump if timeout happen in transfer

PATCH In review Laxman Dewangan 4 participants 6 messages Feb 14, 2013 – Feb 15, 2013

Subsystems (3)
lore
Share & tools
lore

Laxman Dewangan

author maintainer
#0 lore raw

PATCH 1/1 i2c: tegra: remove warning dump if timeout happen in transfer

If timeout error occurs in the i2c transfer then it was dumping warning of call stack.

Remove the warning dump as there is may be possibility that some slave devices are busy and not responding the i2c communication.

---
The patch is generated based on discussion happen between Stephena and Wolfram on the patch:
i2c: add bcm2835 driver

resending patch as Wolfram's email id has been changed.

 drivers/i2c/busses/i2c-tegra.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/i2c/busses/i2c-tegra.c +1 -1
index ae2e027..36704e3 100644
@@ -587,7 +587,7 @@ static int tegra_i2c_xfer_msg(struct tegra_i2c_dev *i2c_dev,
 	ret = wait_for_completion_timeout(&i2c_dev->msg_complete, TEGRA_I2C_TIMEOUT);
 	tegra_i2c_mask_irq(i2c_dev, int_mask);
 
-	if (WARN_ON(ret == 0)) {
+	if (ret == 0) {
 		dev_err(i2c_dev->dev, "i2c transfer timed out\n");
 
 		tegra_i2c_init(i2c_dev);
Signature · 1 line
1.7.1.1
#1 lore raw
Quoted 22 lines · Laxman Dewangan

If timeout error occurs in the i2c transfer then it was dumping warning of call stack.

Remove the warning dump as there is may be possibility that some slave devices are busy and not responding the i2c communication.

---
The patch is generated based on discussion happen between Stephena and Wolfram on the patch:
i2c: add bcm2835 driver

resending patch as Wolfram's email id has been changed.

 drivers/i2c/busses/i2c-tegra.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/i2c/busses/i2c-tegra.c +0 -0
index ae2e027..36704e3 100644

drivers/i2c/busses/i2c-tegra.c static int tegra_i2c_xfer_msg(struct tegra_i2c_dev *i2c_dev, · line 590

Quoted 5 lines
drivers/i2c/busses/i2c-tegra.c +1 -1
@@ -587,7 +587,7 @@ static int tegra_i2c_xfer_msg(struct tegra_i2c_dev *i2c_dev,
        ret = wait_for_completion_timeout(&i2c_dev->msg_complete, TEGRA_I2C_TIMEOUT);
        tegra_i2c_mask_irq(i2c_dev, int_mask);
 
-       if (WARN_ON(ret == 0)) {
+       if (ret == 0) {

I think WARN_ON has a unlikely.

If you could do a profiling and have the unlikely.

BTW thats not an objection to the patch though.

Quoted 10 lines
drivers/i2c/busses/i2c-tegra.c +0 -1
                dev_err(i2c_dev->dev, "i2c transfer timed out\n");
 
                tegra_i2c_init(i2c_dev);
--

1.7.1.1

--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw
Quoted 26 lines · Shubhrajyoti Datta
Quoted 25 lines · Laxman Dewangan

If timeout error occurs in the i2c transfer then it was dumping warning of call stack.

Remove the warning dump as there is may be possibility that some slave devices are busy and not responding the i2c communication.

---
The patch is generated based on discussion happen between Stephena and Wolfram on the patch:
i2c: add bcm2835 driver

resending patch as Wolfram's email id has been changed.

 drivers/i2c/busses/i2c-tegra.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/i2c/busses/i2c-tegra.c +0 -0
index ae2e027..36704e3 100644
@@ -587,7 +587,7 @@ static int tegra_i2c_xfer_msg(struct tegra_i2c_dev *i2c_dev,
        ret = wait_for_completion_timeout(&i2c_dev->msg_complete, TEGRA_I2C_TIMEOUT);
        tegra_i2c_mask_irq(i2c_dev, int_mask);
 
Quoted 8 lines

drivers/i2c/busses/i2c-tegra.c static int tegra_i2c_xfer_msg(struct tegra_i2c_dev *i2c_dev, · line 590

Quoted 2 lines
drivers/i2c/busses/i2c-tegra.c +1 -1
-       if (WARN_ON(ret == 0)) {
+       if (ret == 0) {

I think WARN_ON has a unlikely.

If you could do a profiling and have the unlikely.

BTW thats not an objection to the patch though.

The thing is: Timeouts can be expected on an I2C bus. Devices can be busy, that's fine. So, no need for a WARN. I'm even thinking of asking to remove the dev_err here, or at least change it into dev_warn, but haven't made up my mind yet.

Regards,

Wolfram

#3 lore raw
In reply to Laxman Dewangan
Quoted 7 lines · Laxman Dewangan

If timeout error occurs in the i2c transfer then it was dumping warning of call stack.

Remove the warning dump as there is may be possibility that some slave devices are busy and not responding the i2c communication.

I'd like to have the patch extended. Currently, i2c-tegra is the only I2C user of BUG and BUG_ON. Could you maybe extend the patch to handle those situations more gracefully while we are at it? From a glimpse, these situations don't need a complete halt of the kernel?

Thanks,

Wolfram

#4 lore raw
Quoted 7 lines · Wolfram Sang
Quoted 6 lines · Laxman Dewangan

If timeout error occurs in the i2c transfer then it was dumping warning of call stack.

Remove the warning dump as there is may be possibility that some slave devices are busy and not responding the i2c communication.

Quoted 6 lines
Quoted 1 line

I'd like to have the patch extended. Currently, i2c-tegra is the only I2C user of BUG and BUG_ON. Could you maybe extend the patch to handle those situations more gracefully while we are at it? From a glimpse, these situations don't need a complete halt of the kernel?

While that's probably useful, surely that's a separate patch?

#5 lore raw
Quoted 8 lines · Stephen Warren
Quoted 7 lines · Wolfram Sang
Quoted 6 lines · Laxman Dewangan

If timeout error occurs in the i2c transfer then it was dumping warning of call stack.

Remove the warning dump as there is may be possibility that some slave devices are busy and not responding the i2c communication.

Quoted 8 lines
Quoted 6 lines
Quoted 1 line

I'd like to have the patch extended. Currently, i2c-tegra is the only I2C user of BUG and BUG_ON. Could you maybe extend the patch to handle those situations more gracefully while we are at it? From a glimpse, these situations don't need a complete halt of the kernel?

While that's probably useful, surely that's a separate patch?

Yes, can be argued. Patch applied to for-next, thanks!