https://bugzilla.kernel.org/show_bug.cgi?id=38782

           Summary: Doubled AC adapter crashes ac module on Dell Inspiron
                    1090.
           Product: ACPI
           Version: 2.5
    Kernel Version: 2.6.39
          Platform: All
        OS/Version: Linux
              Tree: Mainline
            Status: NEW
          Severity: normal
          Priority: P1
         Component: Power-Battery
        AssignedTo: acpi_power-batt...@kernel-bugs.osdl.org
        ReportedBy: jan_br...@gmx.net
        Regression: No


The system tries to register two ac adapters with the second creation of
/class/power_supply/ACAD' in power_supply_register leading to an error with
a backtrace in dmesg (appended below).
Subsequently every (un-)plugging of the power supply will crash the system
as will the unload of the ac module.

The sytem is a Dell Inspiron Duo (Inspiron 1090), BIOS A05 04/18/201.


Steps taken to analyze the problem
==================================

I have modified the ac module to only use one of the two ac adapters,
skipping the other one using a return 0 right after entering acpi_ac_add.
Using this hack the system is not crashing anymore and the module may be
unloaded. The differences in behavior are described below.


Using the first ACAD
--------------------

The system is not crashing, but no acpi events are emitted. As a consequence
neither the laptop-mode-tool nor any other client is reacting on power
plugging.

linux # cat /sys/class/power_supply/ACAD/device/path
\_SB_.ACAD

linux # acpi_listen
battery PNP0C0A:00 00000080 00000001
battery PNP0C0A:00 00000080 00000001

linux # ls /sys/devices/LNXSYSTM\:00/device\:00/PNP0A08\:00/device\:02/
ACPI0003:01


Using the second ACAD
---------------------

Using the second ac adapter everything is working as expected. The system is
getting acpi events and user space tools are reacting as expected.
Only powertop has no power usage estimate.

linux # cat /sys/class/power_supply/ACAD/device/path
\_SB_.PCI0.LPC_.ACAD

linux # acpi_listen
ac_adapter ACPI0003:01 00000080 00000000
battery PNP0C0A:00 00000080 00000001
ac_adapter ACPI0003:01 00000080 00000001
battery PNP0C0A:00 00000080 00000001

linux # ls /sys/devices/LNXSYSTM\:00/device\:00/PNP0A08\:00/device\:02/
ACPI0003:01


dmesg from module insertion
===========================

kernel: [ 9726.860299] ACPI: AC Adapter [ACAD] (off-line)
kernel: [ 9726.921164] ------------[ cut here ]------------
kernel: [ 9726.921186] WARNING: at fs/sysfs/dir.c:455 sysfs_add_one+0x8d/0xa3()
kernel: [ 9726.921194] Hardware name: Inspiron 1090
kernel: [ 9726.921201] sysfs: cannot create duplicate filename
'/class/power_supply/ACAD'
kernel: [ 9726.921209] Modules linked in: ac(+) mcs7830 usbnet mii lsm303c
lsm303a snd_seq snd_seq_device bnep rfcomm snd_hda_codec_conexant ath9k
snd_hda_intel snd_hda_codec mac80211 snd_hwdep ath9k_common snd_pcm ath9k_hw
ath ath3k snd_timer btusb cfg80211 bluetooth snd soundcore snd_page_alloc
kernel: [ 9726.921288] Pid: 26367, comm: insmod Tainted: G        W  
2.6.39-gentoo-r2 #3
kernel: [ 9726.921296] Call Trace:
kernel: [ 9726.921314]  [<ffffffff8103c15b>] ? warn_slowpath_common+0x78/0x8c
kernel: [ 9726.921328]  [<ffffffff8103c215>] ? warn_slowpath_fmt+0x46/0x4c
kernel: [ 9726.921342]  [<ffffffff8111c335>] ? sysfs_add_one+0x8d/0xa3
kernel: [ 9726.921355]  [<ffffffff8111ca6a>] ? sysfs_do_create_link+0x100/0x1a3
kernel: [ 9726.921370]  [<ffffffff8131aeb3>] ? device_add+0x1ff/0x565
kernel: [ 9726.921386]  [<ffffffff8123d04d>] ? kobject_set_name+0x3c/0x42
kernel: [ 9726.921401]  [<ffffffff813eca86>] ? power_supply_register+0xb7/0x101
kernel: [ 9726.921420]  [<ffffffffa0197276>] ? acpi_ac_add+0xcd/0x113 [ac]
kernel: [ 9726.921435]  [<ffffffff812a2338>] ? acpi_device_probe+0x42/0x10d
kernel: [ 9726.921449]  [<ffffffff8131d0b7>] ? driver_probe_device+0xa8/0x138
kernel: [ 9726.921462]  [<ffffffff8131d196>] ? __driver_attach+0x4f/0x6f
kernel: [ 9726.921474]  [<ffffffff8131d147>] ? driver_probe_device+0x138/0x138
kernel: [ 9726.921487]  [<ffffffff8131c38e>] ? bus_for_each_dev+0x48/0x74
kernel: [ 9726.921501]  [<ffffffff8131ca38>] ? bus_add_driver+0xb3/0x203
kernel: [ 9726.921516]  [<ffffffffa0006000>] ? 0xffffffffa0005fff
kernel: [ 9726.921528]  [<ffffffff8131d63c>] ? driver_register+0x8d/0xf5
kernel: [ 9726.921540]  [<ffffffffa0006000>] ? 0xffffffffa0005fff
kernel: [ 9726.921556]  [<ffffffffa000601f>] ? acpi_ac_init+0x1f/0x1000 [ac]
kernel: [ 9726.921568]  [<ffffffff810002e9>] ? do_one_initcall+0x79/0x12c
kernel: [ 9726.921583]  [<ffffffff81066fd2>] ? sys_init_module+0xd9/0x224
kernel: [ 9726.921599]  [<ffffffff8153c37b>] ? system_call_fastpath+0x16/0x1b
kernel: [ 9726.921609] ---[ end trace 17817954cf45fdc3 ]---
kernel: [ 9726.981193] ACPI: AC Adapter [ACAD] (off-line)


Side note
=========

In acpi_ac_add I would expect the check on result to be inside the ifdef.

#ifdef CONFIG_ACPI_PROCFS_POWER
    result = acpi_ac_add_fs(device);
#endif
    if (result)
        goto end;

-- 
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
acpi-bugzilla mailing list
acpi-bugzilla@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/acpi-bugzilla

Reply via email to