thinkpad_acpi: don't overwrite supported battery operations
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): 00b72055-929d-4bda-bff3-3a9249568b73-khTSGRnkC0s@public.gmane.org
Quoted 8 lines · Thomas Weißschuh
Quoted 4 lines · Thomas Weißschuh
Previously the struct containing the supported operations for all batteries was zeroed every time a battery was probed. This prevented all batteries except the lastly probed one from being configured.
Is something wrong with this patch?
If so I would like to remedy it.
Nah, it is fine. Please resend it to [email protected] and I will ack it there.
However, it will have a trivial conflict with an already accepted patch that adds quirk handling to tpacpi_battery_init(). The fix is obvious (place the memset before the quirk handler is called).
Signature · 5 lines
Henrique Holschuh ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
A message that is not in the archive (sent off-list or not yet received): 20180801114747.qrjclik665ya7oh5-ZGHd14iZgfaRjzvQDGKj+xxZW9W5cXbT@public.gmane.org
PATCH 1/1 platform/x86: thinkpad_acpi: Fix multi-battery bug
The struct containing the supported operations for all batteries is being zeroed on each battery probe. This prevents all other batteries except the lastly probed one from being configured.
--- drivers/platform/x86/thinkpad_acpi.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/platform/x86/thinkpad_acpi.c +5 -1
@@ -9374,7 +9374,9 @@ static int tpacpi_battery_probe(int battery) {int ret =0 ; -memset (&battery_info,0 ,sizeof (struct tpacpi_battery_driver_data )); +memset (&battery_info.batteries[battery],0 , +sizeof (battery_info.batteries[battery])); +/* * 1) Get the current start threshold * 2) Check for support
@@ -9616,6 +9618,8 @@ static const struct tpacpi_quirk battery_quirk_table[] __initconst = {static int __init tpacpi_battery_init (struct ibm_init_struct *ibm) { +memset (&battery_info,0 ,sizeof (battery_info)); + tp_features.battery_force_primary =tpacpi_check_quirks ( battery_quirk_table,ARRAY_SIZE (battery_quirk_table));
Signature · 6 lines
2.18.0 ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
PATCH v2 1/1 platform/x86: thinkpad_acpi: Fix multi-battery bug
In reply to a message not in the archiveThe struct containing the supported operations for all batteries is being zeroed on each battery probe. This prevents all other batteries except the lastly probed one from being configured.
---
Changes since v1:
* Missing sign-off added
drivers/platform/x86/thinkpad_acpi.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/platform/x86/thinkpad_acpi.c +5 -1
@@ -9374,7 +9374,9 @@ static int tpacpi_battery_probe(int battery) {int ret =0 ; -memset (&battery_info,0 ,sizeof (struct tpacpi_battery_driver_data )); +memset (&battery_info.batteries[battery],0 , +sizeof (battery_info.batteries[battery])); +/* * 1) Get the current start threshold * 2) Check for support
@@ -9616,6 +9618,8 @@ static const struct tpacpi_quirk battery_quirk_table[] __initconst = {static int __init tpacpi_battery_init (struct ibm_init_struct *ibm) { +memset (&battery_info,0 ,sizeof (battery_info)); + tp_features.battery_force_primary =tpacpi_check_quirks ( battery_quirk_table,ARRAY_SIZE (battery_quirk_table));
Signature · 10 lines
2.18.0 ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ ibm-acpi-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel
A message that is not in the archive (sent off-list or not yet received): 20180801222418.21892-1-linux-9XfqOkM5JgxKQ7RDE2T8Pw@public.gmane.org
Re: [PATCH v2] platform/x86: thinkpad_acpi: Fix multi-battery bug
Quoted 3 lines · Thomas Weißschuh
The struct containing the supported operations for all batteries is being zeroed on each battery probe. This prevents all other batteries except the lastly probed one from being configured.
You forgot to include subsystem maintainers along with driver maintainer.
I pushed this to my review and testing queue, meanwhile I would wait for Ack from Henrique.
Quoted 38 lines
Signed-off-by Thomas Weißschuh <[email protected]>---
Changes since v1:
* Missing sign-off added
drivers/platform/x86/thinkpad_acpi.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)drivers/platform/x86/thinkpad_acpi.c +5
-2@@ -9374,7 +9374,9 @@ static int tpacpi_battery_probe(int battery) {int ret =0 ; -memset (&battery_info,0 ,sizeof (struct tpacpi_battery_driver_data )); +memset (&battery_info.batteries[battery],0 , +sizeof (battery_info.batteries[battery])); +/* * 1) Get the current start threshold * 2) Check for support @@ -9616,6 +9618,8 @@ static const struct tpacpi_quirk battery_quirk_table[] __initconst = {static int __init tpacpi_battery_init (struct ibm_init_struct *ibm) { +memset (&battery_info,0 ,sizeof (battery_info)); + tp_features.battery_force_primary =tpacpi_check_quirks ( battery_quirk_table,ARRAY_SIZE (battery_quirk_table)); --2.18.0
Signature · 10 lines
With Best Regards, Andy Shevchenko ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ ibm-acpi-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel
A message that is not in the archive (sent off-list or not yet received): CAHp75VeprNMVniQ_KrQRU9v3kt4kxEnHYO+ds5pOYokvv=0YdQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Re: [PATCH v2] platform/x86: thinkpad_acpi: Fix multi-battery bug
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Quoted 9 lines · Andy Shevchenko
Quoted 3 lines · Thomas Weißschuh
The struct containing the supported operations for all batteries is being zeroed on each battery probe. This prevents all other batteries except the lastly probed one from being configured.
You forgot to include subsystem maintainers along with driver maintainer.
I pushed this to my review and testing queue, meanwhile I would wait for Ack from Henrique.
Hi Andy, Thomas and Henrique,
was this included in any tree and is it on route to Linus somehow?
My ThinkPad X250 has two batteries and I can only configure threshold on BAT0, and I guess it's because of this, so it'd be nice to have it fixed (and maybe backported to relevant stable kernels).
Regards,
- --
Yves-Alexis
-----BEGIN PGP SIGNATURE-----
iQEzBAEBCAAdFiEE8vi34Qgfo83x35gF3rYcyPpXRFsFAluSY80ACgkQ3rYcyPpX RFsc9Qf+NJ4zlKNzfxh2Ehtr4n8No6X/eqSHD1Jwq28eNzYm8wUmuIwQdzRyYCgA pnsexe+7QDeDYNHgr251lTdvj+6Iz3dwLE/WCLPCxnXa8Ja02MGZxRyYt1XiGiYu xmGP8P62Ae384xNalUti8HxX9juGJIHupTCFUUYcKntgmYs7YSW/Ukm/JX/NuQ2h QdexjuqugxsSM35dHYzC9S9VumFvs5ed8oHodeIkUMoFgH1BCiqA3Nih87Mkn+Zd wuFWJm9vkem6lySXGjlusRbOrkhOadCOP6RtNG4cSfJPYNr2GbPkyb5w1uVv+M95 XN9xWc0pv2wTvJs93sgZgUR1Fa+/JQ==
=vN7W
-----END PGP SIGNATURE-----
_______________________________________________
ibm-acpi-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel
A message that is not in the archive (sent off-list or not yet received): 6c62d06dee6572f7d03280ed9e9f6d7b7d9babf1.camel-8fiUuRrzOP0dnm+yROfE0A@public.gmane.org
Re: [PATCH v2] platform/x86: thinkpad_acpi: Fix multi-battery bug
Hi Yves-Alexis,
Quoted 6 lines · Yves-Alexis Perez
Quoted 5 lines · Andy Shevchenko
Quoted 3 lines · Thomas Weißschuh
The struct containing the supported operations for all batteries is being zeroed on each battery probe. This prevents all other batteries except the lastly probed one from being configured.
Quoted 6 lines
Quoted 4 lines
You forgot to include subsystem maintainers along with driver maintainer.
I pushed this to my review and testing queue, meanwhile I would wait for Ack from Henrique.
was this included in any tree and is it on route to Linus somehow?
This is on track to be released in 4.19.
Quoted 3 lines
My ThinkPad X250 has two batteries and I can only configure threshold on BAT0, and I guess it's because of this, so it'd be nice to have it fixed (and maybe backported to relevant stable kernels).
As far as I know only changes that fix behaviour that worked before are eligible for stable. As this specific functionality never worked before I figured it would be moot to also send it to stable.
(If it is fine to send stuff like this to stable, we could try, though)
Thomas
_______________________________________________
ibm-acpi-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel
A message that is not in the archive (sent off-list or not yet received): 4e387ece-dbf1-434b-8dde-18f0fa513d99-khTSGRnkC0s@public.gmane.org
Re: [PATCH v2] platform/x86: thinkpad_acpi: Fix multi-battery bug
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Quoted 3 lines · Thomas Weißschuh
Quoted 1 line
was this included in any tree and is it on route to Linus somehow?
This is on track to be released in 4.19.
Thanks. I've applied the three patches (this one and the two from Jouke) on top of 4.18.6 and I confirm I can set the thresholds on BAT1.
Quoted 8 lines
Quoted 4 lines
My ThinkPad X250 has two batteries and I can only configure threshold on BAT0, and I guess it's because of this, so it'd be nice to have it fixed (and maybe backported to relevant stable kernels).
As far as I know only changes that fix behaviour that worked before are eligible for stable. As this specific functionality never worked before I figured it would be moot to also send it to stable.
Well, it does somehow work when you have one battery, but it's really frustrating to have it not work for the second one.
Quoted 2 lines
(If it is fine to send stuff like this to stable, we could try, though)
Indeed, not sure if “frustrating” is reason enough for stable :)
Thanks for your work anyway.
Regards,
- --
Yves-Alexis
-----BEGIN PGP SIGNATURE-----
iQEzBAEBCAAdFiEE8vi34Qgfo83x35gF3rYcyPpXRFsFAluS7NMACgkQ3rYcyPpX RFtA1wgAv4JmftXLoE6ZJy3wIVaEM5sC5ys3Q1hBMca7tfqECupR6WMyPmaholdl birWkLVLF6N6WZowlzB/LuLSHHvBwsWzF5VEufnziOTsyxuqGRRdBm9yiNPpG4dj NEGxg2n0ju98DLTEn9HzxusqF/ahje11DfHItE0xU1gZHrPR7JVLJDvHlmbrEu0R jBEBMmpAtpqFVlkSSxgalu6Ms9FvM7cLEOu4tGCv5tjjvK3+1ZKVqs9nOVrBDGmn eWjGod3HDjmC/npJ3LdiXAMyySr9ohnt0WEBmcUAPFkpaGyNctzgiOYlrQrDsegg lD5acn7wbt7XvamzAKjRbFhFpnQNrQ==
=56YF
-----END PGP SIGNATURE-----
_______________________________________________
ibm-acpi-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel
A message that is not in the archive (sent off-list or not yet received): d91099a3353c6eb11ea9eaa5fa8409dc86f7f7ed.camel-8fiUuRrzOP0dnm+yROfE0A@public.gmane.org
Re: [PATCH v2] platform/x86: thinkpad_acpi: Fix multi-battery bug
Quoted 19 lines · Yves-Alexis Perez
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256Quoted 3 lines · Thomas Weißschuh
Quoted 1 line
was this included in any tree and is it on route to Linus somehow?
This is on track to be released in 4.19.
Thanks. I've applied the three patches (this one and the two from Jouke) on top of 4.18.6 and I confirm I can set the thresholds on BAT1.
Quoted 8 lines
Quoted 4 lines
My ThinkPad X250 has two batteries and I can only configure threshold on BAT0, and I guess it's because of this, so it'd be nice to have it fixed (and maybe backported to relevant stable kernels).
As far as I know only changes that fix behaviour that worked before are eligible for stable. As this specific functionality never worked before I figured it would be moot to also send it to stable.
Quoted 6 lines
Well, it does somehow work when you have one battery, but it's really frustrating to have it not work for the second one.
Quoted 2 lines
(If it is fine to send stuff like this to stable, we could try, though)
Indeed, not sure if “frustrating” is reason enough for stable :)
FWIW, once given enough testing, yes, I think this should be proposed for -stable.
Signature · 7 lines
Henrique Holschuh _______________________________________________ ibm-acpi-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel