Merge branch 'efi-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull EFI fixes from Ingo Molnar: "This tree contains three fixes: a console spam fix, a file pattern fix and a sysfb_efi fix for a bug that triggered on older ThinkPads" * 'efi-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/sysfb_efi: Fix valid BAR address range check x86/efi-bgrt: Switch all pr_err() to pr_notice() for invalid BGRT MAINTAINERS: Remove asterisk from EFI directory names
This commit is contained in:
commit
cade818463
|
@ -4223,8 +4223,8 @@ F: Documentation/efi-stub.txt
|
||||||
F: arch/ia64/kernel/efi.c
|
F: arch/ia64/kernel/efi.c
|
||||||
F: arch/x86/boot/compressed/eboot.[ch]
|
F: arch/x86/boot/compressed/eboot.[ch]
|
||||||
F: arch/x86/include/asm/efi.h
|
F: arch/x86/include/asm/efi.h
|
||||||
F: arch/x86/platform/efi/*
|
F: arch/x86/platform/efi/
|
||||||
F: drivers/firmware/efi/*
|
F: drivers/firmware/efi/
|
||||||
F: include/linux/efi*.h
|
F: include/linux/efi*.h
|
||||||
|
|
||||||
EFI VARIABLE FILESYSTEM
|
EFI VARIABLE FILESYSTEM
|
||||||
|
|
|
@ -106,14 +106,24 @@ static int __init efifb_set_system(const struct dmi_system_id *id)
|
||||||
continue;
|
continue;
|
||||||
for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
|
for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
|
||||||
resource_size_t start, end;
|
resource_size_t start, end;
|
||||||
|
unsigned long flags;
|
||||||
|
|
||||||
|
flags = pci_resource_flags(dev, i);
|
||||||
|
if (!(flags & IORESOURCE_MEM))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (flags & IORESOURCE_UNSET)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (pci_resource_len(dev, i) == 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
start = pci_resource_start(dev, i);
|
start = pci_resource_start(dev, i);
|
||||||
if (start == 0)
|
|
||||||
break;
|
|
||||||
end = pci_resource_end(dev, i);
|
end = pci_resource_end(dev, i);
|
||||||
if (screen_info.lfb_base >= start &&
|
if (screen_info.lfb_base >= start &&
|
||||||
screen_info.lfb_base < end) {
|
screen_info.lfb_base < end) {
|
||||||
found_bar = 1;
|
found_bar = 1;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,40 +43,40 @@ void __init efi_bgrt_init(void)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (bgrt_tab->header.length < sizeof(*bgrt_tab)) {
|
if (bgrt_tab->header.length < sizeof(*bgrt_tab)) {
|
||||||
pr_err("Ignoring BGRT: invalid length %u (expected %zu)\n",
|
pr_notice("Ignoring BGRT: invalid length %u (expected %zu)\n",
|
||||||
bgrt_tab->header.length, sizeof(*bgrt_tab));
|
bgrt_tab->header.length, sizeof(*bgrt_tab));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (bgrt_tab->version != 1) {
|
if (bgrt_tab->version != 1) {
|
||||||
pr_err("Ignoring BGRT: invalid version %u (expected 1)\n",
|
pr_notice("Ignoring BGRT: invalid version %u (expected 1)\n",
|
||||||
bgrt_tab->version);
|
bgrt_tab->version);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (bgrt_tab->status & 0xfe) {
|
if (bgrt_tab->status & 0xfe) {
|
||||||
pr_err("Ignoring BGRT: reserved status bits are non-zero %u\n",
|
pr_notice("Ignoring BGRT: reserved status bits are non-zero %u\n",
|
||||||
bgrt_tab->status);
|
bgrt_tab->status);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (bgrt_tab->image_type != 0) {
|
if (bgrt_tab->image_type != 0) {
|
||||||
pr_err("Ignoring BGRT: invalid image type %u (expected 0)\n",
|
pr_notice("Ignoring BGRT: invalid image type %u (expected 0)\n",
|
||||||
bgrt_tab->image_type);
|
bgrt_tab->image_type);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!bgrt_tab->image_address) {
|
if (!bgrt_tab->image_address) {
|
||||||
pr_err("Ignoring BGRT: null image address\n");
|
pr_notice("Ignoring BGRT: null image address\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
image = memremap(bgrt_tab->image_address, sizeof(bmp_header), MEMREMAP_WB);
|
image = memremap(bgrt_tab->image_address, sizeof(bmp_header), MEMREMAP_WB);
|
||||||
if (!image) {
|
if (!image) {
|
||||||
pr_err("Ignoring BGRT: failed to map image header memory\n");
|
pr_notice("Ignoring BGRT: failed to map image header memory\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(&bmp_header, image, sizeof(bmp_header));
|
memcpy(&bmp_header, image, sizeof(bmp_header));
|
||||||
memunmap(image);
|
memunmap(image);
|
||||||
if (bmp_header.id != 0x4d42) {
|
if (bmp_header.id != 0x4d42) {
|
||||||
pr_err("Ignoring BGRT: Incorrect BMP magic number 0x%x (expected 0x4d42)\n",
|
pr_notice("Ignoring BGRT: Incorrect BMP magic number 0x%x (expected 0x4d42)\n",
|
||||||
bmp_header.id);
|
bmp_header.id);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -84,14 +84,14 @@ void __init efi_bgrt_init(void)
|
||||||
|
|
||||||
bgrt_image = kmalloc(bgrt_image_size, GFP_KERNEL | __GFP_NOWARN);
|
bgrt_image = kmalloc(bgrt_image_size, GFP_KERNEL | __GFP_NOWARN);
|
||||||
if (!bgrt_image) {
|
if (!bgrt_image) {
|
||||||
pr_err("Ignoring BGRT: failed to allocate memory for image (wanted %zu bytes)\n",
|
pr_notice("Ignoring BGRT: failed to allocate memory for image (wanted %zu bytes)\n",
|
||||||
bgrt_image_size);
|
bgrt_image_size);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
image = memremap(bgrt_tab->image_address, bmp_header.size, MEMREMAP_WB);
|
image = memremap(bgrt_tab->image_address, bmp_header.size, MEMREMAP_WB);
|
||||||
if (!image) {
|
if (!image) {
|
||||||
pr_err("Ignoring BGRT: failed to map image memory\n");
|
pr_notice("Ignoring BGRT: failed to map image memory\n");
|
||||||
kfree(bgrt_image);
|
kfree(bgrt_image);
|
||||||
bgrt_image = NULL;
|
bgrt_image = NULL;
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue