diff options
author | Andre Müller <andre.muller@web.de> | 2014-09-09 19:00:22 -0400 |
---|---|---|
committer | Matt Fleming <matt.fleming@intel.com> | 2014-10-03 13:41:03 -0400 |
commit | 77e21e87acec8c857df4bfbc647ea21d0a87364d (patch) | |
tree | 46ab040024983bb6ba250e6096fd1c7db3d483d4 /arch/x86/boot/compressed | |
parent | 4e78eb056136b002ecdfbbf61436fedfb8a3c76b (diff) |
x86/efi: Adding efi_printks on memory allocationa and pci.reads
All other calls to allocate memory seem to make some noise already, with the
exception of two calls (for gop, uga) in the setup_graphics path.
The purpose is to be noisy on worrysome errors immediately.
commit fb86b2440de0 ("x86/efi: Add better error logging to EFI boot
stub") introduces printing false alarms for lots of hardware. Rather
than playing Whack a Mole with non-fatal exit conditions, try the other
way round.
This is per Matt Fleming's suggestion:
> Where I think we could improve things
> is by adding efi_printk() message in certain error paths. Clearly, not
> all error paths need such messages, e.g. the EFI_INVALID_PARAMETER path
> you highlighted above, but it makes sense for memory allocation and PCI
> read failures.
Link: http://article.gmane.org/gmane.linux.kernel.efi/4628
Signed-off-by: Andre Müller <andre.muller@web.de>
Cc: Ulf Winkelvos <ulf@winkelvos.de>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Diffstat (limited to 'arch/x86/boot/compressed')
-rw-r--r-- | arch/x86/boot/compressed/eboot.c | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c index f4bdab1dbf66..ed8e06c59a4c 100644 --- a/arch/x86/boot/compressed/eboot.c +++ b/arch/x86/boot/compressed/eboot.c | |||
@@ -323,8 +323,10 @@ __setup_efi_pci32(efi_pci_io_protocol_32 *pci, struct pci_setup_rom **__rom) | |||
323 | size = pci->romsize + sizeof(*rom); | 323 | size = pci->romsize + sizeof(*rom); |
324 | 324 | ||
325 | status = efi_call_early(allocate_pool, EFI_LOADER_DATA, size, &rom); | 325 | status = efi_call_early(allocate_pool, EFI_LOADER_DATA, size, &rom); |
326 | if (status != EFI_SUCCESS) | 326 | if (status != EFI_SUCCESS) { |
327 | efi_printk(sys_table, "Failed to alloc mem for rom\n"); | ||
327 | return status; | 328 | return status; |
329 | } | ||
328 | 330 | ||
329 | memset(rom, 0, sizeof(*rom)); | 331 | memset(rom, 0, sizeof(*rom)); |
330 | 332 | ||
@@ -337,14 +339,18 @@ __setup_efi_pci32(efi_pci_io_protocol_32 *pci, struct pci_setup_rom **__rom) | |||
337 | status = efi_early->call(pci->pci.read, pci, EfiPciIoWidthUint16, | 339 | status = efi_early->call(pci->pci.read, pci, EfiPciIoWidthUint16, |
338 | PCI_VENDOR_ID, 1, &(rom->vendor)); | 340 | PCI_VENDOR_ID, 1, &(rom->vendor)); |
339 | 341 | ||
340 | if (status != EFI_SUCCESS) | 342 | if (status != EFI_SUCCESS) { |
343 | efi_printk(sys_table, "Failed to read rom->vendor\n"); | ||
341 | goto free_struct; | 344 | goto free_struct; |
345 | } | ||
342 | 346 | ||
343 | status = efi_early->call(pci->pci.read, pci, EfiPciIoWidthUint16, | 347 | status = efi_early->call(pci->pci.read, pci, EfiPciIoWidthUint16, |
344 | PCI_DEVICE_ID, 1, &(rom->devid)); | 348 | PCI_DEVICE_ID, 1, &(rom->devid)); |
345 | 349 | ||
346 | if (status != EFI_SUCCESS) | 350 | if (status != EFI_SUCCESS) { |
351 | efi_printk(sys_table, "Failed to read rom->devid\n"); | ||
347 | goto free_struct; | 352 | goto free_struct; |
353 | } | ||
348 | 354 | ||
349 | status = efi_early->call(pci->get_location, pci, &(rom->segment), | 355 | status = efi_early->call(pci->get_location, pci, &(rom->segment), |
350 | &(rom->bus), &(rom->device), &(rom->function)); | 356 | &(rom->bus), &(rom->device), &(rom->function)); |
@@ -427,8 +433,10 @@ __setup_efi_pci64(efi_pci_io_protocol_64 *pci, struct pci_setup_rom **__rom) | |||
427 | size = pci->romsize + sizeof(*rom); | 433 | size = pci->romsize + sizeof(*rom); |
428 | 434 | ||
429 | status = efi_call_early(allocate_pool, EFI_LOADER_DATA, size, &rom); | 435 | status = efi_call_early(allocate_pool, EFI_LOADER_DATA, size, &rom); |
430 | if (status != EFI_SUCCESS) | 436 | if (status != EFI_SUCCESS) { |
437 | efi_printk(sys_table, "Failed to alloc mem for rom\n"); | ||
431 | return status; | 438 | return status; |
439 | } | ||
432 | 440 | ||
433 | rom->data.type = SETUP_PCI; | 441 | rom->data.type = SETUP_PCI; |
434 | rom->data.len = size - sizeof(struct setup_data); | 442 | rom->data.len = size - sizeof(struct setup_data); |
@@ -439,14 +447,18 @@ __setup_efi_pci64(efi_pci_io_protocol_64 *pci, struct pci_setup_rom **__rom) | |||
439 | status = efi_early->call(pci->pci.read, pci, EfiPciIoWidthUint16, | 447 | status = efi_early->call(pci->pci.read, pci, EfiPciIoWidthUint16, |
440 | PCI_VENDOR_ID, 1, &(rom->vendor)); | 448 | PCI_VENDOR_ID, 1, &(rom->vendor)); |
441 | 449 | ||
442 | if (status != EFI_SUCCESS) | 450 | if (status != EFI_SUCCESS) { |
451 | efi_printk(sys_table, "Failed to read rom->vendor\n"); | ||
443 | goto free_struct; | 452 | goto free_struct; |
453 | } | ||
444 | 454 | ||
445 | status = efi_early->call(pci->pci.read, pci, EfiPciIoWidthUint16, | 455 | status = efi_early->call(pci->pci.read, pci, EfiPciIoWidthUint16, |
446 | PCI_DEVICE_ID, 1, &(rom->devid)); | 456 | PCI_DEVICE_ID, 1, &(rom->devid)); |
447 | 457 | ||
448 | if (status != EFI_SUCCESS) | 458 | if (status != EFI_SUCCESS) { |
459 | efi_printk(sys_table, "Failed to read rom->devid\n"); | ||
449 | goto free_struct; | 460 | goto free_struct; |
461 | } | ||
450 | 462 | ||
451 | status = efi_early->call(pci->get_location, pci, &(rom->segment), | 463 | status = efi_early->call(pci->get_location, pci, &(rom->segment), |
452 | &(rom->bus), &(rom->device), &(rom->function)); | 464 | &(rom->bus), &(rom->device), &(rom->function)); |
@@ -526,8 +538,10 @@ static efi_status_t setup_efi_pci(struct boot_params *params) | |||
526 | EFI_LOADER_DATA, | 538 | EFI_LOADER_DATA, |
527 | size, (void **)&pci_handle); | 539 | size, (void **)&pci_handle); |
528 | 540 | ||
529 | if (status != EFI_SUCCESS) | 541 | if (status != EFI_SUCCESS) { |
542 | efi_printk(sys_table, "Failed to alloc mem for pci_handle\n"); | ||
530 | return status; | 543 | return status; |
544 | } | ||
531 | 545 | ||
532 | status = efi_call_early(locate_handle, | 546 | status = efi_call_early(locate_handle, |
533 | EFI_LOCATE_BY_PROTOCOL, &pci_proto, | 547 | EFI_LOCATE_BY_PROTOCOL, &pci_proto, |