From: Sebastian Reichel <sre@kernel.org>
To: Neil Brown <neilb@suse.de>
Cc: "Pali Rohár" <pali.rohar@gmail.com>,
"H. Nikolaus Schaller" <hns@goldelico.com>,
"Dmitry Eremin-Solenikov" <dbaryshkov@gmail.com>,
"David Woodhouse" <dwmw2@infradead.org>,
linux-pm@vger.kernel.org
Subject: Re: [PATCH 3/4] power:bq27x00: don't fill system log by missing battery
Date: Sat, 5 Dec 2015 01:38:34 +0100 [thread overview]
Message-ID: <20151205003834.GB22936@earth> (raw)
In-Reply-To: <871td68f9p.fsf@notabene.neil.brown.name>
[-- Attachment #1: Type: text/plain, Size: 2545 bytes --]
On Thu, Oct 08, 2015 at 09:50:26AM +1100, Neil Brown wrote:
> Pali Rohár <pali.rohar@gmail.com> writes:
>
> > On Wednesday 07 October 2015 20:42:38 H. Nikolaus Schaller wrote:
> >> From: NeilBrown <neilb@suse.de>
> >>
> >> Print message that battery is not calibrated only during debug build
> >> but not during normal operation.
> >>
> >> Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
> >> ---
> >> drivers/power/bq27x00_battery.c | 2 +-
> >> 1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/drivers/power/bq27x00_battery.c
> >> b/drivers/power/bq27x00_battery.c index 8287261f..709d1e4 100644
> >> --- a/drivers/power/bq27x00_battery.c
> >> +++ b/drivers/power/bq27x00_battery.c
> >> @@ -491,7 +491,7 @@ static void bq27x00_update(struct
> >> bq27x00_device_info *di) if (cache.flags >= 0) {
> >> if (!is_bq27500 && !is_bq27425 && !is_bq27742 && !is_bq27510
> >> && (cache.flags & BQ27000_FLAG_CI)) {
> >> - dev_info(di->dev, "battery is not calibrated! ignoring
> > capacity
> >> values\n"); + dev_dbg(di->dev, "battery is not calibrated!
> >> ignoring capacity values\n"); cache.capacity = -ENODATA;
> >> cache.energy = -ENODATA;
> >> cache.time_to_empty = -ENODATA;
> >
> > Hi! I think that better approach would be to use WARN_ONCE or similar
> > macro. Still use INFO level, just warn about this problem only once...
>
> Why do you need any warning?
> The status of whether the battery is calibrated is trivially determined
> From the sysfs attributes (several of which will return ENODATA).
> So if some app is being used to report battery status, then it can
> easily report "not calibrated", and if no such app is being used, who
> will care to know?
>
> I'm not exactly against a once-only warning (though not with WARN_ONCE,
> maybe dev_info_once()) but I don't think that it brings any value at
> all.
There is no use in having it printed every time, even for debugging.
It just adds lots of spam to the log/console. Anyone debugging the
driver will know, that the battery requires calibration and returns
-ENODATA in uncalibrated mode.
Users not knowing the bq27xxx chips might wonder why the driver
returns -ENODATA, though. For these users a single print
in the log is probably useful. Thus I will take this patch
with dev_info_once() and the following tags:
From: NeilBrown <neilb@suse.de>
Suggested-By: H. Nikolaus Schaller <hns@goldelico.com>
Suggested-By: Pali Rohár <pali.rohar@gmail.com>
-- Sebastian
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2015-12-05 0:38 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-07 18:42 [PATCH 0/4] Fix minor bq27x00 displeasures H. Nikolaus Schaller
2015-10-07 18:42 ` [PATCH 1/4] restore bq27000 code of v4.3-rc4 H. Nikolaus Schaller
2015-10-07 18:43 ` H. Nikolaus Schaller
2015-10-07 18:42 ` [PATCH 2/4] restore w1 slave " H. Nikolaus Schaller
2015-10-07 18:44 ` H. Nikolaus Schaller
2015-10-07 18:42 ` [PATCH 3/4] power:bq27x00: don't fill system log by missing battery H. Nikolaus Schaller
2015-10-07 22:23 ` Pali Rohár
2015-10-07 22:50 ` Neil Brown
2015-12-05 0:38 ` Sebastian Reichel [this message]
2015-10-07 18:42 ` [PATCH 4/4] w1:slaves:bq27000: load battery driver kernel module if required H. Nikolaus Schaller
2015-10-07 22:26 ` Pali Rohár
2015-10-08 7:26 ` H. Nikolaus Schaller
2015-10-08 7:54 ` Pali Rohár
2015-10-08 9:58 ` H. Nikolaus Schaller
2015-10-07 18:45 ` [PATCH 0/4] Fix minor bq27x00 displeasures H. Nikolaus Schaller
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=20151205003834.GB22936@earth \
--to=sre@kernel.org \
--cc=dbaryshkov@gmail.com \
--cc=dwmw2@infradead.org \
--cc=hns@goldelico.com \
--cc=linux-pm@vger.kernel.org \
--cc=neilb@suse.de \
--cc=pali.rohar@gmail.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