Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2985211ybz; Sun, 3 May 2020 14:16:16 -0700 (PDT) X-Google-Smtp-Source: APiQypK7Xfl8cFMe/tUzh9NpiZoHf1nFzdKTtAonBRSxhqEQZIVIzQdQ/V3lnogapuDfa7dSbpJq X-Received: by 2002:a50:9e8f:: with SMTP id a15mr11870506edf.68.1588540576492; Sun, 03 May 2020 14:16:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588540576; cv=none; d=google.com; s=arc-20160816; b=cP37U8z8FJt4++iAoSyS3BBT7SwTNQUv7BwShXRv15kW8JDdYQkAUK/6LZoH/Qk+MB Qo8nGtZK31tat0Lam6Z+cpXokre/yGuJ7W6FzGXaRCjLQjRy6+LoM/hZi8EUVlFtWUev 1D3mmXfBqpaxMYyCMxQ95Iq9mEqeW32Efo7Wz8kMsZEaRRhz0IlSnmE34Phx+c0KrwF0 WLKtNxzu/iPQamuKmBenzl4jtjekMqsuEcQyXAn9uunQFOLZFsO7ZzuA4tpOI05wblHU HDlA9JuXGyUyQE3Bg82xGzoVuU6eq655TArV1mwumlvPlHCD9Bl6a3ajO9qRpv/YFc8Z BCSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=sq7EP7TczuQke9jbEGzrHTN60GH+JQvsQDU0DVV9K/E=; b=g5fhOYL9JArYyVjNchY8fbDlRjYY9bU6WckM+Dca5jl2iYbE/tceoFAaAmVUzSK90I Vk+jKgPblZeJgNTHzuuzmVZ8iswzuS0WVQpxYp7TvVmbHGK/PSwjNg42ObY2an/25QDy lW5Y+aQBX+oQxcFb2BnEB6Sav4rocjTMcypM+l7Jw2js5d8/Aci6WWkOcA0Z4KnNwBjA VvMQqXVXCore5KFM/XMvOMms7OvVyhptK/q8kIlre6NuYbdoW0BOnZ823lEkwwA0HDqp n0f+hj0SDX2AhPa1k3Yladcq0OVJ3Urw7vGFAk1XYPmWJh2aGwm1KqUmNz4Ao3TSSy59 YEwQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g11si5198266edr.185.2020.05.03.14.15.53; Sun, 03 May 2020 14:16:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729125AbgECVOJ (ORCPT + 99 others); Sun, 3 May 2020 17:14:09 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:50480 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726315AbgECVOJ (ORCPT ); Sun, 3 May 2020 17:14:09 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: sre) with ESMTPSA id 6C1A52A083E Received: by earth.universe (Postfix, from userid 1000) id 28CC63C08C7; Sun, 3 May 2020 23:14:05 +0200 (CEST) Date: Sun, 3 May 2020 23:14:05 +0200 From: Sebastian Reichel To: =?utf-8?B?TWljaGHFgiBNaXJvc8WCYXc=?= Cc: Rob Herring , 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 Message-ID: <20200503211405.zegrp7e7hiy5whht@earth.universe> References: <5c8e8f4c5a7fc2cecb62342f9a964f69f3fde7ae.1588517058.git.mirq-linux@rere.qmqm.pl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="3lf2y2viymq2wjzo" Content-Disposition: inline In-Reply-To: <5c8e8f4c5a7fc2cecb62342f9a964f69f3fde7ae.1588517058.git.mirq-linux@rere.qmqm.pl> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --3lf2y2viymq2wjzo Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Sun, May 03, 2020 at 05:21:12PM +0200, Micha=C5=82 Miros=C5=82aw 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. >=20 > Signed-off-by: Micha=C5=82 Miros=C5=82aw > --- Reviewed-by: Sebastian Reichel -- Sebastian > drivers/power/supply/bq25890_charger.c | 4 ++++ > 1 file changed, 4 insertions(+) >=20 > diff --git a/drivers/power/supply/bq25890_charger.c b/drivers/power/suppl= y/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) > } > } > =20 > +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 p= ower_supply *psy, > int ret; > =20 > mutex_lock(&bq->lock); > + /* update state in case we lost an interrupt */ > + __bq25890_handle_irq(bq); > state =3D bq->state; > do_adc_conv =3D !state.online && bq25890_is_adc_property(psp); > if (do_adc_conv) > --=20 > 2.20.1 >=20 --3lf2y2viymq2wjzo Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE72YNB0Y/i3JqeVQT2O7X88g7+poFAl6vNB0ACgkQ2O7X88g7 +pogFw/9GVb8Bdes1EnvpGaiNkrb5RcfYkYaTK1/wLA+c+XWm1b6w6INniLUXy6G b+gyHI2L5IdRtDWrcTLPXJOXz2GYcow0Fe9Lhtrn9KHKT18wM/eummyU/6JpVaqj oZxUR/dBIV+0reHLCdSCuXzS0ZPxBDiiBS4NVcYwnlcy94uqguHOyzvK/QYOljhv lFvYz8qNO3Ye1VxsCmETSMA9VZ7drPKqUr9NKky1wAEQmPdoyhXK2maqkulGJmzo 7k0Df3sFGwECctpDy5nT7y/TnH0t6WqES3sCWI5VSpKCFJkG3OnEYCkZXk4wNU9l /wBKpqMmqlYK6NwaZHTHcYdhpxhUxxOfjuv1gDNuFk/1OUfyZqt9u1YEKCrHzK1C 5RzkzwO7rI0aBhi0Cw0UB1ki98NVxacehyB7meJHWmtMqwNJNrNjkV3K00FpmX0c JMJYfYduFnZ5VT2oK66cB+ZaSbHfuTcjcQA65TeNG5Nil/ypXenhXCnd+dDRctsw TMhr1x62B+ENt7psOBhCt2NPoTIGs3e+5isRIF34Jy9gaS1YNdrJgFBrWWIalx9N dG0FggrFIKljQNY47atO9lJTJvGfwtmmlku8iG/iNRGDRvl1yWJZ3HGYHbye1IX1 QjWgOBB+CHph2g02x13fiObuCXhnzD0jaR5v4NCRMum4OEirmyg= =wt7W -----END PGP SIGNATURE----- --3lf2y2viymq2wjzo--