From: Sebastian Reichel <sebastian.reichel@collabora.com>
To: "Michał Mirosław" <mirq-linux@rere.qmqm.pl>
Cc: Rob Herring <robh+dt@kernel.org>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-pm@vger.kernel.org
Subject: Re: [PATCH v2 06/11] power: bq25890: update state on property read
Date: Sun, 3 May 2020 23:14:05 +0200 [thread overview]
Message-ID: <20200503211405.zegrp7e7hiy5whht@earth.universe> (raw)
In-Reply-To: <5c8e8f4c5a7fc2cecb62342f9a964f69f3fde7ae.1588517058.git.mirq-linux@rere.qmqm.pl>
[-- Attachment #1: Type: text/plain, Size: 1429 bytes --]
Hi,
On Sun, May 03, 2020 at 05:21:12PM +0200, Michał Mirosław wrote:
> Edge interrupts from the charger may be lost or stuck in fault mode
> since probe(). Check if something changed everytime userspace wants
> some data.
>
> Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
> ---
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
-- Sebastian
> drivers/power/supply/bq25890_charger.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/power/supply/bq25890_charger.c b/drivers/power/supply/bq25890_charger.c
> index 3b02fa80aedd..e4368d01396a 100644
> --- a/drivers/power/supply/bq25890_charger.c
> +++ b/drivers/power/supply/bq25890_charger.c
> @@ -389,6 +389,8 @@ static bool bq25890_is_adc_property(enum power_supply_property psp)
> }
> }
>
> +static irqreturn_t __bq25890_handle_irq(struct bq25890_device *bq);
> +
> static int bq25890_power_supply_get_property(struct power_supply *psy,
> enum power_supply_property psp,
> union power_supply_propval *val)
> @@ -399,6 +401,8 @@ static int bq25890_power_supply_get_property(struct power_supply *psy,
> int ret;
>
> mutex_lock(&bq->lock);
> + /* update state in case we lost an interrupt */
> + __bq25890_handle_irq(bq);
> state = bq->state;
> do_adc_conv = !state.online && bq25890_is_adc_property(psp);
> if (do_adc_conv)
> --
> 2.20.1
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2020-05-03 21:14 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-03 15:21 [PATCH v2 00/11] power: supply: bq25890: fix and extend Michał Mirosław
2020-05-03 15:21 ` [PATCH v2 03/11] power: bq25890: make property table const Michał Mirosław
2020-05-03 19:55 ` Sebastian Reichel
2020-05-03 15:21 ` [PATCH v2 01/11] power: bq25890: remove redundant I2C bus check Michał Mirosław
2020-05-03 19:56 ` Sebastian Reichel
2020-05-03 15:21 ` [PATCH v2 02/11] power: bq25890: simplify chip name property getter Michał Mirosław
2020-05-03 19:55 ` Sebastian Reichel
2020-05-03 15:21 ` [PATCH v2 04/11] power: bq25890: protect view of the chip's state Michał Mirosław
2020-05-03 21:10 ` Sebastian Reichel
2020-05-03 15:21 ` [PATCH v2 05/11] power: bq25890: fix ADC mode configuration Michał Mirosław
2020-05-03 20:01 ` Sebastian Reichel
2020-05-03 15:21 ` [PATCH v2 07/11] power: bq25890: implement CHARGE_TYPE property Michał Mirosław
2020-05-03 21:14 ` Sebastian Reichel
2020-05-03 15:21 ` [PATCH v2 06/11] power: bq25890: update state on property read Michał Mirosław
2020-05-03 21:14 ` Sebastian Reichel [this message]
2020-05-03 15:21 ` [PATCH v2 09/11] power: bq25890: implement INPUT_CURRENT_LIMIT property Michał Mirosław
2020-05-03 21:16 ` Sebastian Reichel
2020-05-03 15:21 ` [PATCH v2 08/11] power: bq25890: implement PRECHARGE_CURRENT property Michał Mirosław
2020-05-03 21:15 ` Sebastian Reichel
2020-05-03 15:21 ` [PATCH v2 10/11] power: bq25890: support IBAT compensation Michał Mirosław
2020-05-03 15:21 ` [PATCH v2 11/11] power: bq25890: document IBAT compensation DT properties Michał Mirosław
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=20200503211405.zegrp7e7hiy5whht@earth.universe \
--to=sebastian.reichel@collabora.com \
--cc=devicetree@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mirq-linux@rere.qmqm.pl \
--cc=robh+dt@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).