Skip to content

Commit

Permalink
efi/bgrt: Accept BGRT tables with a version of 0
Browse files Browse the repository at this point in the history
Some (somewhat older) laptops have a correct BGRT table, except that the
version field is 0 instead of 1.

This has been seen on several Ivy Bridge based Lenovo models.

For now the spec. only defines version 1, so it is reasonably safe to
assume that tables with a version of 0 really are version 1 too,
which is what this commit does so that the BGRT table will be accepted
by the kernel on laptop models with this issue.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20200131130623.33875-1-hdegoede@redhat.com
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
  • Loading branch information
Hans de Goede authored and Ard Biesheuvel committed Feb 22, 2020
1 parent f32ea1c commit 55087c5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/firmware/efi/efi-bgrt.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ void __init efi_bgrt_init(struct acpi_table_header *table)
return;
}
*bgrt = *(struct acpi_table_bgrt *)table;
if (bgrt->version != 1) {
/*
* Only version 1 is defined but some older laptops (seen on Lenovo
* Ivy Bridge models) have a correct version 1 BGRT table with the
* version set to 0, so we accept version 0 and 1.
*/
if (bgrt->version > 1) {
pr_notice("Ignoring BGRT: invalid version %u (expected 1)\n",
bgrt->version);
goto out;
Expand Down

0 comments on commit 55087c5

Please sign in to comment.