Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'platform-drivers-x86-v5.18-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86

Pull x86 platform drivers fixes from Hans de Goede:

- Documentation and compilation warning fixes

- Kconfig dep fixes

- Misc small code cleanups

* tag 'platform-drivers-x86-v5.18-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86:
platform/x86: amd-pmc: Fix compilation without CONFIG_SUSPEND
platform/x86: acerhdf: Cleanup str_starts_with()
Documentation/ABI: sysfs-class-firmware-attributes: Misc. cleanups
Documentation/ABI: sysfs-class-firmware-attributes: Fix Sphinx errors
Documentation/ABI: sysfs-driver-intel_sdsi: Fix sphinx warnings
platform/x86: barco-p50-gpio: Fix duplicate included linux/io.h
platform/x86: samsung-laptop: Fix an unsigned comparison which can never be negative
platform/x86: think-lmi: certificate support clean ups

+67 -82
+26 -22
Documentation/ABI/testing/sysfs-class-firmware-attributes
··· 116 116 <value>[ForceIf:<attribute>=<value>] 117 117 <value>[ForceIfNot:<attribute>=<value>] 118 118 119 - For example: 119 + For example:: 120 120 121 121 LegacyOrom/dell_value_modifier has value: 122 122 Disabled[ForceIf:SecureBoot=Enabled] ··· 212 212 the next boot. 213 213 214 214 Lenovo specific class extensions 215 - ------------------------------ 215 + -------------------------------- 216 216 217 217 On Lenovo systems the following additional settings are available: 218 218 ··· 246 246 that is being referenced (e.g hdd0, hdd1 etc) 247 247 This attribute defaults to device 0. 248 248 249 - certificate: 250 - signature: 251 - save_signature: 249 + certificate, signature, save_signature: 252 250 These attributes are used for certificate based authentication. This is 253 251 used in conjunction with a signing server as an alternative to password 254 252 based authentication. ··· 255 257 The attributes can be displayed to check the stored value. 256 258 257 259 Some usage examples: 258 - Installing a certificate to enable feature: 259 - echo <supervisor password > authentication/Admin/current_password 260 - echo <signed certificate> > authentication/Admin/certificate 261 260 262 - Updating the installed certificate: 263 - echo <signature> > authentication/Admin/signature 264 - echo <signed certificate> > authentication/Admin/certificate 261 + Installing a certificate to enable feature:: 265 262 266 - Removing the installed certificate: 267 - echo <signature> > authentication/Admin/signature 268 - echo '' > authentication/Admin/certificate 263 + echo "supervisor password" > authentication/Admin/current_password 264 + echo "signed certificate" > authentication/Admin/certificate 269 265 270 - Changing a BIOS setting: 271 - echo <signature> > authentication/Admin/signature 272 - echo <save signature> > authentication/Admin/save_signature 273 - echo Enable > attribute/PasswordBeep/current_value 266 + Updating the installed certificate:: 267 + 268 + echo "signature" > authentication/Admin/signature 269 + echo "signed certificate" > authentication/Admin/certificate 270 + 271 + Removing the installed certificate:: 272 + 273 + echo "signature" > authentication/Admin/signature 274 + echo "" > authentication/Admin/certificate 275 + 276 + Changing a BIOS setting:: 277 + 278 + echo "signature" > authentication/Admin/signature 279 + echo "save signature" > authentication/Admin/save_signature 280 + echo Enable > attribute/PasswordBeep/current_value 274 281 275 282 You cannot enable certificate authentication if a supervisor password 276 283 has not been set. ··· 291 288 certificate_to_password: 292 289 Write only attribute used to switch from certificate based authentication 293 290 back to password based. 294 - Usage: 295 - echo <signature> > authentication/Admin/signature 296 - echo <password> > authentication/Admin/certificate_to_password 291 + Usage:: 292 + 293 + echo "signature" > authentication/Admin/signature 294 + echo "password" > authentication/Admin/certificate_to_password 297 295 298 296 299 297 What: /sys/class/firmware-attributes/*/attributes/pending_reboot ··· 349 345 350 346 # echo "factory" > /sys/class/firmware-attributes/*/device/attributes/reset_bios 351 347 # cat /sys/class/firmware-attributes/*/device/attributes/reset_bios 352 - # builtinsafe lastknowngood [factory] custom 348 + builtinsafe lastknowngood [factory] custom 353 349 354 350 Note that any changes to this attribute requires a reboot 355 351 for changes to take effect.
+10 -8
Documentation/ABI/testing/sysfs-driver-intel_sdsi
··· 13 13 Should the operation fail, one of the following error codes 14 14 may be returned: 15 15 16 + ========== ===== 16 17 Error Code Cause 17 - ---------- ----- 18 - EIO General mailbox failure. Log may indicate cause. 19 - EBUSY Mailbox is owned by another agent. 20 - EPERM SDSI capability is not enabled in hardware. 21 - EPROTO Failure in mailbox protocol detected by driver. 18 + ========== ===== 19 + EIO General mailbox failure. Log may indicate cause. 20 + EBUSY Mailbox is owned by another agent. 21 + EPERM SDSI capability is not enabled in hardware. 22 + EPROTO Failure in mailbox protocol detected by driver. 22 23 See log for details. 23 - EOVERFLOW For provision commands, the size of the data 24 + EOVERFLOW For provision commands, the size of the data 24 25 exceeds what may be written. 25 - ESPIPE Seeking is not allowed. 26 - ETIMEDOUT Failure to complete mailbox transaction in time. 26 + ESPIPE Seeking is not allowed. 27 + ETIMEDOUT Failure to complete mailbox transaction in time. 28 + ========== ===== 27 29 28 30 What: /sys/bus/auxiliary/devices/intel_vsec.sdsi.X/guid 29 31 Date: Feb 2022
+3 -18
drivers/platform/x86/acerhdf.c
··· 584 584 .remove = acerhdf_remove, 585 585 }; 586 586 587 - /* checks if str begins with start */ 588 - static int str_starts_with(const char *str, const char *start) 589 - { 590 - unsigned long str_len = 0, start_len = 0; 591 - 592 - str_len = strlen(str); 593 - start_len = strlen(start); 594 - 595 - if (str_len >= start_len && 596 - !strncmp(str, start, start_len)) 597 - return 1; 598 - 599 - return 0; 600 - } 601 - 602 587 /* check hardware */ 603 588 static int __init acerhdf_check_hardware(void) 604 589 { ··· 636 651 * check if actual hardware BIOS vendor, product and version 637 652 * IDs start with the strings of BIOS table entry 638 653 */ 639 - if (str_starts_with(vendor, bt->vendor) && 640 - str_starts_with(product, bt->product) && 641 - str_starts_with(version, bt->version)) { 654 + if (strstarts(vendor, bt->vendor) && 655 + strstarts(product, bt->product) && 656 + strstarts(version, bt->version)) { 642 657 found = 1; 643 658 break; 644 659 }
+13 -1
drivers/platform/x86/amd-pmc.c
··· 160 160 161 161 static struct amd_pmc_dev pmc; 162 162 static int amd_pmc_send_cmd(struct amd_pmc_dev *dev, u32 arg, u32 *data, u8 msg, bool ret); 163 - static int amd_pmc_write_stb(struct amd_pmc_dev *dev, u32 data); 164 163 static int amd_pmc_read_stb(struct amd_pmc_dev *dev, u32 *buf); 164 + #ifdef CONFIG_SUSPEND 165 + static int amd_pmc_write_stb(struct amd_pmc_dev *dev, u32 data); 166 + #endif 165 167 166 168 static inline u32 amd_pmc_reg_read(struct amd_pmc_dev *dev, int reg_offset) 167 169 { ··· 327 325 return 0; 328 326 } 329 327 328 + #ifdef CONFIG_SUSPEND 330 329 static void amd_pmc_validate_deepest(struct amd_pmc_dev *pdev) 331 330 { 332 331 struct smu_metrics table; ··· 341 338 dev_dbg(pdev->dev, "Last suspend in deepest state for %lluus\n", 342 339 table.timein_s0i3_lastcapture); 343 340 } 341 + #endif 344 342 345 343 #ifdef CONFIG_DEBUG_FS 346 344 static int smu_fw_info_show(struct seq_file *s, void *unused) ··· 573 569 return rc; 574 570 } 575 571 572 + #ifdef CONFIG_SUSPEND 576 573 static int amd_pmc_get_os_hint(struct amd_pmc_dev *dev) 577 574 { 578 575 switch (dev->cpu_id) { ··· 699 694 .prepare = amd_pmc_s2idle_prepare, 700 695 .restore = amd_pmc_s2idle_restore, 701 696 }; 697 + #endif 702 698 703 699 static const struct pci_device_id pmc_pci_ids[] = { 704 700 { PCI_DEVICE(PCI_VENDOR_ID_AMD, AMD_CPU_ID_YC) }, ··· 739 733 return 0; 740 734 } 741 735 736 + #ifdef CONFIG_SUSPEND 742 737 static int amd_pmc_write_stb(struct amd_pmc_dev *dev, u32 data) 743 738 { 744 739 int err; ··· 760 753 761 754 return 0; 762 755 } 756 + #endif 763 757 764 758 static int amd_pmc_read_stb(struct amd_pmc_dev *dev, u32 *buf) 765 759 { ··· 867 859 868 860 amd_pmc_get_smu_version(dev); 869 861 platform_set_drvdata(pdev, dev); 862 + #ifdef CONFIG_SUSPEND 870 863 err = acpi_register_lps0_dev(&amd_pmc_s2idle_dev_ops); 871 864 if (err) 872 865 dev_warn(dev->dev, "failed to register LPS0 sleep handler, expect increased power consumption\n"); 866 + #endif 873 867 874 868 amd_pmc_dbgfs_register(dev); 875 869 return 0; ··· 885 875 { 886 876 struct amd_pmc_dev *dev = platform_get_drvdata(pdev); 887 877 878 + #ifdef CONFIG_SUSPEND 888 879 acpi_unregister_lps0_dev(&amd_pmc_s2idle_dev_ops); 880 + #endif 889 881 amd_pmc_dbgfs_unregister(dev); 890 882 pci_dev_put(dev->rdev); 891 883 mutex_destroy(&dev->lock);
-1
drivers/platform/x86/barco-p50-gpio.c
··· 10 10 11 11 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 12 12 13 - #include <linux/io.h> 14 13 #include <linux/delay.h> 15 14 #include <linux/dmi.h> 16 15 #include <linux/err.h>
-2
drivers/platform/x86/samsung-laptop.c
··· 1121 1121 1122 1122 if (value > samsung->kbd_led.max_brightness) 1123 1123 value = samsung->kbd_led.max_brightness; 1124 - else if (value < 0) 1125 - value = 0; 1126 1124 1127 1125 samsung->kbd_led_wk = value; 1128 1126 queue_work(samsung->led_workqueue, &samsung->kbd_led_work);
+15 -29
drivers/platform/x86/think-lmi.c
··· 740 740 if (!tlmi_priv.certificate_support) 741 741 return -EOPNOTSUPP; 742 742 743 - new_cert = kstrdup(buf, GFP_KERNEL); 744 - if (!new_cert) 745 - return -ENOMEM; 746 - /* Strip out CR if one is present */ 747 - strip_cr(new_cert); 748 - 749 743 /* If empty then clear installed certificate */ 750 - if (new_cert[0] == '\0') { /* Clear installed certificate */ 751 - kfree(new_cert); 752 - 744 + if ((buf[0] == '\0') || (buf[0] == '\n')) { /* Clear installed certificate */ 753 745 /* Check that signature is set */ 754 746 if (!setting->signature || !setting->signature[0]) 755 747 return -EACCES; ··· 755 763 756 764 ret = tlmi_simple_call(LENOVO_CLEAR_BIOS_CERT_GUID, auth_str); 757 765 kfree(auth_str); 758 - if (ret) 759 - return ret; 760 766 761 - kfree(setting->certificate); 762 - setting->certificate = NULL; 763 - return count; 767 + return ret ?: count; 764 768 } 769 + 770 + new_cert = kstrdup(buf, GFP_KERNEL); 771 + if (!new_cert) 772 + return -ENOMEM; 773 + /* Strip out CR if one is present */ 774 + strip_cr(new_cert); 765 775 766 776 if (setting->cert_installed) { 767 777 /* Certificate is installed so this is an update */ ··· 786 792 auth_str = kasprintf(GFP_KERNEL, "%s,%s", 787 793 new_cert, setting->password); 788 794 } 789 - if (!auth_str) { 790 - kfree(new_cert); 795 + kfree(new_cert); 796 + if (!auth_str) 791 797 return -ENOMEM; 792 - } 793 798 794 799 ret = tlmi_simple_call(guid, auth_str); 795 800 kfree(auth_str); 796 - if (ret) { 797 - kfree(new_cert); 798 - return ret; 799 - } 800 801 801 - kfree(setting->certificate); 802 - setting->certificate = new_cert; 803 - return count; 802 + return ret ?: count; 804 803 } 805 804 806 805 static struct kobj_attribute auth_certificate = __ATTR_WO(certificate); ··· 1181 1194 1182 1195 kset_unregister(tlmi_priv.attribute_kset); 1183 1196 1197 + /* Free up any saved signatures */ 1198 + kfree(tlmi_priv.pwd_admin->signature); 1199 + kfree(tlmi_priv.pwd_admin->save_signature); 1200 + 1184 1201 /* Authentication structures */ 1185 1202 sysfs_remove_group(&tlmi_priv.pwd_admin->kobj, &auth_attr_group); 1186 1203 kobject_put(&tlmi_priv.pwd_admin->kobj); ··· 1201 1210 } 1202 1211 1203 1212 kset_unregister(tlmi_priv.authentication_kset); 1204 - 1205 - /* Free up any saved certificates/signatures */ 1206 - kfree(tlmi_priv.pwd_admin->certificate); 1207 - kfree(tlmi_priv.pwd_admin->signature); 1208 - kfree(tlmi_priv.pwd_admin->save_signature); 1209 1213 } 1210 1214 1211 1215 static int tlmi_sysfs_init(void)
-1
drivers/platform/x86/think-lmi.h
··· 63 63 int index; /*Used for HDD and NVME auth */ 64 64 enum level_option level; 65 65 bool cert_installed; 66 - char *certificate; 67 66 char *signature; 68 67 char *save_signature; 69 68 };