Hi,
On 11-04-18 18:22, Daniel Drake wrote:
On Tue, Apr 10, 2018 at 2:55 PM, Hans de Goede <hdegoede@xxxxxxxxxx> wrote:
This commit adds a helper for handling the ACPI_BATTERY_STATE_DISCHARGING
state. This helper checks if we're an AC and the current going out of the
battery is 0 and in that case reports a status of full to userspace rather
then discharging.
power_supply_is_system_supplied() doesn't have any documentation, but
upon brief code inspection it seems to do as you describe (checks that
we are on mains power).
I'm not clear on the FULL vs NOT_CHARGING thing as I also don't see
documentation for those flags. But if NOT_CHARGING is the correct one
to return, should we not just return that here, and fix up userspace
at the same time? Users will need to upgrade their kernel to get this
bugfix, so it does not seem unreasonable for them to have to upgrade a
userspace component as well.
I was under the impression that the userspace regression caused by the
"ACPI: battery: Add the ThinkPad "Not Charging" quirk" patch was why
you reverted it:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/acpi/battery.c?id=7a4ea10c01cdda3d66aa98af258f150d863aee24
But re-reading the commit message I now see that that is not the case,
anyways I agree with reverting that because it relies on dmi based
device identification for something which many devices have.
Either way userspace regressions are a big no-no and there are enough
people running new kernels with an old(ish) userspace for this to be
a real problem, so we really need to go with FULL for now.
Regards,
Hans
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html