Hi, I am running kernel 3.19-rc1 on a "Mircosoft surface 3" .However recent (23 Nov) changes made in the file 'drivers/acpi/battery.c' in the commit 40e7fcb19293cbdff02c74cb0668413480f82ea1 will prevent the battery of my laptop to be registered. the result in that the Battery driver will deferring the Probing of the device forever. Removing the 2 commited lines (1181) fixes the issues in my case and the battery shows up in '/sys/class/power_supply/BAT0'. Regards -- **dmesg: Warning message before patch below : [ 8551.693540] acpi PNP0C0A:00: Driver battery requests probe deferral **dmesg: After the patch only one message is displayed about the battery : [ 0.600055] ACPI: Battery Slot [BAT0] (battery present) Specific patch reverting the commit: diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c index d98ba43..4983b98 100644 --- a/drivers/acpi/battery.c +++ b/drivers/acpi/battery.c @@ -1181,9 +1181,6 @@ static int acpi_battery_add(struct acpi_device *device) if (!device) return -EINVAL; - if (device->dep_unmet) - return -EPROBE_DEFER; - battery = kzalloc(sizeof(struct acpi_battery), GFP_KERNEL); if (!battery) return -ENOMEM; diff --git a/scripts/depmod.sh b/scripts/depmod.sh index 122599b..9535d73 100755 --- a/scripts/depmod.sh +++ b/scripts/depmod.sh @@ -1,4 +1,5 @@ #!/bin/sh +exit 0 # # A depmod wrapper used by the toplevel Makefile
acpidump please: # acpidump > acpidump.txt
Created attachment 161631 [details] acpidump on laptop See attached
Please try the following patch. diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index cb6066c..7089d38 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c @@ -870,6 +870,8 @@ static int acpi_ec_add(struct acpi_device *device) ret = ec_install_handlers(ec); + acpi_walk_dep_device_list(device->handle); + /* EC is fully operational, allow queries */ clear_bit(EC_FLAGS_QUERY_PENDING, &ec->flags);
Applying the patch fixes the issue !
I have the same problem with MS Surface Pro 3 and 3.19-rc5 kernel
Anton, Can you please try the patch in comment #3? Tianyu, Any plan to upstream the patch?
I had the same problem with MS Surface Pro 3, running 3.19rc1 to 3.19rc5. Then I applied this patch, and my battery icon is now there again. So this patch fixes the issue for me also. Waiting for this fix to make it upstream.
Same problem on 3.19-rc6
trying to apply this patch. no luck can you please provide the syntax or are extra steps needed to apply (patch code in comment 3)- using 3.19RC7 thanks
my patch file that works with 3.19-rc7 https://dl.dropboxusercontent.com/u/4080500/patch/battery.patch
Why is this issue still marked as NEEDINFO? Is there anything else you need? If so, let me know. Looking forward to seeing this mainlined.
I do not have anymore issues. it is just a matter of someone submitting the patch. I believe Lan Tianyu is the best person to do this. If needed I can only submit something next week.
Patch in comment 3 also works with me. (Comment 10 has the same patch?) I can also submit.
Comment 10 has the same patch that works with 3.19.
Is this likely to be committed in a 3.19 patch release? Or are we waiting for 4.0?
This patch is not in 3.19 nor 4.0-RC2. It takes some detective work to find the spot to put it in 4.0 but then it works.
Still an issue with 4.0-RC5 and 3.19.0-10 ... BTW, thank you for filing this and providing the diff ... building my own is a temporary option until this makes it into a release ...
Good news. A patch has been submitted to the mailing list. http://marc.info/?l=linux-acpi&m=142785305602658&w=2 . It still needs to get pulled into Linus kernel tree.
shipped in Linux-4.1-rc1: commit 1c832b3e85b6ac35e5f113fa4204eb725c54794e Author: Lan Tianyu <tianyu.lan@intel.com> Date: Wed Apr 1 09:47:18 2015 +0800 ACPI / EC: Call acpi_walk_dep_device_list() after installing EC opregion handler