diff mbox

[PATCHv2,6/9] i2c: xiic: Add a debug msg in case of timeout

Message ID 1434554299-23443-7-git-send-email-shubhraj@xilinx.com
State Rejected
Headers show

Commit Message

Shubhrajyoti Datta June 17, 2015, 3:18 p.m. UTC
Currently we return silently upon a timeout.
Adding an error message to aid debugability. Not
 a functional change.

Signed-off-by: Shubhrajyoti Datta <shubhraj@xilinx.com>
---
 drivers/i2c/busses/i2c-xiic.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Comments

Wolfram Sang July 9, 2015, 5:29 p.m. UTC | #1
On Wed, Jun 17, 2015 at 08:48:16PM +0530, Shubhrajyoti Datta wrote:
> Currently we return silently upon a timeout.
> Adding an error message to aid debugability. Not
>  a functional change.
> 
> Signed-off-by: Shubhrajyoti Datta <shubhraj@xilinx.com>

I am not in favour of this. In case of a stalled bus, this can easily
flood the logs. If it is for debugging, it should also be dev_dbg. And
then, it probably can also be added when needed. I mean the errno is
quite descriptive, no?

> ---
>  drivers/i2c/busses/i2c-xiic.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c
> index a83f300..66c571e 100644
> --- a/drivers/i2c/busses/i2c-xiic.c
> +++ b/drivers/i2c/busses/i2c-xiic.c
> @@ -692,6 +692,7 @@ static int xiic_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
>  		i2c->tx_msg = NULL;
>  		i2c->rx_msg = NULL;
>  		i2c->nmsgs = 0;
> +		dev_err(adap->dev.parent, "Controller timed out\n");
>  		return -ETIMEDOUT;
>  	}
>  }
> -- 
> 1.7.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
Shubhrajyoti Datta July 10, 2015, 5:11 a.m. UTC | #2
On Thu, Jul 9, 2015 at 10:59 PM, Wolfram Sang <wsa@the-dreams.de> wrote:
> On Wed, Jun 17, 2015 at 08:48:16PM +0530, Shubhrajyoti Datta wrote:
>> Currently we return silently upon a timeout.
>> Adding an error message to aid debugability. Not
>>  a functional change.
>>
>> Signed-off-by: Shubhrajyoti Datta <shubhraj@xilinx.com>
>
> I am not in favour of this. In case of a stalled bus, this can easily
> flood the logs. If it is for debugging, it should also be dev_dbg. And
> then, it probably can also be added when needed. I mean the errno is
> quite descriptive, no?
>
I agree I had added it for debugging.
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c
index a83f300..66c571e 100644
--- a/drivers/i2c/busses/i2c-xiic.c
+++ b/drivers/i2c/busses/i2c-xiic.c
@@ -692,6 +692,7 @@  static int xiic_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
 		i2c->tx_msg = NULL;
 		i2c->rx_msg = NULL;
 		i2c->nmsgs = 0;
+		dev_err(adap->dev.parent, "Controller timed out\n");
 		return -ETIMEDOUT;
 	}
 }