move DMI scan before other subsystem init (especially PnP)
Subsystems (3)
PATCH 1/1 move DMI scan before other subsystem init (especially PnP)
The attached patch makes the DMI scan routines to be called before other subsystems get initialized (I've done this since PnP initialization is dependent on DMI variable is_sony_vaio_laptop to be set, for this subsystem to work).
Since there are other subsystems that may need some DMI idents in their initializations, and the DMI routines don't depend on other subsystem, I've put them at the top of the list, before pci_init, sbus_init etc. I hope nothing got broken in the process.
The patch includes also some additionnal cleanups in sonypi/pnp drivers which reference some DMI exported symbols.
Please review for corectness and apply if all is OK.
Stelian.
arch/i386/kernel/dmi_scan.c +2 -3
@@ -9,6 +9,7 @@#include <linux/pm.h> #include <linux/keyboard.h> #include <asm/keyboard.h> +#include <asm/system.h> unsigned long dmi_broken;
@@ -687,12 +688,10 @@ } } -static int __init dmi_scan_machine (void ) +int __init dmi_scan_machine (void ) {int err =dmi_iterate (dmi_decode);if (err ==0 )dmi_check_blacklist ();return err; } - -module_init (dmi_scan_machine);
arch/i386/kernel/i386_ksyms.c +1 -1
@@ -29,6 +29,7 @@#include <asm/pgtable.h> #include <asm/pgalloc.h> #include <asm/page.h> +#include <asm/system.h> extern void dump_thread (struct pt_regs *,struct user *);extern spinlock_t rtc_lock;
@@ -171,6 +172,5 @@EXPORT_SYMBOL (do_BUG);#endif -extern int is_sony_vaio_laptop;EXPORT_SYMBOL (is_sony_vaio_laptop);
drivers/char/sonypi.c +1 -1
@@ -39,6 +39,7 @@#include <linux/delay.h> #include <asm/uaccess.h> #include <asm/io.h> +#include <asm/system.h> #include "sonypi.h" #include <linux/sonypi.h>
@@ -48,7 +49,6 @@static int verbose;/* = 0 */ static int fnkeyinit;/* = 0 */ static int camera;/* = 0 */ -extern int is_sony_vaio_laptop;/* set in DMI table parse routines */ /* Inits the queue */ static inline void sonypi_initq (void ) {
drivers/pnp/pnp_bios.c +1 -2
@@ -44,12 +44,11 @@#include <linux/kmod.h> #include <linux/completion.h> #include <linux/spinlock.h> +#include <asm/system.h> /* PnP bios signature: "$PnP" */ #define PNP_SIGNATURE (('$' << 0) + ('P' << 8) + ('n' << 16) + ('P' << 24)) -extern int is_sony_vaio_laptop; -static void pnpbios_build_devlist (void );/*
include/asm-i386/system.h +4 -0
@@ -3,6 +3,7 @@#include <linux/config.h> #include <linux/kernel.h> +#include <linux/init.h> #include <asm/segment.h> #include <linux/bitops.h> /* for LOCK_PREFIX */
@@ -349,7 +350,10 @@void disable_hlt (void );void enable_hlt (void ); +int __init dmi_scan_machine (void );extern unsigned long dmi_broken; +extern int is_sony_vaio_laptop; +#define BROKEN_ACPI_Sx 0x0001#define BROKEN_INIT_AFTER_S1 0x0002
init/main.c +5 -0
@@ -30,6 +30,7 @@#include <asm/io.h> #include <asm/bugs.h> +#include <asm/system.h> #if defined(CONFIG_ARCH_S390 )#include <asm/s390mach.h>
@@ -785,6 +786,10 @@s390_init_machine_check ();#endif +#if defined(CONFIG_X86 ) +dmi_scan_machine (); +#endif +#ifdef CONFIG_GSC /* * GSC must initialise before PCI. On may HPPA boxes the PCI
Signature · 4 lines
Stelian Pop <[email protected]> |---------------- Free Software Engineer -----------------| | Alcôve - http://www.alcove.com - Tel: +33 1 49 22 68 00 | |------------- Alcôve, liberating software ---------------|