ACPI patches for the Samsung P10

[Deutsche ‹bersetzung]
This page is linked by TuxMobil by Werner Heuser. More information on using Linux on Samsung (and other) laptops is available from his site.

 This text regards the "Phoenix BIOS 6.0", version 04AE to 08AE of the Samsung P10 laptop. Other versions may or may not have the same problems and I do not even guarantee that these fixes apply to other laptops than mine that feature the same BIOS version.

BTW: Samsung does provide new BIOS versions from time to time, but don't expect them to fix YOUR problems.

A problem that remains is related to the on-screen status display. With my patch applied, everything works fine - until I press [Fn-F2] which leaves the system absolutely unstable. It tends to crash more or less heavily on the next ACPI event. So, keep in mind that you may have to say good-by to the status display if you want battery status info and thermo control for your OS.

WARNING: BY FOLLOWING THE HINTS IN THIS TEXT YOU CAN SERIOUSLY DAMAGE YOUR LAPTOP.
You have been warned.

Now, this said, when I tried to make ACPI run on my Samsung P10, the first try wasn't that successful. The symptoms were empty directories /proc/acpi/{battery,ac_adapter,thermal_zone}, therefore the system had no information about the status of battery and ac plug or the processor temperature. dmesg showed related error messages for the ACPI system, i.e. things like "method execution failed [\_SB.BAT1._STA] AE_AML_NO_RETURN_VALUE".

Loads of searching on the web and in news groups combined with heavily following the learning-by-doing paradigm, my tests showed that the DSDT (a BIOS table describing the access to the ACPI BIOS routines) was broken.

Finally, I found this Howto that more or less describes what you can do to get to this point.

Anyway, I had no idea about DSL, AML and ACPI in general, so it took me some time to figure out what was going on.

What you have to do:

First of all, start by applying the ACPI patch to a recent kernel, being 2.4.21-pre3 in my case. 2.5.xx already includes most of it, but there are still patches available.

If you want to play with your DSDT, get the Intel iasl compiler (from the ACPI CA unix build environment) and read the above mentioned Howto, configure, compile and install the kernel and reboot. On reboot, there will be some error messages regarding ACPI, but that is not that important for the moment. The important thing is that the system comes up. Now you will find the original DSDT in /proc/acpi/dsdt. It's unreadable, so send it through iasl first. Try to play around with it without damaging your system and do not forget to send a mail to Samsung telling them what you think about broken ACPI implementations.

If you don't want to play but just get everything running, keep the warning in mind and read on.

You may want to compile and boot your new ACPI kernel without trying the following first in order to be able to check whether your DSDT in /proc/acpi/dsdt is the same as the one provided in the archive. If it's not, you're on your own. DO NOT TRY MY CORRECTED DSDT THEN! Rather use iasl to try to figure out if you can fix your own DSDT, maybe by taking a look at the Howto in combination with the diff provided in the tar archives.

Now apply the custom DSDT patch to your ACPI kernel and download the tar archive corresponding to your BIOS version. Then copy the .hex file containing the corrected DSDT into the file drivers/acpi/my-dsdt.hex in the kernel directory. The .hex file has been created using iasl BTW, option "-tc".

Here's the tar archives for the different BIOS versions. Since Samsung does not show a great interest in fixing their broken ACPI implementation, they don't really differ that much:

04AE, 06AE, 07AE

Configure the kernel and be sure to include all ACPI drivers (battery, ac, fan, button, processor, thermal). Run "make dep", recompile the kernel and install it. Don't forget to keep your old kernel usable! Reboot.

Look at the output of dmesg. The ACPI errors like "AE_AML_NO_RETURN_VALUE", etc. should be gone.

Take a look at /proc/acpi. There should be one subdirectory for each driver and there should be at least one subdirectory in each of them (BAT1, ADP1, etc.). Now take a look at some of the files in there to check if the provided information looks fine.

BTW: I didn't get swsusp running so far and didn't try S4BIOS yet. So don't expect to get those working with my patch.

That's all there is. If you have comments, feel free to send them to me, though you may want to ask more general questions in the ACPI mailing lists at Sourceforge. Dont't forget to check their archives as well...

Hope it helps...

by Stefan Behnel, stefan /at/ behnel.de