Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ACPI: Remove ACPI_CUSTOM_DSDT_INITRD option

This essentially reverts commit 71fc47a9adf8ee89e5c96a47222915c5485ac437
("ACPI: basic initramfs DSDT override support"), because the code simply
isn't ready.

It did ugly things to the init sequence to populate the rootfs image
early, but that just ended up showing other problems with the whole
approach. The fact is, the VFS layer simply isn't initialized this
early, and the relevant ACPI code should either run much later, or this
shouldn't be done at all.

For 2.6.25, we'll just pick the latter option. We can revisit this
concept later if necessary.

Cc: Dave Hansen <haveblue@us.ibm.com>
Cc: Tilman Schmidt <tilman@imap.cc>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Thomas Renninger <trenn@suse.de>
Cc: Eric Piel <eric.piel@tremplin-utc.net>
Cc: Len Brown <len.brown@intel.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Markus Gaugusch <dsdt@gaugusch.at>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

+3 -165
+2 -10
Documentation/acpi/dsdt-override.txt
··· 1 - Linux supports two methods of overriding the BIOS DSDT: 1 + Linux supports a method of overriding the BIOS DSDT: 2 2 3 3 CONFIG_ACPI_CUSTOM_DSDT builds the image into the kernel. 4 4 5 - CONFIG_ACPI_CUSTOM_DSDT_INITRD adds the image to the initrd. 6 - 7 - When to use these methods is described in detail on the 5 + When to use this method is described in detail on the 8 6 Linux/ACPI home page: 9 7 http://www.lesswatts.org/projects/acpi/overridingDSDT.php 10 - 11 - Note that if both options are used, the DSDT supplied 12 - by the INITRD method takes precedence. 13 - 14 - Documentation/initramfs-add-dsdt.sh is provided for convenience 15 - for use with the CONFIG_ACPI_CUSTOM_DSDT_INITRD method.
-43
Documentation/acpi/initramfs-add-dsdt.sh
··· 1 - #!/bin/bash 2 - # Adds a DSDT file to the initrd (if it's an initramfs) 3 - # first argument is the name of archive 4 - # second argument is the name of the file to add 5 - # The file will be copied as /DSDT.aml 6 - 7 - # 20060126: fix "Premature end of file" with some old cpio (Roland Robic) 8 - # 20060205: this time it should really work 9 - 10 - # check the arguments 11 - if [ $# -ne 2 ]; then 12 - program_name=$(basename $0) 13 - echo "\ 14 - $program_name: too few arguments 15 - Usage: $program_name initrd-name.img DSDT-to-add.aml 16 - Adds a DSDT file to an initrd (in initramfs format) 17 - 18 - initrd-name.img: filename of the initrd in initramfs format 19 - DSDT-to-add.aml: filename of the DSDT file to add 20 - " 1>&2 21 - exit 1 22 - fi 23 - 24 - # we should check it's an initramfs 25 - 26 - tempcpio=$(mktemp -d) 27 - # cleanup on exit, hangup, interrupt, quit, termination 28 - trap 'rm -rf $tempcpio' 0 1 2 3 15 29 - 30 - # extract the archive 31 - gunzip -c "$1" > "$tempcpio"/initramfs.cpio || exit 1 32 - 33 - # copy the DSDT file at the root of the directory so that we can call it "/DSDT.aml" 34 - cp -f "$2" "$tempcpio"/DSDT.aml 35 - 36 - # add the file 37 - cd "$tempcpio" 38 - (echo DSDT.aml | cpio --quiet -H newc -o -A -O "$tempcpio"/initramfs.cpio) || exit 1 39 - cd "$OLDPWD" 40 - 41 - # re-compress the archive 42 - gzip -c "$tempcpio"/initramfs.cpio > "$1" 43 -
-3
Documentation/kernel-parameters.txt
··· 177 177 178 178 acpi_no_auto_ssdt [HW,ACPI] Disable automatic loading of SSDT 179 179 180 - acpi_no_initrd_override [KNL,ACPI] 181 - Disable loading custom ACPI tables from the initramfs 182 - 183 180 acpi_os_name= [HW,ACPI] Tell ACPI BIOS the name of the OS 184 181 Format: To spoof as Windows 98: ="Microsoft Windows" 185 182
-11
drivers/acpi/Kconfig
··· 300 300 bool 301 301 default ACPI_CUSTOM_DSDT_FILE != "" 302 302 303 - config ACPI_CUSTOM_DSDT_INITRD 304 - bool "Read Custom DSDT from initramfs" 305 - depends on BLK_DEV_INITRD 306 - default n 307 - help 308 - This option supports a custom DSDT by optionally loading it from initrd. 309 - See Documentation/acpi/dsdt-override.txt 310 - 311 - If you are not using this feature now, but may use it later, 312 - it is safe to say Y here. 313 - 314 303 config ACPI_BLACKLIST_YEAR 315 304 int "Disable ACPI for systems before Jan 1st this year" if X86_32 316 305 default 0
-84
drivers/acpi/osl.c
··· 91 91 #define OSI_STRING_LENGTH_MAX 64 /* arbitrary */ 92 92 static char osi_additional_string[OSI_STRING_LENGTH_MAX]; 93 93 94 - #ifdef CONFIG_ACPI_CUSTOM_DSDT_INITRD 95 - static int acpi_no_initrd_override; 96 - #endif 97 - 98 94 /* 99 95 * "Ode to _OSI(Linux)" 100 96 * ··· 320 324 return AE_OK; 321 325 } 322 326 323 - #ifdef CONFIG_ACPI_CUSTOM_DSDT_INITRD 324 - static struct acpi_table_header *acpi_find_dsdt_initrd(void) 325 - { 326 - struct file *firmware_file; 327 - mm_segment_t oldfs; 328 - unsigned long len, len2; 329 - struct acpi_table_header *dsdt_buffer, *ret = NULL; 330 - struct kstat stat; 331 - char *ramfs_dsdt_name = "/DSDT.aml"; 332 - 333 - printk(KERN_INFO PREFIX "Checking initramfs for custom DSDT\n"); 334 - 335 - /* 336 - * Never do this at home, only the user-space is allowed to open a file. 337 - * The clean way would be to use the firmware loader. 338 - * But this code must be run before there is any userspace available. 339 - * A static/init firmware infrastructure doesn't exist yet... 340 - */ 341 - if (vfs_stat(ramfs_dsdt_name, &stat) < 0) 342 - return ret; 343 - 344 - len = stat.size; 345 - /* check especially against empty files */ 346 - if (len <= 4) { 347 - printk(KERN_ERR PREFIX "Failed: DSDT only %lu bytes.\n", len); 348 - return ret; 349 - } 350 - 351 - firmware_file = filp_open(ramfs_dsdt_name, O_RDONLY, 0); 352 - if (IS_ERR(firmware_file)) { 353 - printk(KERN_ERR PREFIX "Failed to open %s.\n", ramfs_dsdt_name); 354 - return ret; 355 - } 356 - 357 - dsdt_buffer = kmalloc(len, GFP_ATOMIC); 358 - if (!dsdt_buffer) { 359 - printk(KERN_ERR PREFIX "Failed to allocate %lu bytes.\n", len); 360 - goto err; 361 - } 362 - 363 - oldfs = get_fs(); 364 - set_fs(KERNEL_DS); 365 - len2 = vfs_read(firmware_file, (char __user *)dsdt_buffer, len, 366 - &firmware_file->f_pos); 367 - set_fs(oldfs); 368 - if (len2 < len) { 369 - printk(KERN_ERR PREFIX "Failed to read %lu bytes from %s.\n", 370 - len, ramfs_dsdt_name); 371 - ACPI_FREE(dsdt_buffer); 372 - goto err; 373 - } 374 - 375 - printk(KERN_INFO PREFIX "Found %lu byte DSDT in %s.\n", 376 - len, ramfs_dsdt_name); 377 - ret = dsdt_buffer; 378 - err: 379 - filp_close(firmware_file, NULL); 380 - return ret; 381 - } 382 - #endif 383 - 384 327 acpi_status 385 328 acpi_os_table_override(struct acpi_table_header * existing_table, 386 329 struct acpi_table_header ** new_table) ··· 333 398 if (strncmp(existing_table->signature, "DSDT", 4) == 0) 334 399 *new_table = (struct acpi_table_header *)AmlCode; 335 400 #endif 336 - #ifdef CONFIG_ACPI_CUSTOM_DSDT_INITRD 337 - if ((strncmp(existing_table->signature, "DSDT", 4) == 0) && 338 - !acpi_no_initrd_override) { 339 - struct acpi_table_header *initrd_table; 340 - 341 - initrd_table = acpi_find_dsdt_initrd(); 342 - if (initrd_table) 343 - *new_table = initrd_table; 344 - } 345 - #endif 346 401 if (*new_table != NULL) { 347 402 printk(KERN_WARNING PREFIX "Override [%4.4s-%8.8s], " 348 403 "this is unsafe: tainting kernel\n", ··· 342 417 } 343 418 return AE_OK; 344 419 } 345 - 346 - #ifdef CONFIG_ACPI_CUSTOM_DSDT_INITRD 347 - static int __init acpi_no_initrd_override_setup(char *s) 348 - { 349 - acpi_no_initrd_override = 1; 350 - return 1; 351 - } 352 - __setup("acpi_no_initrd_override", acpi_no_initrd_override_setup); 353 - #endif 354 420 355 421 static irqreturn_t acpi_irq(int irq, void *dev_id) 356 422 {
+1 -7
init/initramfs.c
··· 538 538 initrd_end = 0; 539 539 } 540 540 541 - int __init populate_rootfs(void) 541 + static int __init populate_rootfs(void) 542 542 { 543 543 char *err = unpack_to_rootfs(__initramfs_start, 544 544 __initramfs_end - __initramfs_start, 0); ··· 577 577 } 578 578 return 0; 579 579 } 580 - #ifndef CONFIG_ACPI_CUSTOM_DSDT_INITRD 581 - /* 582 - * if this option is enabled, populate_rootfs() is called _earlier_ in the 583 - * boot sequence. This insures that the ACPI initialisation can find the file. 584 - */ 585 580 rootfs_initcall(populate_rootfs); 586 - #endif
-7
init/main.c
··· 102 102 extern void tc_init(void); 103 103 #endif 104 104 105 - #ifdef CONFIG_ACPI_CUSTOM_DSDT_INITRD 106 - extern int populate_rootfs(void); 107 - #else 108 - static inline void populate_rootfs(void) {} 109 - #endif 110 - 111 105 enum system_states system_state; 112 106 EXPORT_SYMBOL(system_state); 113 107 ··· 644 650 645 651 check_bugs(); 646 652 647 - populate_rootfs(); /* For DSDT override from initramfs */ 648 653 acpi_early_init(); /* before LAPIC and SMP init */ 649 654 650 655 /* Do the rest non-__init'ed, we're now alive */