linux_dsm_epyc7002/drivers/firmware/efi
Lukas Wunner c6da541644 efi/apple-properties: Reinstate support for boolean properties
commit 355845b738e76445c8522802552146d96cb4afa7 upstream.

Since commit 4466bf8282 ("efi/apple-properties: use
PROPERTY_ENTRY_U8_ARRAY_LEN"), my MacBook Pro issues a -ENODATA error
when trying to assign EFI properties to the discrete GPU:

pci 0000:01:00.0: assigning 56 device properties
pci 0000:01:00.0: error -61 assigning properties

That's because some of the properties have no value.  They're booleans
whose presence can be checked by drivers, e.g. "use-backlight-blanking".

Commit 6e98503dba ("efi/apple-properties: Remove redundant attribute
initialization from unmarshal_key_value_pairs()") employed a trick to
store such booleans as u8 arrays (which is the data type used for all
other EFI properties on Macs):  It cleared the property_entry's
"is_array" flag, thereby denoting that the value is stored inline in the
property_entry.

Commit 4466bf8282 erroneously removed that trick.  It was probably a
little fragile to begin with.

Reinstate support for boolean properties by explicitly invoking the
PROPERTY_ENTRY_BOOL() initializer for properties with zero-length value.

Fixes: 4466bf8282 ("efi/apple-properties: use PROPERTY_ENTRY_U8_ARRAY_LEN")
Cc: <stable@vger.kernel.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Link: https://lore.kernel.org/r/be958bda75331a011d53c696d1deec8dccd06fd2.1609388549.git.lukas@wunner.de
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-02-03 23:28:40 +01:00
..
libstub RISC-V Patches for the 5.10 Merge Window, Part 1 2020-10-19 18:18:30 -07:00
test
apple-properties.c efi/apple-properties: Reinstate support for boolean properties 2021-02-03 23:28:40 +01:00
arm-runtime.c
capsule-loader.c
capsule.c
cper-arm.c
cper-x86.c
cper.c cper,edac,efi: Memory Error Record: bank group/address and chip id 2020-09-17 10:19:52 +03:00
dev-path-parser.c
earlycon.c
efi-bgrt.c
efi-init.c efi: Support for MOK variable config table 2020-09-16 18:53:42 +03:00
efi-pstore.c efi: pstore: move workqueue handling out of efivars 2020-09-29 19:40:57 +02:00
efi.c mm/gup: prevent gup_fast from racing with COW during fork 2020-12-30 11:53:54 +01:00
efibc.c efi: efibc: check for efivars write capability 2020-09-15 18:22:47 +03:00
efivars.c efi: efivars: limit availability to X86 builds 2020-09-29 19:40:57 +02:00
embedded-firmware.c test_firmware: Test platform fw loading on non-EFI systems 2020-09-10 18:19:16 +02:00
esrt.c
fake_mem.c
fake_mem.h
fdtparams.c
Kconfig efi: EFI_EARLYCON should depend on EFI 2020-11-25 16:55:02 +01:00
Makefile RISC-V Patches for the 5.10 Merge Window, Part 1 2020-10-19 18:18:30 -07:00
memattr.c
memmap.c
mokvar-table.c efi: mokvar: add missing include of asm/early_ioremap.h 2020-10-02 10:08:29 +02:00
rci2-table.c
reboot.c
riscv-runtime.c RISC-V: Add EFI runtime services 2020-10-02 14:31:28 -07:00
runtime-map.c
runtime-wrappers.c
tpm.c
vars.c Merge branch 'efi/urgent' into efi/core, to pick up fixes 2020-10-12 13:38:31 +02:00
x86_fake_mem.c efi/fake_mem: arrange for a resource entry per efi_fake_mem instance 2020-10-13 18:38:27 -07:00