According to my syslog, upowerd crash always follows a power_supply
error, so I thought there must be some connection:

Mar 10 02:59:45 dev kernel: [  160.051819] power_supply 
hid-00:12:a1:68:a3:1b-battery: driver failed to report `capacity' property: -5
Mar 10 02:59:45 dev kernel: [  160.137237] do_trap: 66 callbacks suppressed
Mar 10 02:59:45 dev kernel: [  160.137248] traps: upowerd[1502] trap int3 
ip:7f2c0c1b92b5 sp:7fff26f6c440 error:0

If you look into linux-*/drivers/power/power_supply_sysfs.c, you can
easily find the suspect:

        ssize_t ret = 0;
        ...

        if (off == POWER_SUPPLY_PROP_TYPE)
                value.intval = psy->type;
        else
                ret = psy->get_property(psy, off, &value);

        if (ret < 0) {
                if (ret == -ENODATA)
                        dev_dbg(dev, "driver has no data for `%s' property\n",
                                attr->attr.name);
                else if (ret != -ENODEV)
                        dev_err(dev, "driver failed to report `%s' property: 
%zd\n",
                                attr->attr.name, ret);
                return ret;
        }

Here, "ret" is assigned only once, which means psy->get_property()
returns -EIO (-5).

psy->get_property() is actually calls hidinput_get_battery_property()
from linux-*/drivers/hid/hid-input.c:

battery->get_property = hidinput_get_battery_property;

And the only place in hidinput_get_battery_property where we can get
-EIO is:

          case POWER_SUPPLY_PROP_CAPACITY:
                ret = dev->hid_get_raw_report(dev, dev->battery_report_id,
                                              buf, sizeof(buf),
                                              dev->battery_report_type);
                ...
                break;

... and my knowledge isn't enough to dig a little deeper ;)

So, as a temporary solution I've recompiled kernel with commented out
CONFIG_HID_BATTERY_STRENGTH and it works perfectly.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1112907

Title:
  upowerd crashed with signal 5 in dbus_g_connection_register_g_object()

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/upower/+bug/1112907/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to