linux-stable/drivers/firmware/efi
Lukas Wunner 355845b738 efi/apple-properties: Reinstate support for boolean properties
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>
2020-12-31 10:28:53 +01:00
..
libstub efi: stub: get rid of efi_get_max_fdt_addr() 2020-12-09 08:37:27 +01:00
test efi/efi_test: read RuntimeServicesSupported 2020-12-09 08:37:27 +01:00
apple-properties.c efi/apple-properties: Reinstate support for boolean properties 2020-12-31 10:28:53 +01:00
arm-runtime.c mm: reorder includes after introduction of linux/pgtable.h 2020-06-09 09:39:13 -07:00
capsule-loader.c efi/capsule-loader: Drop superfluous assignment 2020-02-23 21:58:31 +01:00
capsule.c efi: capsule: clean scatter-gather entries from the D-cache 2020-12-09 08:37:27 +01:00
cper-arm.c efi: Replace GPL license boilerplate with SPDX headers 2019-02-04 08:27:25 +01:00
cper-x86.c x86/mce, cper: Pass x86 CPER through the MCA handling chain 2020-11-21 12:05:41 +01:00
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 efi/dev-path-parser: Add struct definition for vendor type device path nodes 2020-02-23 21:59:42 +01:00
earlycon.c efi/earlycon: Fix early printk for wider fonts 2020-05-12 12:29:45 +02:00
efi-bgrt.c efi/bgrt: Accept BGRT tables with a version of 0 2020-02-22 23:37:37 +01:00
efi-init.c driver core: Delete pointless parameter in fwnode_operations.add_links 2020-12-09 19:14:48 +01: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-15 12:13:39 -08: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 crypto: sha - split sha.h into sha1.h and sha2.h 2020-11-20 14:45:33 +11:00
esrt.c efi/esrt: Fix reference count leak in esre_create_sysfs_entry. 2020-06-15 14:38:56 +02:00
fake_mem.c efi: Fix handling of multiple efi_fake_mem= entries 2020-01-20 08:14:29 +01:00
fake_mem.h x86/efi: Add efi_fake_mem support for EFI_MEMORY_SP 2019-11-07 15:44:23 +01:00
fdtparams.c efi/arm: Rewrite FDT param discovery routines 2020-02-23 21:59:42 +01:00
Kconfig EFI updates collected by Ard Biesheuvel: 2020-12-24 12:40:07 -08:00
Makefile efi: ia64: disable the capsule loader 2020-12-14 16:24:19 +01:00
memattr.c efi: Move mem_attr_table out of struct efi 2020-02-23 21:59:42 +01:00
memmap.c efi: Fix handling of multiple efi_fake_mem= entries 2020-01-20 08:14:29 +01:00
mokvar-table.c efi: mokvar: add missing include of asm/early_ioremap.h 2020-10-02 10:08:29 +02:00
rci2-table.c efi: Don't attempt to map RCI2 config table if it doesn't exist 2019-12-10 12:13:02 +01:00
reboot.c efi: Use EFI ResetSystem only when available 2020-02-23 21:59:42 +01:00
riscv-runtime.c RISC-V: Add EFI runtime services 2020-10-02 14:31:28 -07:00
runtime-map.c efi: Replace GPL license boilerplate with SPDX headers 2019-02-04 08:27:25 +01:00
runtime-wrappers.c efi: Add 'runtime' pointer to struct efi 2020-02-23 21:59:42 +01:00
tpm.c EFI fixes for v5.7-rc6: 2020-05-22 20:06:25 +02:00
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