mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: James Gallagher <jbgallagher2000@yahoo.co.uk>
To: linux-kernel@vger.kernel.org
Subject: Kernel doesn't generate a "Discharging" battery event after unplugging AC power on Full battery
Date: Thu, 8 Oct 2009 20:30:58 +0000 (GMT)	[thread overview]
Message-ID: <119632.18101.qm@web26701.mail.ukl.yahoo.com> (raw)

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

(This applies to kernel 2.6.31.2 and older)

If I unplug AC power on an Acer Aspire One with fully charged battery, the kernel/udev events generated indicate the only change as POWER_SUPPLY_ONLINE=0 (from 1), the battery POWER_SUPPLY_STATUS is still indicating FULL, and no change in the battery environment, even though the event is labelled ACTION=change on both the mains (ACAD) and battery (BAT1) (see attached log of the 4 kernel/udev events generated after unplugging)

This causes DeviceKit-power to suspend polling, so the power manager never records the subsequent discharge of the battery (the battery state in /sys updates to "Discharging" about 10 seconds later). The redhat guys on bugzilla are insisting it's a kernel/udev bug, not a DeviceKit-power bug.

This also occurs on a Dell Inspiron 1520, but less predictably - ie sometimes the battery STATE=Discharging and sometimes =FULL.

So Questions?

1. Why does the kernel generate a change event for the battery when there is no change?
2. Why does the battery STATE indicate Full rather than Discharging?
3. Why does it take ~10 seconds for the battery state to change to "Discharging" in /sys, and why is there no accompanying udev event to indicate the status change?

See https://bugzilla.redhat.com/show_bug.cgi?id=521874 (bug has been re-assigned from DeviceKit-power to Kernel)

James Gallagher

(can replies be cc'ed to me, cheers)


      

[-- Attachment #2: udev monitor.txt --]
[-- Type: text/plain, Size: 2162 bytes --]

$ sudo udevadm monitor --udev --kernel --environment
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent

KERNEL[1254931537.850913] change   /devices/LNXSYSTM:00/device:00/ACPI0003:00/power_supply/ACAD (power_supply)
UDEV_LOG=3
ACTION=change
DEVPATH=/devices/LNXSYSTM:00/device:00/ACPI0003:00/power_supply/ACAD
SUBSYSTEM=power_supply
POWER_SUPPLY_NAME=ACAD
POWER_SUPPLY_TYPE=Mains
POWER_SUPPLY_ONLINE=0
SEQNUM=1247

UDEV  [1254931537.896863] change   /devices/LNXSYSTM:00/device:00/ACPI0003:00/power_supply/ACAD (power_supply)
UDEV_LOG=3
ACTION=change
DEVPATH=/devices/LNXSYSTM:00/device:00/ACPI0003:00/power_supply/ACAD
SUBSYSTEM=power_supply
POWER_SUPPLY_NAME=ACAD
POWER_SUPPLY_TYPE=Mains
POWER_SUPPLY_ONLINE=0
SEQNUM=1247

KERNEL[1254931538.555417] change   /devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/BAT1 (power_supply)
UDEV_LOG=3
ACTION=change
DEVPATH=/devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/BAT1
SUBSYSTEM=power_supply
POWER_SUPPLY_NAME=BAT1
POWER_SUPPLY_TYPE=Battery
POWER_SUPPLY_STATUS=Full
POWER_SUPPLY_PRESENT=1
POWER_SUPPLY_TECHNOLOGY=Li-ion
POWER_SUPPLY_VOLTAGE_MIN_DESIGN=11100000
POWER_SUPPLY_VOLTAGE_NOW=12584000
POWER_SUPPLY_CURRENT_NOW=65163000
POWER_SUPPLY_CHARGE_FULL_DESIGN=2400000
POWER_SUPPLY_CHARGE_FULL=1111000
POWER_SUPPLY_CHARGE_NOW=1111000
POWER_SUPPLY_MODEL_NAME=UM08A72
POWER_SUPPLY_MANUFACTURER=SIMPLO
POWER_SUPPLY_SERIAL_NUMBER=1C8C
SEQNUM=1248

UDEV  [1254931538.563046] change   /devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/BAT1 (power_supply)
UDEV_LOG=3
ACTION=change
DEVPATH=/devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/BAT1
SUBSYSTEM=power_supply
POWER_SUPPLY_NAME=BAT1
POWER_SUPPLY_TYPE=Battery
POWER_SUPPLY_STATUS=Full
POWER_SUPPLY_PRESENT=1
POWER_SUPPLY_TECHNOLOGY=Li-ion
POWER_SUPPLY_VOLTAGE_MIN_DESIGN=11100000
POWER_SUPPLY_VOLTAGE_NOW=12584000
POWER_SUPPLY_CURRENT_NOW=65163000
POWER_SUPPLY_CHARGE_FULL_DESIGN=2400000
POWER_SUPPLY_CHARGE_FULL=1111000
POWER_SUPPLY_CHARGE_NOW=1111000
POWER_SUPPLY_MODEL_NAME=UM08A72
POWER_SUPPLY_MANUFACTURER=SIMPLO
POWER_SUPPLY_SERIAL_NUMBER=1C8C
SEQNUM=1248



                 reply	other threads:[~2009-10-08 20:38 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=119632.18101.qm@web26701.mail.ukl.yahoo.com \
    --to=jbgallagher2000@yahoo.co.uk \
    --cc=linux-kernel@vger.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

all inboxes | Powered by JetHome®