diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-17 02:17:40 +0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-17 02:17:40 +0400 |
commit | e533b227055598b1f7dc8503a3b4f36b14b9da8a (patch) | |
tree | 28fec4125eac45c8e2fac75b3d10ff5cd987d2f6 /drivers/firmware | |
parent | 0999d978dcdcf59350dafa25afd70def9f924eee (diff) | |
parent | 6b2ada82101a08e2830fb29d7dc9b858be637dd4 (diff) | |
download | linux-e533b227055598b1f7dc8503a3b4f36b14b9da8a.tar.xz |
Merge branch 'core-v28-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'core-v28-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
do_generic_file_read: s/EINTR/EIO/ if lock_page_killable() fails
softirq, warning fix: correct a format to avoid a warning
softirqs, debug: preemption check
x86, pci-hotplug, calgary / rio: fix EBDA ioremap()
IO resources, x86: ioremap sanity check to catch mapping requests exceeding, fix
IO resources, x86: ioremap sanity check to catch mapping requests exceeding the BAR sizes
softlockup: Documentation/sysctl/kernel.txt: fix softlockup_thresh description
dmi scan: warn about too early calls to dmi_check_system()
generic: redefine resource_size_t as phys_addr_t
generic: make PFN_PHYS explicitly return phys_addr_t
generic: add phys_addr_t for holding physical addresses
softirq: allocate less vectors
IO resources: fix/remove printk
printk: robustify printk, update comment
printk: robustify printk, fix #2
printk: robustify printk, fix
printk: robustify printk
Fixed up conflicts in:
arch/powerpc/include/asm/types.h
arch/powerpc/platforms/Kconfig.cputype
manually.
Diffstat (limited to 'drivers/firmware')
-rw-r--r-- | drivers/firmware/dmi_scan.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c index 455575be3560..3e526b6d00cb 100644 --- a/drivers/firmware/dmi_scan.c +++ b/drivers/firmware/dmi_scan.c @@ -15,6 +15,11 @@ */ static char dmi_empty_string[] = " "; +/* + * Catch too early calls to dmi_check_system(): + */ +static int dmi_initialized; + static const char * __init dmi_string_nosave(const struct dmi_header *dm, u8 s) { const u8 *bp = ((u8 *) dm) + dm->length; @@ -366,7 +371,7 @@ void __init dmi_scan_machine(void) if (efi_enabled) { if (efi.smbios == EFI_INVALID_TABLE_ADDR) - goto out; + goto error; /* This is called as a core_initcall() because it isn't * needed during early boot. This also means we can @@ -374,13 +379,13 @@ void __init dmi_scan_machine(void) */ p = dmi_ioremap(efi.smbios, 32); if (p == NULL) - goto out; + goto error; rc = dmi_present(p + 0x10); /* offset of _DMI_ string */ dmi_iounmap(p, 32); if (!rc) { dmi_available = 1; - return; + goto out; } } else { @@ -391,19 +396,22 @@ void __init dmi_scan_machine(void) */ p = dmi_ioremap(0xF0000, 0x10000); if (p == NULL) - goto out; + goto error; for (q = p; q < p + 0x10000; q += 16) { rc = dmi_present(q); if (!rc) { dmi_available = 1; dmi_iounmap(p, 0x10000); - return; + goto out; } } dmi_iounmap(p, 0x10000); } - out: printk(KERN_INFO "DMI not present or invalid.\n"); + error: + printk(KERN_INFO "DMI not present or invalid.\n"); + out: + dmi_initialized = 1; } /** @@ -424,6 +432,8 @@ int dmi_check_system(const struct dmi_system_id *list) int i, count = 0; const struct dmi_system_id *d = list; + WARN(!dmi_initialized, KERN_ERR "dmi check: not initialized yet.\n"); + while (d->ident) { for (i = 0; i < ARRAY_SIZE(d->matches); i++) { int s = d->matches[i].slot; |