linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: "Andrew F. Davis" <afd@ti.com>
Cc: "Pali Rohár" <pali@kernel.org>,
	"Sebastian Reichel" <sre@kernel.org>,
	"Krzysztof Kozlowski" <krzysztof.kozlowski@proceq.com>,
	linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org
Subject: Re: [PATCH 1/2] power: supply: bq27xxx_battery: Notify about all battery changes
Date: Wed, 27 May 2020 09:30:11 +0200	[thread overview]
Message-ID: <20200527073011.GA4615@pi3> (raw)
In-Reply-To: <20200527072218.GA4575@pi3>

On Wed, May 27, 2020 at 09:22:24AM +0200, Krzysztof Kozlowski wrote:
> On Tue, May 26, 2020 at 09:24:39PM -0400, Andrew F. Davis wrote:
> > On 5/25/20 10:11 AM, Krzysztof Kozlowski wrote:
> > > All battery related data could be important for user-space.  For example
> > > time-to-full could be shown to user on the screen or health could be
> > > monitored for any issues.  Instead of comparing few selected old/new
> > > values, just check if anything changed in the cache.
> > > 
> > 
> > 
> > At least some value will change every time we poll the battery, are we
> > okay with having power_supply_changed() called every time?
> 
> Hi,
> 
> Let me give few arguments:
> 1. "Every time" means still once per poll interval or in case of many
>    get_property() calls, once per 5 seconds. In first case, if users
>    sets polling every 1 second, I expect he knows what he wants. I2C
>    will be busy anyway so uevents should not matter that much.
>    In second case, called through get_property(), once per 5 seconds is
>    not that frequent.
> 
> 2. Different drivers do it differently. Many chargers notify about
>    everything. Most fuel gauges only on status or capacity change (although
>    I am not sure if they measure more) but few FG send uevents about
>    everything (max17042_battery, sbs-battery, s3c_adc_battery).
> 
> 3. If drivers does not send notifications on changed properties of
>    battery, then basically the user-space has to poll every time for all
>    data which is not being a trigger.  The overhead for system would be
>    the same, I guess.
> 

And one more:
4. I actually needed for my project. I have a user-space which
   previously was polling the battery status but I converted it to udev
   events.  The voltage, current and temperature are important for me as
   well so I need all uevents.

Best regards,
Krzysztof

  reply	other threads:[~2020-05-27  7:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-25 14:11 [PATCH 1/2] power: supply: bq27xxx_battery: Notify about all battery changes Krzysztof Kozlowski
2020-05-25 14:12 ` [PATCH 2/2] power: supply: bq27xxx_battery: Notify about voltage and current changes Krzysztof Kozlowski
2020-05-27  1:24 ` [PATCH 1/2] power: supply: bq27xxx_battery: Notify about all battery changes Andrew F. Davis
2020-05-27  7:22   ` Krzysztof Kozlowski
2020-05-27  7:30     ` Krzysztof Kozlowski [this message]
2020-06-16 10:52   ` Pavel Machek
2020-06-16 11:57     ` Krzysztof Kozlowski

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=20200527073011.GA4615@pi3 \
    --to=krzk@kernel.org \
    --cc=afd@ti.com \
    --cc=krzysztof.kozlowski@proceq.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=pali@kernel.org \
    --cc=sre@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).