Hello,
bugzilla.kernel.org now being down for several weeks I am hoping I have
found the correct place to discuss my issue with battery detection. I have
found a solution to the problem (see solutions 3.), but if a patch is
already available, please let me know so.
Regards
Harald Brennich
Problem:
The battery is not automatically detected on starting the system.
/sys/class/power_supply/BAT1/ is empty.
Environment:
Hardware: Toshiba Satellite L755-161 notebook
System: openSuse 11.4
Kernel: 3.1.0-rc5-1-vanilla
Symptoms:
On start of Windows 7, the battery state is shown correctly. On start of
Linux, the system says battery not present. The battery is present and
correctly described only after one of the following actions is taken with
Linux:
1. Open the lid of the notebook
2. Unplug an plug the external power ("AC")
3. Start the system without the battery. Shutdown and start again with
battery.
The first two are to be done with a running system, of course. The third
only shows the battery for the first start after the shutdown.
Cause:
Methods _STA and _BST of device BAT1 (Battery) return the current value
only if flag BTIN has been set. This flag is set by method BSTA of device
BAT1. BSTA is called by methods _Q09 and _Q20 of device EC (Embedded
Control).
Solutions:
1. Call method BSTA in function acpi_battery_add of drivers/acpi/battery.c
This works fine.
However, this is specific code and will not work with other hardware.
2. When a query method of Embedded Control is registered
(acpi_ec_register_query_methods), immediately call it
(acpi_evaluate_object(handle, NULL, NULL, NULL)).
This also works fine.
Compared to procedure (1) this has the advantage that it is not hardware
specific. It possibly has the disadvantage that calling a query method
might be harmful.
3. Though proceeding as in (1) or (2) works and (2) is not explicitly
dependent on hardware specifics, considering the freedom that the DSDT
language grants to implement features not mentioned in the specs (like the
above mentioned BSTA method), to achieve the goals cited in
"In the early days of Linux/ACPI, DSDT modifications were common to work
around both BIOS bugs and Linux bugs. However, the stated goal of the
Linux/ACPI project today is that Linux should run on un-modified firmware.
Thus, the DSDT database at the old http://acpi.sourceforge.net web site is
now largely a historical artifact."
(cited from http://www.lesswatts.org/projects/acpi/overridingDSDT.php)
it may be necessary to use kernel parameters to control DSDT handling.
Therefore, I have defined kernel parameters acpi.ec_query_on_register
and/or acpi.bat_init_state_method.
3.1 When acpi.ec_query_on_register is defined, on registering a query
method of Embedded Control(acpi_ec_register_query_methods), depending on
the contents of acpi.ec_query_on_register the following is done:
- acpi.ec_register_query_methods is empty:
All query methods of Embedded Control are called
- acpi.ec_register_query_methods is not empty and does not start with !:
Query method of Embedded Control is called if its name (something like
_QXX where the Xs are hexadecimal digits) is in
acpi.ec_register_query_methods
- acpi.ec_register_query_methods is not empty and does start with !:
Query method of Embedded Control is called if its name is not in
acpi.ec_register_query_methods
3.2 In function acpi_battery_add the function acpi_battery_init_state with
parameter acpi.bat_init_state_method is called if
acpi.bat_init_state_method is not null and not empty. The function
acpi_battery_init_state calls the DSTD method with the name
acpi.bat_init_state_method.
Both methods work fine and allow to take care of DSTS specifics via kernel
parameters.
--
Erstellt mit Operas revolutionärem E-Mail-Modul: http://www.opera.com/mail/
--
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