Bug 3774 - RFE: ability to override SSDT
Summary: RFE: ability to override SSDT
Status: CLOSED CODE_FIX
Alias: None
Product: ACPI
Classification: Unclassified
Component: Config-Tables (show other bugs)
Hardware: i386 Linux
: P2 normal
Assignee: Len Brown
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-19 07:16 UTC by Len Brown
Modified: 2007-08-13 21:19 UTC (History)
2 users (show)

See Also:
Kernel Version: 2.6.9
Subsystem:
Regression: ---
Bisected commit-id:


Attachments
ssdt_override-acpi-2.6.patch (3.22 KB, patch)
2004-11-24 19:10 UTC, Zhu Yi
Details | Diff
ssdt_override-acpica.patch (979 bytes, patch)
2004-11-24 19:12 UTC, Zhu Yi
Details | Diff
ssdt_override-acpi-2.6.patch updated version after review (5.80 KB, patch)
2004-12-06 01:10 UTC, Zhu Yi
Details | Diff
kernel 2.4.29-pre1 with cpufreq and applying override DSDT and SSDT (13.77 KB, text/plain)
2004-12-29 15:54 UTC, Sérgio M Basto
Details
second patch for kernel 2.4 (738 bytes, patch)
2004-12-29 16:02 UTC, Sérgio M Basto
Details | Diff
Extention to implement DSDT or SSDT override (also multiple ones) via initramfs. (8.19 KB, patch)
2007-07-10 07:14 UTC, Thomas Renninger
Details | Diff
2.6.22 patch adding "acpi_no_auto_ssdt" bootparam (1.88 KB, patch)
2007-07-13 13:15 UTC, Len Brown
Details | Diff

Description Len Brown 2004-11-19 07:16:42 UTC
It would be helpful to have an easy method to override the SSDT,
like we have to override the DSDT today.  eg. for BIOS bug 3507

ie.
CONFIG_ACPI_CUSTOM_SSDT
CONFIG_ACPI_CUSTOM_SSDT_FILE
Comment 1 Zhu Yi 2004-11-24 19:10:46 UTC
Created attachment 4136 [details]
ssdt_override-acpi-2.6.patch
Comment 2 Zhu Yi 2004-11-24 19:12:02 UTC
Created attachment 4137 [details]
ssdt_override-acpica.patch
Comment 3 Len Brown 2004-12-01 18:36:07 UTC
need to make the ssdt and dsdt be static/global to different c files.
Comment 4 Zhu Yi 2004-12-06 01:10:30 UTC
Created attachment 4236 [details]
ssdt_override-acpi-2.6.patch updated version after review
Comment 5 Sérgio M Basto 2004-12-28 17:56:11 UTC
Hi, after read bug 3507.
I am prepared to override the DSDT,  putting the stuff found in the SSDT
directly into the DSDT.
In this case, have I to apply the patch ssdt_override-acpica.patch ?

Or should try, only override SSDT patching drivers/acpi/osl.c for SSDT
(http://bugme.osdl.org/show_bug.cgi?id=3507#c41) and apply
ssdt_override-acpica.patch ? 

thanks,
Comment 6 Zhu Yi 2004-12-28 18:24:07 UTC
You need to apply attachment 4137 [details] and attachment 4236 [details] in this bug. Then tell the
kernel where is your ssdt.hex with make menuconfig.
Comment 7 Sérgio M Basto 2004-12-29 15:54:02 UTC
Created attachment 4314 [details]
kernel 2.4.29-pre1 with cpufreq and applying override DSDT and SSDT

still have this warning message 
acpi_processor-0899 [27] acpi_processor_get_per: Unsupported address space
[127] (control_register)
Comment 8 Sérgio M Basto 2004-12-29 16:02:41 UTC
Created attachment 4315 [details]
second patch for kernel 2.4

Note : there is no need include files

just: 
edit DSDT.hex and replace AmlCode to AmlCode2 
cp DSDT.hex /usr/src/linux-2.4.29-pre1/drivers/acpi/tables/acpi_dsdt.c
cp SSDT.hex /usr/src/linux-2.4.29-pre1/drivers/acpi/tables/acpi_ssdt.c
Comment 9 Shaohua 2004-12-29 17:05:13 UTC
>acpi_processor-0899 [27] acpi_processor_get_per: Unsupported address space
>[127] (control_register)
This appears the MSR based CPU frequency issue. I wonder if 2.4 supports it. 
Please try 2.6
Comment 10 Zhu Yi 2004-12-29 18:30:32 UTC
Attachment 4315 [details] is suboptimal because a system might have multiple SSDTs.
Comment 11 Thomas Renninger 2005-06-02 15:56:21 UTC
Zhu:
I tried patch http://bugme.osdl.org/attachment.cgi?id=4236&action=view
on 2.6.11.X and it did not work for me.
I grepped osl.o for SSDT and it matched.
However the bad code in the BIOS SSDT still caused errors.

Is it possible that in lower functions the DSDT code is replaced (only one is
possible?) and the SSDT functions are added (mulitple SSDTs possible?)

I also wonder why the status is fixed, but I couldn't override my SSDT with
2.6.12-rc5 kernel. What is the policy to set a bug resolved fixed?

Thanks.
Comment 12 Zhu Yi 2005-06-02 19:55:47 UTC
DSDT and SSDT can be overwritten at the same time with the patch (select an
AmlCode file for each in menuconfig). If you have multiple SSDTs, you must merge
them into a single AmlCode file. If you choose to overwrite SSDT, ACPI will not
use any SSDT in the BIOS, only uses the one you provided.
Comment 13 Thomas Renninger 2005-06-03 03:43:06 UTC
Strange, I was sure the SSDT was not overridden -> will double check.

Could you also comment on committed code to mm or vanilla, please?
Is this patch somewhere mainstream?
I thought Len is closing the bugs when he submitted code to vanilla/mm?

Can I generally assume to find closed bugzilla code at some specially place?
E.g. in this case it might not go mainline, but help developers and can be found
at some special place?
For discarded code the bug should be closed won't fix or invalid?
Comment 14 Len Brown 2005-07-27 19:17:57 UTC
The problem with this approach is that systems may
have multiple SSDT.  Also DSDT may explicitly Load
the SSDT.

If > 1 SSDT, then an SSDT override is not practical,
and consolidating the code into the DSDT is necessary
in a DSDT override.

If explicitly Loaded SSDT, the DSDT must also be changed
to add the desired SSDT code and to remove the explicit Load.

So in either case, a DSDT override is both necessary and
sufficient, and having the capability to override the SSDT
is not going to help.

ie. what we need is the ability to augment and override the DSDT
(which we already have), and the ability to disable automatically
loading SSDT(s) which are specified in the RSDT.
Comment 15 Sérgio M Basto 2007-02-23 21:52:12 UTC
what is the status of this bug ?
Comment 16 Alexey Starikovskiy 2007-02-23 22:53:04 UTC
There are patches from HP on linux-acpi mail list to skip loading of SSDTs in 
case the DSDT gets overwritten. So, in case you create custom DSDT, and the 
patch is applied, you will need to push all SSDTs into it.
Comment 17 Zhang Rui 2007-07-09 02:32:13 UTC
What's the status of this bug?
Do we still plan to add this function?
IMO, overriding SSDTs is a good idea for some buggy bios.
But it's not easy to make it work, especially for the dynamical SSDTs,
Overriding the static SSDTs only doesn't make sense.
Any ideas? :)
Comment 18 Alexey Starikovskiy 2007-07-09 22:02:30 UTC
Subject: Re:  RFE: ability to override SSDT

bugme-daemon@bugzilla.kernel.org wrote:
> http://bugzilla.kernel.org/show_bug.cgi?id=3774
>
>
>
>
>
> ------- Comment #17 from rui.zhang@intel.com  2007-07-09 02:32 -------
> What's the status of this bug?
> Do we still plan to add this function?
> IMO, overriding SSDTs is a good idea for some buggy bios.
> But it's not easy to make it work, especially for the dynamical SSDTs,
> Overriding the static SSDTs only doesn't make sense.
> Any ideas? :)
>
>
>   
It was decided that if someone wanted to have a custom SSDT, it's easier
to embed it into DSDT and be done.
Namespace will bark on duplicate names, but work.

Regards,
Alex.
Comment 19 Zhang Rui 2007-07-09 22:52:50 UTC
That sounds nice.
So which status should we change this bug to?
Reject it as WILL_NOT_FIX?
Comment 20 Thomas Renninger 2007-07-10 07:14:11 UTC
Created attachment 11992 [details]
Extention to implement DSDT or SSDT override (also multiple ones) via initramfs.

Yes, I know Len does not like this one. Anyway, it might get convenient for Intel people for debug purposes.
Comment 21 Len Brown 2007-07-13 13:15:34 UTC
Created attachment 12032 [details]
2.6.22 patch adding "acpi_no_auto_ssdt" bootparam



see patch header for description.
also, updated the docs  like so:

Developing ACPI for Linux - July 13, 2007
------------------------------------------
Len Brown <lenb@kernel.org> (Intel Open Source Technology Center)

This is how you can be most effective improving Linux ACPI support.

Latest version of this file
---------------------------
http://ftp.kernel.org/pub/linux/kernel/people/lenb/acpi/patches/README.ACPI
...
How to Build a custom DSDT into the kernel
------------------------------------------
Get original DSDT:
# cp /proc/acpi/dsdt DSDT
or
# acpidump > acpidump.out
$ acpixtract DSDT acpidump > DSDT

Disassemble it
$ iasl -d DSDT
Make your changes:
$ vi DSDT.dsl
Build it:
$ iasl -tc DSDT.dsl
Put it where the kernel build can include it:
$ cp DSDT.hex $SRC/include/

Add this to the kernel .config:

CONFIG_STANDALONE=n
CONFIG_ACPI_CUSTOM_DSDT=y
CONFIG_ACPI_CUSTOM_DSDT_FILE="DSDT.hex"

Make the kernel and off you go!
You should see in dmesg:
Table [DSDT] replaced by host OS

Note that with
CONFIG_ACPI_DEBUG=y
then ASL stores to the special object "Debug" will
come out in the dmesg.  eg

Store("hello world!", Debug)
Store(Local0, Debug)

[ACPI Debug]  String: [0x0C] "hello world!"
[ACPI Debug]  Integer: 0x00000042

As of linux-2.6.23, "acpi_no_auto_ssdt" if available
to prevent Linux from automatically loading all
the SSDTs listed in the RSDT/XSDT.  So with this option,
the SSDTs can be included in the DSDT override
to effectively create a DSDT+SSDT override.
Comment 22 Len Brown 2007-07-25 21:56:17 UTC
patch in comment #21 applied to acpi-test
Comment 23 Len Brown 2007-08-13 21:19:21 UTC
patch in comment #21 shipped in Linux-2.6.23-rc3
closed.

Note You need to log in before you can comment on or make changes to this bug.