aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/firmware/dmi_scan.c22
-rw-r--r--drivers/pci/hotplug/ibmphp_ebda.c2
-rw-r--r--drivers/pci/setup-bus.c9
3 files changed, 21 insertions, 12 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 @@
15 */ 15 */
16static char dmi_empty_string[] = " "; 16static char dmi_empty_string[] = " ";
17 17
18/*
19 * Catch too early calls to dmi_check_system():
20 */
21static int dmi_initialized;
22
18static const char * __init dmi_string_nosave(const struct dmi_header *dm, u8 s) 23static const char * __init dmi_string_nosave(const struct dmi_header *dm, u8 s)
19{ 24{
20 const u8 *bp = ((u8 *) dm) + dm->length; 25 const u8 *bp = ((u8 *) dm) + dm->length;
@@ -366,7 +371,7 @@ void __init dmi_scan_machine(void)
366 371
367 if (efi_enabled) { 372 if (efi_enabled) {
368 if (efi.smbios == EFI_INVALID_TABLE_ADDR) 373 if (efi.smbios == EFI_INVALID_TABLE_ADDR)
369 goto out; 374 goto error;
370 375
371 /* This is called as a core_initcall() because it isn't 376 /* This is called as a core_initcall() because it isn't
372 * needed during early boot. This also means we can 377 * needed during early boot. This also means we can
@@ -374,13 +379,13 @@ void __init dmi_scan_machine(void)
374 */ 379 */
375 p = dmi_ioremap(efi.smbios, 32); 380 p = dmi_ioremap(efi.smbios, 32);
376 if (p == NULL) 381 if (p == NULL)
377 goto out; 382 goto error;
378 383
379 rc = dmi_present(p + 0x10); /* offset of _DMI_ string */ 384 rc = dmi_present(p + 0x10); /* offset of _DMI_ string */
380 dmi_iounmap(p, 32); 385 dmi_iounmap(p, 32);
381 if (!rc) { 386 if (!rc) {
382 dmi_available = 1; 387 dmi_available = 1;
383 return; 388 goto out;
384 } 389 }
385 } 390 }
386 else { 391 else {
@@ -391,19 +396,22 @@ void __init dmi_scan_machine(void)
391 */ 396 */
392 p = dmi_ioremap(0xF0000, 0x10000); 397 p = dmi_ioremap(0xF0000, 0x10000);
393 if (p == NULL) 398 if (p == NULL)
394 goto out; 399 goto error;
395 400
396 for (q = p; q < p + 0x10000; q += 16) { 401 for (q = p; q < p + 0x10000; q += 16) {
397 rc = dmi_present(q); 402 rc = dmi_present(q);
398 if (!rc) { 403 if (!rc) {
399 dmi_available = 1; 404 dmi_available = 1;
400 dmi_iounmap(p, 0x10000); 405 dmi_iounmap(p, 0x10000);
401 return; 406 goto out;
402 } 407 }
403 } 408 }
404 dmi_iounmap(p, 0x10000); 409 dmi_iounmap(p, 0x10000);
405 } 410 }
406 out: printk(KERN_INFO "DMI not present or invalid.\n"); 411 error:
412 printk(KERN_INFO "DMI not present or invalid.\n");
413 out:
414 dmi_initialized = 1;
407} 415}
408 416
409/** 417/**
@@ -424,6 +432,8 @@ int dmi_check_system(const struct dmi_system_id *list)
424 int i, count = 0; 432 int i, count = 0;
425 const struct dmi_system_id *d = list; 433 const struct dmi_system_id *d = list;
426 434
435 WARN(!dmi_initialized, KERN_ERR "dmi check: not initialized yet.\n");
436
427 while (d->ident) { 437 while (d->ident) {
428 for (i = 0; i < ARRAY_SIZE(d->matches); i++) { 438 for (i = 0; i < ARRAY_SIZE(d->matches); i++) {
429 int s = d->matches[i].slot; 439 int s = d->matches[i].slot;
diff --git a/drivers/pci/hotplug/ibmphp_ebda.c b/drivers/pci/hotplug/ibmphp_ebda.c
index 8467d0287325..7d27631e6e62 100644
--- a/drivers/pci/hotplug/ibmphp_ebda.c
+++ b/drivers/pci/hotplug/ibmphp_ebda.c
@@ -276,7 +276,7 @@ int __init ibmphp_access_ebda (void)
276 iounmap (io_mem); 276 iounmap (io_mem);
277 debug ("returned ebda segment: %x\n", ebda_seg); 277 debug ("returned ebda segment: %x\n", ebda_seg);
278 278
279 io_mem = ioremap (ebda_seg<<4, 65000); 279 io_mem = ioremap(ebda_seg<<4, 1024);
280 if (!io_mem ) 280 if (!io_mem )
281 return -ENOMEM; 281 return -ENOMEM;
282 next_offset = 0x180; 282 next_offset = 0x180;
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
index 3abbfad9ddab..d5e2106760f8 100644
--- a/drivers/pci/setup-bus.c
+++ b/drivers/pci/setup-bus.c
@@ -378,11 +378,10 @@ static int pbus_size_mem(struct pci_bus *bus, unsigned long mask, unsigned long
378 align = 0; 378 align = 0;
379 min_align = 0; 379 min_align = 0;
380 for (order = 0; order <= max_order; order++) { 380 for (order = 0; order <= max_order; order++) {
381#ifdef CONFIG_RESOURCES_64BIT 381 resource_size_t align1 = 1;
382 resource_size_t align1 = 1ULL << (order + 20); 382
383#else 383 align1 <<= (order + 20);
384 resource_size_t align1 = 1U << (order + 20); 384
385#endif
386 if (!align) 385 if (!align)
387 min_align = align1; 386 min_align = align1;
388 else if (ALIGN(align + min_align, min_align) < align1) 387 else if (ALIGN(align + min_align, min_align) < align1)