linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [RFC] Remove the debug print noise
@ 2010-08-02 12:47 Shubhrajyoti D
  2010-08-02 12:52 ` Felipe Balbi
  2010-08-10 10:39 ` DebBarma, Tarun Kanti
  0 siblings, 2 replies; 7+ messages in thread
From: Shubhrajyoti D @ 2010-08-02 12:47 UTC (permalink / raw)
  To: linux-omap; +Cc: Shubhrajyoti D

This patch intends to make the i2cdetect more readable.

Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
---
 drivers/i2c/busses/i2c-omap.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index 7674efb..3a97d2c 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -626,7 +626,7 @@ static int omap_i2c_xfer_msg(struct i2c_adapter *adap,
 	if (r < 0)
 		return r;
 	if (r == 0) {
-		dev_err(dev->dev, "controller timed out\n");
+		dev_dbg(dev->dev, "controller timed out\n");
 		omap_i2c_init(dev);
 		return -ETIMEDOUT;
 	}
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] [RFC] Remove the debug print noise
  2010-08-02 12:47 [PATCH] [RFC] Remove the debug print noise Shubhrajyoti D
@ 2010-08-02 12:52 ` Felipe Balbi
  2010-08-02 12:59   ` Datta, Shubhrajyoti
  2010-08-10 10:39 ` DebBarma, Tarun Kanti
  1 sibling, 1 reply; 7+ messages in thread
From: Felipe Balbi @ 2010-08-02 12:52 UTC (permalink / raw)
  To: ext Shubhrajyoti D; +Cc: linux-omap@vger.kernel.org, Tony Lindgren

Hi,

On Mon, Aug 02, 2010 at 02:47:51PM +0200, ext Shubhrajyoti D wrote:
>@@ -626,7 +626,7 @@ static int omap_i2c_xfer_msg(struct i2c_adapter *adap,
> 	if (r < 0)
> 		return r;
> 	if (r == 0) {
>-		dev_err(dev->dev, "controller timed out\n");
>+		dev_dbg(dev->dev, "controller timed out\n");

you would better be searching for the cause of the timeout. 1 second is 
enough time (or should be) for any i2c command to complete. If you have 
an easy way to reproduce this problem, then better search for its 
rootcause. If I remember correctly, this timeout was put here for a good 
reason.

Tony, any comments ?

-- 
balbi

DefectiveByDesign.org

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [PATCH] [RFC] Remove the debug print noise
  2010-08-02 12:52 ` Felipe Balbi
@ 2010-08-02 12:59   ` Datta, Shubhrajyoti
  2010-08-02 13:47     ` Nishanth Menon
  0 siblings, 1 reply; 7+ messages in thread
From: Datta, Shubhrajyoti @ 2010-08-02 12:59 UTC (permalink / raw)
  To: felipe.balbi@nokia.com; +Cc: linux-omap@vger.kernel.org, Tony Lindgren



> -----Original Message-----
> From: Felipe Balbi [mailto:felipe.balbi@nokia.com]
> Sent: Monday, August 02, 2010 6:22 PM
> To: Datta, Shubhrajyoti
> Cc: linux-omap@vger.kernel.org; Tony Lindgren
> Subject: Re: [PATCH] [RFC] Remove the debug print noise
> 
> Hi,
> 
> On Mon, Aug 02, 2010 at 02:47:51PM +0200, ext Shubhrajyoti D wrote:
> >@@ -626,7 +626,7 @@ static int omap_i2c_xfer_msg(struct i2c_adapter
> *adap,
> > 	if (r < 0)
> > 		return r;
> > 	if (r == 0) {
> >-		dev_err(dev->dev, "controller timed out\n");
> >+		dev_dbg(dev->dev, "controller timed out\n");
> 
> you would better be searching for the cause of the timeout. 1 second is
> enough time (or should be) for any i2c command to complete. If you have
> an easy way to reproduce this problem, then better search for its
> rootcause. If I remember correctly, this timeout was put here for a good
> reason.

The reason I am getting the timeout is that there isn't a device to respond in that address However 
# ./i2cdetect -y -r 3
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- 29 -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- 48 -- -- 4b -- -- -- --

Is more readable than 
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- i2c_omap i2c_omap.3: controller timed out
-- -- i2c_omap i2c_omap.3: controller timed out
-- -- i2c_omap i2c_omap.3: controller timed out
-- -- i2c_omap i2c_omap.3: controller timed out
-- -- i2c_omap i2c_omap.3: controller timed out
-- -- i2c_omap i2c_omap.3: controller timed out
-- --

> Tony, any comments ?
> 
> --
> balbi
> 
> DefectiveByDesign.org

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] [RFC] Remove the debug print noise
  2010-08-02 12:59   ` Datta, Shubhrajyoti
@ 2010-08-02 13:47     ` Nishanth Menon
  2010-08-06  9:14       ` Tony Lindgren
  0 siblings, 1 reply; 7+ messages in thread
From: Nishanth Menon @ 2010-08-02 13:47 UTC (permalink / raw)
  To: Datta, Shubhrajyoti
  Cc: felipe.balbi@nokia.com, linux-omap@vger.kernel.org, Tony Lindgren

Datta, Shubhrajyoti had written, on 08/02/2010 07:59 AM, the following:
> 
>> -----Original Message-----
>> From: Felipe Balbi [mailto:felipe.balbi@nokia.com]
>> Sent: Monday, August 02, 2010 6:22 PM
>> To: Datta, Shubhrajyoti
>> Cc: linux-omap@vger.kernel.org; Tony Lindgren
>> Subject: Re: [PATCH] [RFC] Remove the debug print noise
>>
>> Hi,
>>
>> On Mon, Aug 02, 2010 at 02:47:51PM +0200, ext Shubhrajyoti D wrote:
>>> @@ -626,7 +626,7 @@ static int omap_i2c_xfer_msg(struct i2c_adapter
>> *adap,
>>> 	if (r < 0)
>>> 		return r;
>>> 	if (r == 0) {
>>> -		dev_err(dev->dev, "controller timed out\n");
>>> +		dev_dbg(dev->dev, "controller timed out\n");
>> you would better be searching for the cause of the timeout. 1 second is
>> enough time (or should be) for any i2c command to complete. If you have
>> an easy way to reproduce this problem, then better search for its
>> rootcause. If I remember correctly, this timeout was put here for a good
>> reason.
> 
> The reason I am getting the timeout is that there isn't a device to respond in that address However 
> # ./i2cdetect -y -r 3
>      0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
> 00:          -- -- -- -- -- -- -- -- -- -- -- -- --
> 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> 20: -- -- -- -- -- -- -- -- -- 29 -- -- -- -- -- --
> 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> 40: -- -- -- -- -- -- -- -- 48 -- -- 4b -- -- -- --
> 
> Is more readable than 
>      0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
> 00:          -- i2c_omap i2c_omap.3: controller timed out
> -- -- i2c_omap i2c_omap.3: controller timed out
> -- -- i2c_omap i2c_omap.3: controller timed out
> -- -- i2c_omap i2c_omap.3: controller timed out
> -- -- i2c_omap i2c_omap.3: controller timed out
> -- -- i2c_omap i2c_omap.3: controller timed out
> -- --
> 

this is still not a debug message -> dev_warn perhaps to flag that this 
is indeed an error from the driver point of view?

>> Tony, any comments ?
>>
>> --
>> balbi
>>
>> DefectiveByDesign.org
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


-- 
Regards,
Nishanth Menon

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] [RFC] Remove the debug print noise
  2010-08-02 13:47     ` Nishanth Menon
@ 2010-08-06  9:14       ` Tony Lindgren
  0 siblings, 0 replies; 7+ messages in thread
From: Tony Lindgren @ 2010-08-06  9:14 UTC (permalink / raw)
  To: Nishanth Menon
  Cc: Datta, Shubhrajyoti, felipe.balbi@nokia.com,
	linux-omap@vger.kernel.org

* Nishanth Menon <nm@ti.com> [100802 16:40]:
> Datta, Shubhrajyoti had written, on 08/02/2010 07:59 AM, the following:
> >
> >>-----Original Message-----
> >>From: Felipe Balbi [mailto:felipe.balbi@nokia.com]
> >>Sent: Monday, August 02, 2010 6:22 PM
> >>To: Datta, Shubhrajyoti
> >>Cc: linux-omap@vger.kernel.org; Tony Lindgren
> >>Subject: Re: [PATCH] [RFC] Remove the debug print noise
> >>
> >>Hi,
> >>
> >>On Mon, Aug 02, 2010 at 02:47:51PM +0200, ext Shubhrajyoti D wrote:
> >>>@@ -626,7 +626,7 @@ static int omap_i2c_xfer_msg(struct i2c_adapter
> >>*adap,
> >>>	if (r < 0)
> >>>		return r;
> >>>	if (r == 0) {
> >>>-		dev_err(dev->dev, "controller timed out\n");
> >>>+		dev_dbg(dev->dev, "controller timed out\n");
> >>you would better be searching for the cause of the timeout. 1 second is
> >>enough time (or should be) for any i2c command to complete. If you have
> >>an easy way to reproduce this problem, then better search for its
> >>rootcause. If I remember correctly, this timeout was put here for a good
> >>reason.
> >
> >The reason I am getting the timeout is that there isn't a device
> >to respond in that address However # ./i2cdetect -y -r 3
> >     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
> >00:          -- -- -- -- -- -- -- -- -- -- -- -- --
> >10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> >20: -- -- -- -- -- -- -- -- -- 29 -- -- -- -- -- --
> >30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> >40: -- -- -- -- -- -- -- -- 48 -- -- 4b -- -- -- --
> >
> >Is more readable than      0  1  2  3  4  5  6  7  8  9  a  b  c
> >d  e  f
> >00:          -- i2c_omap i2c_omap.3: controller timed out
> >-- -- i2c_omap i2c_omap.3: controller timed out
> >-- -- i2c_omap i2c_omap.3: controller timed out
> >-- -- i2c_omap i2c_omap.3: controller timed out
> >-- -- i2c_omap i2c_omap.3: controller timed out
> >-- -- i2c_omap i2c_omap.3: controller timed out
> >-- --
> >
> 
> this is still not a debug message -> dev_warn perhaps to flag that
> this is indeed an error from the driver point of view?
> 
> >>Tony, any comments ?

Errors like this should be handled at the I2C bus level,
not at the driver level. But looks like the I2C bus does
not do anything about it.. So dev_warn sounds good to me.

Tony


^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [PATCH] [RFC] Remove the debug print noise
  2010-08-02 12:47 [PATCH] [RFC] Remove the debug print noise Shubhrajyoti D
  2010-08-02 12:52 ` Felipe Balbi
@ 2010-08-10 10:39 ` DebBarma, Tarun Kanti
  2010-08-10 11:52   ` Felipe Balbi
  1 sibling, 1 reply; 7+ messages in thread
From: DebBarma, Tarun Kanti @ 2010-08-10 10:39 UTC (permalink / raw)
  To: linux-omap@vger.kernel.org; +Cc: Datta, Shubhrajyoti


> -----Original Message-----
> From: linux-omap-owner@vger.kernel.org [mailto:linux-omap-
> owner@vger.kernel.org] On Behalf Of Shubhrajyoti D
> Sent: Monday, August 02, 2010 6:18 PM
> To: linux-omap@vger.kernel.org
> Cc: Datta, Shubhrajyoti
> Subject: [PATCH] [RFC] Remove the debug print noise
> 
> This patch intends to make the i2cdetect more readable.
> 
> Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
> ---
>  drivers/i2c/busses/i2c-omap.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
> index 7674efb..3a97d2c 100644
> --- a/drivers/i2c/busses/i2c-omap.c
> +++ b/drivers/i2c/busses/i2c-omap.c
> @@ -626,7 +626,7 @@ static int omap_i2c_xfer_msg(struct i2c_adapter *adap,
>  	if (r < 0)
>  		return r;
>  	if (r == 0) {
> -		dev_err(dev->dev, "controller timed out\n");
> +		dev_dbg(dev->dev, "controller timed out\n");

Did you compile the code? I thought it would be as below:
dev_dbg(&dev->dev, "controller timed out\n");

>  		omap_i2c_init(dev);
>  		return -ETIMEDOUT;
>  	}
> --
> 1.7.0.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] [RFC] Remove the debug print noise
  2010-08-10 10:39 ` DebBarma, Tarun Kanti
@ 2010-08-10 11:52   ` Felipe Balbi
  0 siblings, 0 replies; 7+ messages in thread
From: Felipe Balbi @ 2010-08-10 11:52 UTC (permalink / raw)
  To: ext DebBarma, Tarun Kanti; +Cc: Datta, Shubhrajyoti, linux-omap@vger.kernel.org

On Tue, Aug 10, 2010 at 12:39:32PM +0200, ext DebBarma, Tarun Kanti wrote:
>> @@ -626,7 +626,7 @@ static int omap_i2c_xfer_msg(struct i2c_adapter *adap,
>>  	if (r < 0)
>>  		return r;
>>  	if (r == 0) {
>> -		dev_err(dev->dev, "controller timed out\n");
>> +		dev_dbg(dev->dev, "controller timed out\n");
>
>Did you compile the code? I thought it would be as below:
>dev_dbg(&dev->dev, "controller timed out\n");

read the code more carefully. Check the definition of struct 
omap_i2c_dev. It holds a pointer to a struct device already.

-- 
balbi

DefectiveByDesign.org

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-08-10 11:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-02 12:47 [PATCH] [RFC] Remove the debug print noise Shubhrajyoti D
2010-08-02 12:52 ` Felipe Balbi
2010-08-02 12:59   ` Datta, Shubhrajyoti
2010-08-02 13:47     ` Nishanth Menon
2010-08-06  9:14       ` Tony Lindgren
2010-08-10 10:39 ` DebBarma, Tarun Kanti
2010-08-10 11:52   ` Felipe Balbi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).