From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753316AbbDADZY (ORCPT ); Tue, 31 Mar 2015 23:25:24 -0400 Received: from smtprelay0228.hostedemail.com ([216.40.44.228]:38981 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753005AbbDADZX (ORCPT ); Tue, 31 Mar 2015 23:25:23 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::,RULES_HIT:41:355:379:541:599:960:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2553:2559:2562:2693:2828:2899:3138:3139:3140:3141:3142:3354:3622:3865:3866:3867:3868:3870:3871:3872:3874:4250:4321:5007:6117:6119:6261:7903:10004:10400:10848:10967:11026:11232:11473:11658:11914:12043:12296:12517:12519:12555:12740:13019:13069:13095:13311:13357:21080,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0 X-HE-Tag: pets86_68f468e6dbb56 X-Filterd-Recvd-Size: 2851 Message-ID: <1427858719.18175.32.camel@perches.com> Subject: Re: [PATCH 2/3] rtc: __rtc_read_time: reduce log level From: Joe Perches To: Alexandre Belloni Cc: Aaro Koskinen , Alessandro Zummo , rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org Date: Tue, 31 Mar 2015 20:25:19 -0700 In-Reply-To: <20150401032113.GP3849@piout.net> References: <1427576976-22353-1-git-send-email-aaro.koskinen@iki.fi> <1427576976-22353-2-git-send-email-aaro.koskinen@iki.fi> <20150401032113.GP3849@piout.net> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.12.10-0ubuntu1~14.10.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; > > }