Linux RTC
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Cc: Aaro Koskinen <aaro.koskinen@iki.fi>,
	Alessandro Zummo <a.zummo@towertech.it>,
	rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org
Subject: [rtc-linux] Re: [PATCH 2/3] rtc: __rtc_read_time: reduce log level
Date: Tue, 31 Mar 2015 20:25:19 -0700	[thread overview]
Message-ID: <1427858719.18175.32.camel@perches.com> (raw)
In-Reply-To: <20150401032113.GP3849@piout.net>

On Wed, 2015-04-01 at 05:21 +0200, Alexandre Belloni wrote:
> On 28/03/2015 at 23:09:35 +0200, Aaro Koskinen wrote :
> > __rtc_read_time logs should be debug logs instead of error logs.
> > 
> > For example, when the RTC clock is not set, it's not really useful
> > to print a kernel error log every time someone tries to read the clock:
> > 
> > 	~ # hwclock -r
> > 	[  604.508263] rtc rtc0: read_time: fail to read
> > 	hwclock: RTC_RD_TIME: Invalid argument
> > 
> > If there's a real error, it's likely that lower level or higher level
> > code will tell it anyway. Make these logs debug logs, and also print
> > the error code for the read failure.
> > 
> 
> That actually may be the only error message printed for some failures.
> Some RTCs don't print anything in case of error in their .read_time()
> and there are in-kernel users of rtc_read_time that simply bail out
> without printing anything or have a trace that is already at the debug
> level.
> 
> I would agree that this would need a better harmonization and I guess we
> can do that for now. I'll try to fix the in-kernel cases.

Maybe these should use dev_err_once().

> > diff --git a/drivers/rtc/interface.c b/drivers/rtc/interface.c
[]
> > @@ -31,13 +31,14 @@ static int __rtc_read_time(struct rtc_device *rtc, struct rtc_time *tm)
> >  		memset(tm, 0, sizeof(struct rtc_time));
> >  		err = rtc->ops->read_time(rtc->dev.parent, tm);
> >  		if (err < 0) {
> > -			dev_err(&rtc->dev, "read_time: fail to read\n");
> > +			dev_dbg(&rtc->dev, "read_time: fail to read: %d\n",
> > +				err);
> >  			return err;
> >  		}
> >  
> >  		err = rtc_valid_tm(tm);
> >  		if (err < 0)
> > -			dev_err(&rtc->dev, "read_time: rtc_time isn't valid\n");
> > +			dev_dbg(&rtc->dev, "read_time: rtc_time isn't valid\n");
> >  	}
> >  	return err;
> >  }



-- 
-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

  reply	other threads:[~2015-04-01  3:25 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-28 21:09 [rtc-linux] [PATCH 1/3] rtc: initialize rtc name early Aaro Koskinen
2015-03-28 21:09 ` [rtc-linux] [PATCH 2/3] rtc: __rtc_read_time: reduce log level Aaro Koskinen
2015-04-01  3:21   ` [rtc-linux] " Alexandre Belloni
2015-04-01  3:25     ` Joe Perches [this message]
2015-04-01  9:55       ` Alexandre Belloni
2015-03-28 21:09 ` [rtc-linux] [PATCH 3/3] rtc: hctosys: use function name in the error log Aaro Koskinen
2015-04-01  3:01   ` [rtc-linux] " Alexandre Belloni
2015-04-01  3:18     ` Joe Perches
2015-04-01  7:05       ` Alessandro Zummo
2015-04-01  7:15         ` Joe Perches
2015-04-01 10:42       ` Alexandre Belloni
2015-04-01 16:12         ` [rtc-linux] [PATCH] rtc: Use more standard kernel logging styles Joe Perches
2015-04-02  7:47           ` Krzysztof Kozlowski
2015-04-05 10:17           ` [rtc-linux] " Alexandre Belloni
2015-04-01  3:01 ` [rtc-linux] Re: [PATCH 1/3] rtc: initialize rtc name early Alexandre Belloni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1427858719.18175.32.camel@perches.com \
    --to=joe@perches.com \
    --cc=a.zummo@towertech.it \
    --cc=aaro.koskinen@iki.fi \
    --cc=alexandre.belloni@free-electrons.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rtc-linux@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox