Linux-PM Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH v2] power: supply: sbs-battery: use correct flags field
@ 2019-08-16  7:37 Michael Nosthoff
  2019-08-27 10:43 ` Enric Balletbo Serra
  2019-09-02  7:59 ` Sebastian Reichel
  0 siblings, 2 replies; 3+ messages in thread
From: Michael Nosthoff @ 2019-08-16  7:37 UTC (permalink / raw)
  To: linux-pm; +Cc: Michael Nosthoff, Brian Norris, stable

the type flag is stored in the chip->flags field not in the
client->flags field. This currently leads to never using the ti
specific health function as client->flags doesn't use that bit.
So it's always falling back to the general one.

Fixes: 76b16f4cdfb8 ("power: supply: sbs-battery: don't assume
MANUFACTURER_DATA formats")

Signed-off-by: Michael Nosthoff <committed@heine.so>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Cc: <stable@vger.kernel.org>
---
Changes since v1:
* Changed comment according to Brian's suggestions
* Added Fixes tag
* Added reviewed and cc stable

 drivers/power/supply/sbs-battery.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/power/supply/sbs-battery.c b/drivers/power/supply/sbs-battery.c
index 048d205d7074..2e86cc1e0e35 100644
--- a/drivers/power/supply/sbs-battery.c
+++ b/drivers/power/supply/sbs-battery.c
@@ -620,7 +620,7 @@ static int sbs_get_property(struct power_supply *psy,
 	switch (psp) {
 	case POWER_SUPPLY_PROP_PRESENT:
 	case POWER_SUPPLY_PROP_HEALTH:
-		if (client->flags & SBS_FLAGS_TI_BQ20Z75)
+		if (chip->flags & SBS_FLAGS_TI_BQ20Z75)
 			ret = sbs_get_ti_battery_presence_and_health(client,
 								     psp, val);
 		else
-- 
2.20.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] power: supply: sbs-battery: use correct flags field
  2019-08-16  7:37 [PATCH v2] power: supply: sbs-battery: use correct flags field Michael Nosthoff
@ 2019-08-27 10:43 ` Enric Balletbo Serra
  2019-09-02  7:59 ` Sebastian Reichel
  1 sibling, 0 replies; 3+ messages in thread
From: Enric Balletbo Serra @ 2019-08-27 10:43 UTC (permalink / raw)
  To: Michael Nosthoff; +Cc: Linux PM list, Brian Norris, stable, Sebastian Reichel

Hi Michael,

I think that Sebastian is expected to be cc'ed, so adding him
(otherwise he can miss your patch)

Missatge de Michael Nosthoff <committed@heine.so> del dia dv., 16
d’ag. 2019 a les 9:38:
>
> the type flag is stored in the chip->flags field not in the
> client->flags field. This currently leads to never using the ti
> specific health function as client->flags doesn't use that bit.
> So it's always falling back to the general one.
>
> Fixes: 76b16f4cdfb8 ("power: supply: sbs-battery: don't assume
> MANUFACTURER_DATA formats")
>
> Signed-off-by: Michael Nosthoff <committed@heine.so>
> Reviewed-by: Brian Norris <briannorris@chromium.org>
> Cc: <stable@vger.kernel.org>

Found this patch while looking at another issue and LGTM, so in case
this helps the patch landing

Reviewed-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>

Thanks,
 Enric

> ---
> Changes since v1:
> * Changed comment according to Brian's suggestions
> * Added Fixes tag
> * Added reviewed and cc stable
>
>  drivers/power/supply/sbs-battery.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/power/supply/sbs-battery.c b/drivers/power/supply/sbs-battery.c
> index 048d205d7074..2e86cc1e0e35 100644
> --- a/drivers/power/supply/sbs-battery.c
> +++ b/drivers/power/supply/sbs-battery.c
> @@ -620,7 +620,7 @@ static int sbs_get_property(struct power_supply *psy,
>         switch (psp) {
>         case POWER_SUPPLY_PROP_PRESENT:
>         case POWER_SUPPLY_PROP_HEALTH:
> -               if (client->flags & SBS_FLAGS_TI_BQ20Z75)
> +               if (chip->flags & SBS_FLAGS_TI_BQ20Z75)
>                         ret = sbs_get_ti_battery_presence_and_health(client,
>                                                                      psp, val);
>                 else
> --
> 2.20.1
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] power: supply: sbs-battery: use correct flags field
  2019-08-16  7:37 [PATCH v2] power: supply: sbs-battery: use correct flags field Michael Nosthoff
  2019-08-27 10:43 ` Enric Balletbo Serra
@ 2019-09-02  7:59 ` Sebastian Reichel
  1 sibling, 0 replies; 3+ messages in thread
From: Sebastian Reichel @ 2019-09-02  7:59 UTC (permalink / raw)
  To: Michael Nosthoff; +Cc: linux-pm, Brian Norris, stable

[-- Attachment #1: Type: text/plain, Size: 1452 bytes --]

Hi,

On Fri, Aug 16, 2019 at 09:37:42AM +0200, Michael Nosthoff wrote:
> the type flag is stored in the chip->flags field not in the
> client->flags field. This currently leads to never using the ti
> specific health function as client->flags doesn't use that bit.
> So it's always falling back to the general one.
> 
> Fixes: 76b16f4cdfb8 ("power: supply: sbs-battery: don't assume
> MANUFACTURER_DATA formats")
> 
> Signed-off-by: Michael Nosthoff <committed@heine.so>
> Reviewed-by: Brian Norris <briannorris@chromium.org>
> Cc: <stable@vger.kernel.org>
> ---

Thanks, queued.

-- Sebastian

> Changes since v1:
> * Changed comment according to Brian's suggestions
> * Added Fixes tag
> * Added reviewed and cc stable
> 
>  drivers/power/supply/sbs-battery.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/power/supply/sbs-battery.c b/drivers/power/supply/sbs-battery.c
> index 048d205d7074..2e86cc1e0e35 100644
> --- a/drivers/power/supply/sbs-battery.c
> +++ b/drivers/power/supply/sbs-battery.c
> @@ -620,7 +620,7 @@ static int sbs_get_property(struct power_supply *psy,
>  	switch (psp) {
>  	case POWER_SUPPLY_PROP_PRESENT:
>  	case POWER_SUPPLY_PROP_HEALTH:
> -		if (client->flags & SBS_FLAGS_TI_BQ20Z75)
> +		if (chip->flags & SBS_FLAGS_TI_BQ20Z75)
>  			ret = sbs_get_ti_battery_presence_and_health(client,
>  								     psp, val);
>  		else
> -- 
> 2.20.1
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-16  7:37 [PATCH v2] power: supply: sbs-battery: use correct flags field Michael Nosthoff
2019-08-27 10:43 ` Enric Balletbo Serra
2019-09-02  7:59 ` Sebastian Reichel

Linux-PM Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-pm/0 linux-pm/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-pm linux-pm/ https://lore.kernel.org/linux-pm \
		linux-pm@vger.kernel.org linux-pm@archiver.kernel.org
	public-inbox-index linux-pm

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-pm


AGPL code for this site: git clone https://public-inbox.org/ public-inbox