A single EFI fix from Lukas:

- handle boolean device properties imported from Apple firmware
   correctly.
 -----BEGIN PGP SIGNATURE-----
 
 iQGzBAABCgAdFiEE+9lifEBpyUIVN1cpw08iOZLZjyQFAmARRNIACgkQw08iOZLZ
 jyQitgwAvGzlv41S+q6FU1zf8cYHetGZ9/hT4Dwykhi+wtCky/m7N1DyszJhIN49
 u0yMx/m4PVlrKz+vMotXLHIFGWZHaTZhARp+mrcHu5t0d41RC1JPWfJuVPedNrAx
 0QZ6A50pRJcFthG+J4mmW3ph+RxntnSKomyojM07cecS4bAwV/Rm4RO7Jki2FLZ9
 w5bKK2swYCuA25On4+SHkHMok+Cvx7shpHDbu1QsXtVGtu1RPSZXNqCP2YmjhbYv
 YHpAXd5gGbnX0/gZTlDm5jQ2zvXDPO4GJjlQuhQOloDbVGdL5ARYpW23o7tdFanw
 L/NyLrebRpFJwHwqSud1WIgfVVY9OstDDACX335NrWXvh2Tm473KtqtDeb78WnGp
 gSfrXMjTRInOEyHKZNCE5Dpbj5yOLMTA/CChYeqO/xlsagZ5H5h2YIgrNFaYyps3
 Y5OG3/dqueFDr47xM4iXcy+1tS6H0SZilAcwHBTq4TBawd77cY75/laNq9uC04Du
 Cj4Jhe7l
 =jRKO
 -----END PGP SIGNATURE-----

Merge tag 'efi-urgent-for-v5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull EFI fix from Borislav Petkov:
 "A single fix from Lukas: handle boolean device properties imported
  from Apple firmware correctly"

* tag 'efi-urgent-for-v5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  efi/apple-properties: Reinstate support for boolean properties
This commit is contained in:
Linus Torvalds 2021-01-31 11:57:37 -08:00
commit ac8c6edd20
1 changed files with 9 additions and 4 deletions

View File

@ -3,8 +3,9 @@
* apple-properties.c - EFI device properties on Macs * apple-properties.c - EFI device properties on Macs
* Copyright (C) 2016 Lukas Wunner <lukas@wunner.de> * Copyright (C) 2016 Lukas Wunner <lukas@wunner.de>
* *
* Note, all properties are considered as u8 arrays. * Properties are stored either as:
* To get a value of any of them the caller must use device_property_read_u8_array(). * u8 arrays which can be retrieved with device_property_read_u8_array() or
* booleans which can be queried with device_property_present().
*/ */
#define pr_fmt(fmt) "apple-properties: " fmt #define pr_fmt(fmt) "apple-properties: " fmt
@ -88,8 +89,12 @@ static void __init unmarshal_key_value_pairs(struct dev_header *dev_header,
entry_data = ptr + key_len + sizeof(val_len); entry_data = ptr + key_len + sizeof(val_len);
entry_len = val_len - sizeof(val_len); entry_len = val_len - sizeof(val_len);
entry[i] = PROPERTY_ENTRY_U8_ARRAY_LEN(key, entry_data, if (entry_len)
entry_len); entry[i] = PROPERTY_ENTRY_U8_ARRAY_LEN(key, entry_data,
entry_len);
else
entry[i] = PROPERTY_ENTRY_BOOL(key);
if (dump_properties) { if (dump_properties) {
dev_info(dev, "property: %s\n", key); dev_info(dev, "property: %s\n", key);
print_hex_dump(KERN_INFO, pr_fmt(), DUMP_PREFIX_OFFSET, print_hex_dump(KERN_INFO, pr_fmt(), DUMP_PREFIX_OFFSET,