- Disabled custom ACPI table loading from initramfs until
authorJeff Mahoney <jeffm@suse.de>
Fri, 8 Jan 2010 16:09:28 +0000 (17:09 +0100)
committerJeff Mahoney <jeffm@suse.de>
Fri, 8 Jan 2010 16:09:28 +0000 (17:09 +0100)
  the scheduling while atomic issues are worked out.

suse-commit: a2cd49427eefe524bca7cf62472d84fdf5054789

13 files changed:
Documentation/acpi/dsdt-override.txt
Documentation/acpi/initramfs-add-dsdt.sh [deleted file]
Documentation/acpi/table-override.txt [deleted file]
Documentation/kernel-parameters.txt
drivers/acpi/Kconfig
drivers/acpi/bus.c
drivers/acpi/osl.c
include/acpi/acpiosxf.h
include/linux/init.h
include/linux/kmod.h
init/initramfs.c
init/main.c
kernel/kmod.c

index 27ea974..febbb1b 100644 (file)
@@ -1,13 +1,7 @@
-Linux supports two methods of overriding the BIOS DSDT:
+Linux supports a method of overriding the BIOS DSDT:
 
 CONFIG_ACPI_CUSTOM_DSDT builds the image into the kernel.
 
-CONFIG_ACPI_CUSTOM_OVERRIDE_INITRAMFS loads the image from
-the initramfs at boot-time. It is more flexible in that it
-does not need to be built into the kernel and tables other
-than DSDT can potentially be overridden. Please see
-Documentation/acpi/table-override.txt for more information.
-
 When to use this method is described in detail on the
 Linux/ACPI home page:
 http://www.lesswatts.org/projects/acpi/overridingDSDT.php
diff --git a/Documentation/acpi/initramfs-add-dsdt.sh b/Documentation/acpi/initramfs-add-dsdt.sh
deleted file mode 100644 (file)
index 17ef6e8..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/bin/bash
-# Adds a DSDT file to the initrd (if it's an initramfs)
-# first argument is the name of archive
-# second argument is the name of the file to add
-# The file will be copied as /DSDT.aml
-
-# 20060126: fix "Premature end of file" with some old cpio (Roland Robic)
-# 20060205: this time it should really work
-
-# check the arguments
-if [ $# -ne 2 ]; then
-       program_name=$(basename $0)
-       echo "\
-$program_name: too few arguments
-Usage: $program_name initrd-name.img DSDT-to-add.aml
-Adds a DSDT file to an initrd (in initramfs format)
-
-  initrd-name.img: filename of the initrd in initramfs format
-  DSDT-to-add.aml: filename of the DSDT file to add
-  " 1>&2
-    exit 1
-fi
-
-# we should check it's an initramfs
-
-tempcpio=$(mktemp -d)
-# cleanup on exit, hangup, interrupt, quit, termination
-trap 'rm -rf $tempcpio' 0 1 2 3 15
-
-# extract the archive
-gunzip -c "$1" > "$tempcpio"/initramfs.cpio || exit 1
-
-# copy the DSDT file at the root of the directory so that we can call it "/DSDT.aml"
-cp -f "$2" "$tempcpio"/DSDT.aml
-
-# add the file
-cd "$tempcpio"
-(echo DSDT.aml | cpio --quiet -H newc -o -A -O "$tempcpio"/initramfs.cpio) || exit 1
-cd "$OLDPWD"
-
-# re-compress the archive
-gzip -c "$tempcpio"/initramfs.cpio > "$1"
-
diff --git a/Documentation/acpi/table-override.txt b/Documentation/acpi/table-override.txt
deleted file mode 100644 (file)
index 38aa68a..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-CONFIG_ACPI_CUSTOM_OVERRIDE_INITRAMFS provides a mechanism for
-the user to add table images to the initramfs for loading at
-runtime. Tables used before expansion of the initramfs may not
-be replaced. Fortunately this list is small and the one most
-typically used, DSDT, is not one of them.
-
-In order to override a table, the image must be placed in the root
-of the initramfs with a filename of <table-name>.aml (e.g. DSDT.aml).
-
-As the ACPI subsystem initializes, it will load the tables into memory
-and override them as the tables are needed.
-
-This option takes precedence over the in-kernel method provided by
-the ACPI_CUSTOM_DSDT config option.
-
-When to use these methods is described in detail on the
-Linux/ACPI home page:
-http://www.lesswatts.org/projects/acpi/overridingDSDT.php
-
-Documentation/initramfs-add-dsdt.sh is provided for convenience
-for use with the CONFIG_ACPI_CUSTOM_OVERRIDE_INITRAMFS method.
index 316caf2..f8a12ff 100644 (file)
@@ -217,10 +217,6 @@ and is between 256 and 4096 characters. It is defined in the file
 
        acpi_no_auto_ssdt       [HW,ACPI] Disable automatic loading of SSDT
 
-       acpi_no_initrd_override         [KNL,ACPI]
-       acpi_no_initramfs_override      [KNL,ACPI]
-                       Disable loading custom ACPI tables from the initramfs
-
        acpi_os_name=   [HW,ACPI] Tell ACPI BIOS the name of the OS
                        Format: To spoof as Windows 98: ="Microsoft Windows"
 
index 22f666e..0962bbd 100644 (file)
@@ -260,19 +260,6 @@ config ACPI_CUSTOM_DSDT
        bool
        default ACPI_CUSTOM_DSDT_FILE != ""
 
-config ACPI_CUSTOM_OVERRIDE_INITRAMFS
-       bool "Load ACPI override tables from initramfs"
-       depends on BLK_DEV_INITRD
-       default n
-       help
-         This option supports loading custom replacement tables by optionally
-         loading them from the initramfs.
-
-         See Documentation/acpi/table-override.txt
-
-         If you are not using this feature now, but may use it later,
-         it is safe to say Y here.
-
 config ACPI_BLACKLIST_YEAR
        int "Disable ACPI for systems before Jan 1st this year" if X86_32
        default 0
index 1778b85..7411915 100644 (file)
@@ -665,13 +665,6 @@ void __init acpi_early_init(void)
                goto error0;
        }
 
-       status = acpi_load_override_tables();
-       if (ACPI_FAILURE(status)) {
-               printk(KERN_ERR PREFIX
-                       "Unable to load Override Tables\n");
-               goto error0;
-       }
-
        status = acpi_load_tables();
        if (ACPI_FAILURE(status)) {
                printk(KERN_ERR PREFIX
index a078fee..cf0fa1b 100644 (file)
@@ -43,7 +43,6 @@
 #include <linux/list.h>
 #include <linux/jiffies.h>
 #include <linux/semaphore.h>
-#include <linux/syscalls.h>
 
 #include <asm/io.h>
 #include <asm/uaccess.h>
 #include <acpi/acpi_bus.h>
 #include <acpi/processor.h>
 
-/* We need these to manipulate the global table array. The existing
- * accessors in acpica/ only pass back the table header and we need
- * the descriptor. */
-#include "acpica/acconfig.h"
-#include "acpica/aclocal.h"
-#include "acpica/acglobal.h"
-#include "acpica/acutils.h"
-#include "acpica/actables.h"
-
 #define _COMPONENT             ACPI_OS_SERVICES
 ACPI_MODULE_NAME("osl");
 #define PREFIX         "ACPI: "
@@ -108,23 +98,6 @@ static DEFINE_SPINLOCK(acpi_res_lock);
 #define        OSI_STRING_LENGTH_MAX 64        /* arbitrary */
 static char osi_additional_string[OSI_STRING_LENGTH_MAX];
 
-#ifdef CONFIG_ACPI_CUSTOM_OVERRIDE_INITRAMFS
-static int acpi_no_initrd_override;
-static int __init acpi_no_initrd_override_setup(char *s)
-{
-       acpi_no_initrd_override = 1;
-       return 1;
-}
-
-static int __init acpi_no_initramfs_override_setup(char *s)
-{
-       return acpi_no_initrd_override_setup(s);
-}
-
-__setup("acpi_no_initrd_override", acpi_no_initrd_override_setup);
-__setup("acpi_no_initramfs_override", acpi_no_initramfs_override_setup);
-#endif
-
 /*
  * The story of _OSI(Linux)
  *
@@ -379,144 +352,6 @@ acpi_os_predefined_override(const struct acpi_predefined_names *init_val,
        return AE_OK;
 }
 
-#ifdef CONFIG_ACPI_CUSTOM_OVERRIDE_INITRAMFS
-struct acpi_override_table_entry
-{
-       const char *name;
-       struct acpi_table_header *table;
-};
-
-static struct acpi_override_table_entry acpi_override_table_entries[] = {
-       { .name = "DSDT", },
-       {}
-};
-
-acpi_status __init
-acpi_load_one_override_table(struct acpi_override_table_entry *entry)
-{
-       int fd, ret;
-       acpi_status err = AE_OK;
-       char filename[10]; /* /DSDT.aml\0 */
-       struct kstat stat;
-
-       snprintf(filename, sizeof(filename), "/%.4s.aml", entry->name);
-
-       fd = sys_open(filename, O_RDONLY, 0);
-       if (fd < 0)
-               return AE_NOT_FOUND;
-
-       ret = vfs_fstat(fd, &stat);
-       if (ret < 0) {
-               printk(KERN_ERR "ACPI: fstat failed while trying to read %s\n",
-                      filename);
-               err = AE_ERROR;
-               goto out;
-       }
-
-       entry->table = kmalloc(stat.size, GFP_KERNEL);
-       if (!entry->table) {
-               printk(KERN_ERR "ACPI: Could not allocate memory to "
-                      "override %s\n", entry->name);
-               err = AE_NO_MEMORY;
-               goto out;
-       }
-
-       ret = sys_read(fd, (char *)entry->table, stat.size);
-       sys_close(fd);
-       if (ret != stat.size) {
-               printk(KERN_ERR "ACPI: Failed to read %s from initramfs\n",
-                      entry->name);
-               err = AE_ERROR;
-               goto out;
-       }
-
-out:
-       if (err != AE_OK) {
-               kfree(entry->table);
-               entry->table = NULL;
-       }
-       sys_close(fd);
-       return ret;
-}
-
-static void __init
-acpi_replace_table(struct acpi_table_desc *table, struct acpi_table_header *new)
-{
-       /* This is the top part of acpi_load_table */
-       memset(table, 0, sizeof(*table));
-       table->address = ACPI_PTR_TO_PHYSADDR(new);
-       table->pointer = new;
-       table->length = new->length;
-       table->flags |= ACPI_TABLE_ORIGIN_OVERRIDE;
-       table->flags |= ACPI_TABLE_ORIGIN_ALLOCATED;
-       memcpy(table->signature.ascii, new->signature, ACPI_NAME_SIZE);
-}
-
-/* This replaces tables already opportunistically loaded, but not used.
- * If the acpica code provided a table descriptor lookup then we wouldn't
- * need to open code this. */
-static void __init
-acpi_override_tables(void)
-{
-       struct acpi_table_header *new = NULL;
-       struct acpi_table_desc *table;
-       acpi_status status;
-       int i;
-
-       /* This is early enough that we don't need the mutex yet */
-       for (i = 0; i < acpi_gbl_root_table_list.count; ++i) {
-               if (acpi_tb_is_table_loaded(i))
-                       continue;
-
-               table = &acpi_gbl_root_table_list.tables[i];
-               if (!table->pointer)
-                       status = acpi_tb_verify_table(table);
-
-               if (ACPI_FAILURE(status) || !table->pointer)
-                       continue;
-
-               status = acpi_os_table_override(table->pointer, &new);
-               if (ACPI_SUCCESS(status) && new) {
-                       acpi_replace_table(table, new);
-                       acpi_tb_print_table_header(table->address, new);
-               }
-       }
-}
-
-acpi_status __init
-acpi_load_override_tables(void)
-{
-       struct acpi_override_table_entry *entry = acpi_override_table_entries;
-       while (entry && entry->name) {
-               acpi_load_one_override_table(entry);
-               entry++;
-       }
-
-       acpi_override_tables();
-       return AE_OK;
-}
-
-static struct acpi_table_header *
-acpi_get_override_table(const char *name)
-{
-       struct acpi_override_table_entry *entry = acpi_override_table_entries;
-
-       while (entry && entry->name) {
-               if (!memcmp(name, entry->name, ACPI_NAME_SIZE))
-                       return entry->table;;
-               entry++;
-       }
-
-       return NULL;
-}
-#else
-acpi_status
-acpi_load_override_tables(void)
-{
-       return AE_OK;
-}
-#endif
-
 acpi_status
 acpi_os_table_override(struct acpi_table_header * existing_table,
                       struct acpi_table_header ** new_table)
@@ -530,10 +365,6 @@ acpi_os_table_override(struct acpi_table_header * existing_table,
        if (strncmp(existing_table->signature, "DSDT", 4) == 0)
                *new_table = (struct acpi_table_header *)AmlCode;
 #endif
-#ifdef CONFIG_ACPI_CUSTOM_OVERRIDE_INITRAMFS
-       if (!acpi_no_initrd_override)
-               *new_table = acpi_get_override_table(existing_table->signature);
-#endif
        if (*new_table != NULL) {
                printk(KERN_WARNING PREFIX "Override [%4.4s-%8.8s], "
                           "this is unsafe: tainting kernel\n",
index b56e6c4..eb0e718 100644 (file)
@@ -92,9 +92,6 @@ acpi_os_predefined_override(const struct acpi_predefined_names *init_val,
                            acpi_string * new_val);
 
 acpi_status
-acpi_load_override_tables(void);
-
-acpi_status
 acpi_os_table_override(struct acpi_table_header *existing_table,
                       struct acpi_table_header **new_table);
 
index 8433889..ff8bde5 100644 (file)
@@ -146,7 +146,6 @@ extern unsigned int reset_devices;
 /* used by init/main.c */
 void setup_arch(char **);
 void prepare_namespace(void);
-int populate_rootfs(void);
 
 extern void (*late_time_init)(void);
 
index 962addc..384ca8b 100644 (file)
@@ -98,6 +98,8 @@ call_usermodehelper_keys(char *path, char **argv, char **envp,
        return call_usermodehelper_exec(info, wait);
 }
 
+extern void usermodehelper_init(void);
+
 struct file;
 extern int call_usermodehelper_pipe(char *path, char *argv[], char *envp[],
                                    struct file **filp);
index 07866de..4c00edc 100644 (file)
@@ -565,7 +565,7 @@ static void __init clean_rootfs(void)
 }
 #endif
 
-int __init populate_rootfs(void)
+static int __init populate_rootfs(void)
 {
        char *err = unpack_to_rootfs(__initramfs_start,
                         __initramfs_end - __initramfs_start);
@@ -605,3 +605,4 @@ int __init populate_rootfs(void)
        }
        return 0;
 }
+rootfs_initcall(populate_rootfs);
index b2d16ac..8f7606d 100644 (file)
@@ -713,15 +713,6 @@ asmlinkage void __init start_kernel(void)
 
        check_bugs();
 
-       /*
-        * Do this before starting ACPI so we can read-in
-        * override tables before the tables are actually
-        * loaded. The usermode helper won't be initialized
-        * until much later so we don't race against things
-        * calling out to userspace.
-        */
-       populate_rootfs();
-
        acpi_early_init(); /* before LAPIC and SMP init */
        sfi_init_late();
 
@@ -819,6 +810,7 @@ static void __init do_basic_setup(void)
 {
        init_workqueues();
        cpuset_init_smp();
+       usermodehelper_init();
        init_tmpfs();
        driver_init();
        init_irq_proc();
index 5a04351..9fcb53a 100644 (file)
@@ -531,10 +531,8 @@ int call_usermodehelper_pipe(char *path, char **argv, char **envp,
 }
 EXPORT_SYMBOL(call_usermodehelper_pipe);
 
-static int __init usermodehelper_init(void)
+void __init usermodehelper_init(void)
 {
        khelper_wq = create_singlethread_workqueue("khelper");
        BUG_ON(!khelper_wq);
-       return 0;
 }
-rootfs_initcall(usermodehelper_init);