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

Merge tag 'platform-drivers-x86-v6.7-3' into pdx86/for-next

Back merge pdx86 fixes into pdx86/for-next for further WMI work
depending on some of the fixes.

platform-drivers-x86 for v6.7-3

Highlights:
- asus-wmi: Solve i8042 filter resource handling, input, and
suspend issues
- wmi: Skip zero instance WMI blocks to avoid issues with
some laptops
- mlxbf-bootctl: Differentiate dev/production keys
- platform/surface: Correct serdev related return value to avoid
leaking errno into userspace
- Error checking fixes

The following is an automated shortlog grouped by driver:

asus-wmi:
- Change q500a_i8042_filter() into a generic i8042-filter
- disable USB0 hub on ROG Ally before suspend
- Filter Volume key presses if also reported via atkbd
- Move i8042 filter install to shared asus-wmi code

mellanox:
- Add null pointer checks for devm_kasprintf()
- Check devm_hwmon_device_register_with_groups() return value

mlxbf-bootctl:
- correctly identify secure boot with development keys

surface: aggregator:
- fix recv_buf() return value

wmi:
- Skip blocks with zero instances

+173 -97
-4
MAINTAINERS
··· 11025 11025 11026 11026 INTEL WMI SLIM BOOTLOADER (SBL) FIRMWARE UPDATE DRIVER 11027 11027 M: Jithu Joseph <jithu.joseph@intel.com> 11028 - R: Maurice Ma <maurice.ma@intel.com> 11029 11028 S: Maintained 11030 11029 W: https://slimbootloader.github.io/security/firmware-update.html 11031 11030 F: drivers/platform/x86/intel/wmi/sbl-fw-update.c ··· 13778 13779 MELLANOX HARDWARE PLATFORM SUPPORT 13779 13780 M: Hans de Goede <hdegoede@redhat.com> 13780 13781 M: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> 13781 - M: Mark Gross <markgross@kernel.org> 13782 13782 M: Vadim Pasternak <vadimp@nvidia.com> 13783 13783 L: platform-driver-x86@vger.kernel.org 13784 13784 S: Supported ··· 14386 14388 MICROSOFT SURFACE HARDWARE PLATFORM SUPPORT 14387 14389 M: Hans de Goede <hdegoede@redhat.com> 14388 14390 M: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> 14389 - M: Mark Gross <markgross@kernel.org> 14390 14391 M: Maximilian Luz <luzmaximilian@gmail.com> 14391 14392 L: platform-driver-x86@vger.kernel.org 14392 14393 S: Maintained ··· 23651 23654 X86 PLATFORM DRIVERS 23652 23655 M: Hans de Goede <hdegoede@redhat.com> 23653 23656 M: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> 23654 - M: Mark Gross <markgross@kernel.org> 23655 23657 L: platform-driver-x86@vger.kernel.org 23656 23658 S: Maintained 23657 23659 Q: https://patchwork.kernel.org/project/platform-driver-x86/list/
+26 -13
drivers/platform/mellanox/mlxbf-bootctl.c
··· 20 20 21 21 #define MLXBF_BOOTCTL_SB_SECURE_MASK 0x03 22 22 #define MLXBF_BOOTCTL_SB_TEST_MASK 0x0c 23 + #define MLXBF_BOOTCTL_SB_DEV_MASK BIT(4) 23 24 24 25 #define MLXBF_SB_KEY_NUM 4 25 26 ··· 41 40 { MLXBF_BOOTCTL_NONE, "none" }, 42 41 }; 43 42 43 + enum { 44 + MLXBF_BOOTCTL_SB_LIFECYCLE_PRODUCTION = 0, 45 + MLXBF_BOOTCTL_SB_LIFECYCLE_GA_SECURE = 1, 46 + MLXBF_BOOTCTL_SB_LIFECYCLE_GA_NON_SECURE = 2, 47 + MLXBF_BOOTCTL_SB_LIFECYCLE_RMA = 3 48 + }; 49 + 44 50 static const char * const mlxbf_bootctl_lifecycle_states[] = { 45 - [0] = "Production", 46 - [1] = "GA Secured", 47 - [2] = "GA Non-Secured", 48 - [3] = "RMA", 51 + [MLXBF_BOOTCTL_SB_LIFECYCLE_PRODUCTION] = "Production", 52 + [MLXBF_BOOTCTL_SB_LIFECYCLE_GA_SECURE] = "GA Secured", 53 + [MLXBF_BOOTCTL_SB_LIFECYCLE_GA_NON_SECURE] = "GA Non-Secured", 54 + [MLXBF_BOOTCTL_SB_LIFECYCLE_RMA] = "RMA", 49 55 }; 50 56 51 57 /* Log header format. */ ··· 255 247 static ssize_t lifecycle_state_show(struct device *dev, 256 248 struct device_attribute *attr, char *buf) 257 249 { 250 + int status_bits; 251 + int use_dev_key; 252 + int test_state; 258 253 int lc_state; 259 254 260 - lc_state = mlxbf_bootctl_smc(MLXBF_BOOTCTL_GET_TBB_FUSE_STATUS, 261 - MLXBF_BOOTCTL_FUSE_STATUS_LIFECYCLE); 262 - if (lc_state < 0) 263 - return lc_state; 255 + status_bits = mlxbf_bootctl_smc(MLXBF_BOOTCTL_GET_TBB_FUSE_STATUS, 256 + MLXBF_BOOTCTL_FUSE_STATUS_LIFECYCLE); 257 + if (status_bits < 0) 258 + return status_bits; 264 259 265 - lc_state &= 266 - MLXBF_BOOTCTL_SB_TEST_MASK | MLXBF_BOOTCTL_SB_SECURE_MASK; 260 + use_dev_key = status_bits & MLXBF_BOOTCTL_SB_DEV_MASK; 261 + test_state = status_bits & MLXBF_BOOTCTL_SB_TEST_MASK; 262 + lc_state = status_bits & MLXBF_BOOTCTL_SB_SECURE_MASK; 267 263 268 264 /* 269 265 * If the test bits are set, we specify that the current state may be 270 266 * due to using the test bits. 271 267 */ 272 - if (lc_state & MLXBF_BOOTCTL_SB_TEST_MASK) { 273 - lc_state &= MLXBF_BOOTCTL_SB_SECURE_MASK; 274 - 268 + if (test_state) { 275 269 return sprintf(buf, "%s(test)\n", 276 270 mlxbf_bootctl_lifecycle_states[lc_state]); 271 + } else if (use_dev_key && 272 + (lc_state == MLXBF_BOOTCTL_SB_LIFECYCLE_GA_SECURE)) { 273 + return sprintf(buf, "Secured (development)\n"); 277 274 } 278 275 279 276 return sprintf(buf, "%s\n", mlxbf_bootctl_lifecycle_states[lc_state]);
+14
drivers/platform/mellanox/mlxbf-pmc.c
··· 1771 1771 attr->dev_attr.show = mlxbf_pmc_event_list_show; 1772 1772 attr->nr = blk_num; 1773 1773 attr->dev_attr.attr.name = devm_kasprintf(dev, GFP_KERNEL, "event_list"); 1774 + if (!attr->dev_attr.attr.name) 1775 + return -ENOMEM; 1774 1776 pmc->block[blk_num].block_attr[i] = &attr->dev_attr.attr; 1775 1777 attr = NULL; 1776 1778 ··· 1786 1784 attr->nr = blk_num; 1787 1785 attr->dev_attr.attr.name = devm_kasprintf(dev, GFP_KERNEL, 1788 1786 "enable"); 1787 + if (!attr->dev_attr.attr.name) 1788 + return -ENOMEM; 1789 1789 pmc->block[blk_num].block_attr[++i] = &attr->dev_attr.attr; 1790 1790 attr = NULL; 1791 1791 } ··· 1814 1810 attr->nr = blk_num; 1815 1811 attr->dev_attr.attr.name = devm_kasprintf(dev, GFP_KERNEL, 1816 1812 "counter%d", j); 1813 + if (!attr->dev_attr.attr.name) 1814 + return -ENOMEM; 1817 1815 pmc->block[blk_num].block_attr[++i] = &attr->dev_attr.attr; 1818 1816 attr = NULL; 1819 1817 ··· 1827 1821 attr->nr = blk_num; 1828 1822 attr->dev_attr.attr.name = devm_kasprintf(dev, GFP_KERNEL, 1829 1823 "event%d", j); 1824 + if (!attr->dev_attr.attr.name) 1825 + return -ENOMEM; 1830 1826 pmc->block[blk_num].block_attr[++i] = &attr->dev_attr.attr; 1831 1827 attr = NULL; 1832 1828 } ··· 1861 1853 attr->nr = blk_num; 1862 1854 attr->dev_attr.attr.name = devm_kasprintf(dev, GFP_KERNEL, 1863 1855 events[j].evt_name); 1856 + if (!attr->dev_attr.attr.name) 1857 + return -ENOMEM; 1864 1858 pmc->block[blk_num].block_attr[i] = &attr->dev_attr.attr; 1865 1859 attr = NULL; 1866 1860 i++; ··· 1892 1882 pmc->block[blk_num].block_attr_grp.attrs = pmc->block[blk_num].block_attr; 1893 1883 pmc->block[blk_num].block_attr_grp.name = devm_kasprintf( 1894 1884 dev, GFP_KERNEL, pmc->block_name[blk_num]); 1885 + if (!pmc->block[blk_num].block_attr_grp.name) 1886 + return -ENOMEM; 1895 1887 pmc->groups[pmc->group_num] = &pmc->block[blk_num].block_attr_grp; 1896 1888 pmc->group_num++; 1897 1889 ··· 2075 2063 2076 2064 pmc->hwmon_dev = devm_hwmon_device_register_with_groups( 2077 2065 dev, "bfperf", pmc, pmc->groups); 2066 + if (IS_ERR(pmc->hwmon_dev)) 2067 + return PTR_ERR(pmc->hwmon_dev); 2078 2068 platform_set_drvdata(pdev, pmc); 2079 2069 2080 2070 return 0;
+4 -1
drivers/platform/surface/aggregator/core.c
··· 231 231 size_t n) 232 232 { 233 233 struct ssam_controller *ctrl; 234 + int ret; 234 235 235 236 ctrl = serdev_device_get_drvdata(dev); 236 - return ssam_controller_receive_buf(ctrl, buf, n); 237 + ret = ssam_controller_receive_buf(ctrl, buf, n); 238 + 239 + return ret < 0 ? 0 : ret; 237 240 } 238 241 239 242 static void ssam_write_wakeup(struct serdev_device *dev)
+1 -1
drivers/platform/x86/Kconfig
··· 265 265 depends on RFKILL || RFKILL = n 266 266 depends on HOTPLUG_PCI 267 267 depends on ACPI_VIDEO || ACPI_VIDEO = n 268 + depends on SERIO_I8042 || SERIO_I8042 = n 268 269 select INPUT_SPARSEKMAP 269 270 select LEDS_CLASS 270 271 select NEW_LEDS ··· 282 281 config ASUS_NB_WMI 283 282 tristate "Asus Notebook WMI Driver" 284 283 depends on ASUS_WMI 285 - depends on SERIO_I8042 || SERIO_I8042 = n 286 284 help 287 285 This is a driver for newer Asus notebooks. It adds extra features 288 286 like wireless radio and bluetooth control, leds, hotkeys, backlight...
+2 -29
drivers/platform/x86/amd/pmc/pmc.c
··· 964 964 { } 965 965 }; 966 966 967 - static int amd_pmc_get_dram_size(struct amd_pmc_dev *dev) 968 - { 969 - int ret; 970 - 971 - switch (dev->cpu_id) { 972 - case AMD_CPU_ID_YC: 973 - if (!(dev->major > 90 || (dev->major == 90 && dev->minor > 39))) { 974 - ret = -EINVAL; 975 - goto err_dram_size; 976 - } 977 - break; 978 - default: 979 - ret = -EINVAL; 980 - goto err_dram_size; 981 - } 982 - 983 - ret = amd_pmc_send_cmd(dev, S2D_DRAM_SIZE, &dev->dram_size, dev->s2d_msg_id, true); 984 - if (ret || !dev->dram_size) 985 - goto err_dram_size; 986 - 987 - return 0; 988 - 989 - err_dram_size: 990 - dev_err(dev->dev, "DRAM size command not supported for this platform\n"); 991 - return ret; 992 - } 993 - 994 967 static int amd_pmc_s2d_init(struct amd_pmc_dev *dev) 995 968 { 996 969 u32 phys_addr_low, phys_addr_hi; ··· 982 1009 return -EIO; 983 1010 984 1011 /* Get DRAM size */ 985 - ret = amd_pmc_get_dram_size(dev); 986 - if (ret) 1012 + ret = amd_pmc_send_cmd(dev, S2D_DRAM_SIZE, &dev->dram_size, dev->s2d_msg_id, true); 1013 + if (ret || !dev->dram_size) 987 1014 dev->dram_size = S2D_TELEMETRY_DRAMBYTES_MAX; 988 1015 989 1016 /* Get STB DRAM address */
+38 -23
drivers/platform/x86/asus-nb-wmi.c
··· 48 48 MODULE_PARM_DESC(tablet_mode_sw, "Tablet mode detect: -1:auto 0:disable 1:kbd-dock 2:lid-flip 3:lid-flip-rog"); 49 49 50 50 static struct quirk_entry *quirks; 51 + static bool atkbd_reports_vol_keys; 51 52 52 - static bool asus_q500a_i8042_filter(unsigned char data, unsigned char str, 53 - struct serio *port) 53 + static bool asus_i8042_filter(unsigned char data, unsigned char str, struct serio *port) 54 54 { 55 - static bool extended; 56 - bool ret = false; 55 + static bool extended_e0; 56 + static bool extended_e1; 57 57 58 58 if (str & I8042_STR_AUXDATA) 59 59 return false; 60 60 61 - if (unlikely(data == 0xe1)) { 62 - extended = true; 63 - ret = true; 64 - } else if (unlikely(extended)) { 65 - extended = false; 66 - ret = true; 61 + if (quirks->filter_i8042_e1_extended_codes) { 62 + if (data == 0xe1) { 63 + extended_e1 = true; 64 + return true; 65 + } 66 + 67 + if (extended_e1) { 68 + extended_e1 = false; 69 + return true; 70 + } 67 71 } 68 72 69 - return ret; 73 + if (data == 0xe0) { 74 + extended_e0 = true; 75 + } else if (extended_e0) { 76 + extended_e0 = false; 77 + 78 + switch (data & 0x7f) { 79 + case 0x20: /* e0 20 / e0 a0, Volume Mute press / release */ 80 + case 0x2e: /* e0 2e / e0 ae, Volume Down press / release */ 81 + case 0x30: /* e0 30 / e0 b0, Volume Up press / release */ 82 + atkbd_reports_vol_keys = true; 83 + break; 84 + } 85 + } 86 + 87 + return false; 70 88 } 71 89 72 90 static struct quirk_entry quirk_asus_unknown = { ··· 93 75 }; 94 76 95 77 static struct quirk_entry quirk_asus_q500a = { 96 - .i8042_filter = asus_q500a_i8042_filter, 78 + .filter_i8042_e1_extended_codes = true, 97 79 .wmi_backlight_set_devstate = true, 98 80 }; 99 81 ··· 521 503 522 504 static void asus_nb_wmi_quirks(struct asus_wmi_driver *driver) 523 505 { 524 - int ret; 525 - 526 506 quirks = &quirk_asus_unknown; 527 507 dmi_check_system(asus_quirks); 528 508 ··· 535 519 536 520 if (tablet_mode_sw != -1) 537 521 quirks->tablet_switch_mode = tablet_mode_sw; 538 - 539 - if (quirks->i8042_filter) { 540 - ret = i8042_install_filter(quirks->i8042_filter); 541 - if (ret) { 542 - pr_warn("Unable to install key filter\n"); 543 - return; 544 - } 545 - pr_info("Using i8042 filter function for receiving events\n"); 546 - } 547 522 } 548 523 549 524 static const struct key_entry asus_nb_wmi_keymap[] = { ··· 625 618 *code = ASUS_WMI_KEY_IGNORE; 626 619 627 620 break; 621 + case 0x30: /* Volume Up */ 622 + case 0x31: /* Volume Down */ 623 + case 0x32: /* Volume Mute */ 624 + if (atkbd_reports_vol_keys) 625 + *code = ASUS_WMI_KEY_IGNORE; 626 + 627 + break; 628 628 } 629 629 } 630 630 ··· 644 630 .input_phys = ASUS_NB_WMI_FILE "/input0", 645 631 .detect_quirks = asus_nb_wmi_quirks, 646 632 .key_filter = asus_nb_wmi_key_filter, 633 + .i8042_filter = asus_i8042_filter, 647 634 }; 648 635 649 636
+58
drivers/platform/x86/asus-wmi.c
··· 16 16 #include <linux/acpi.h> 17 17 #include <linux/backlight.h> 18 18 #include <linux/debugfs.h> 19 + #include <linux/delay.h> 19 20 #include <linux/dmi.h> 20 21 #include <linux/fb.h> 21 22 #include <linux/hwmon.h> ··· 132 131 #define ASUS_SCREENPAD_BRIGHT_MIN 20 133 132 #define ASUS_SCREENPAD_BRIGHT_MAX 255 134 133 #define ASUS_SCREENPAD_BRIGHT_DEFAULT 60 134 + 135 + /* Controls the power state of the USB0 hub on ROG Ally which input is on */ 136 + #define ASUS_USB0_PWR_EC0_CSEE "\\_SB.PCI0.SBRG.EC0.CSEE" 137 + /* 300ms so far seems to produce a reliable result on AC and battery */ 138 + #define ASUS_USB0_PWR_EC0_CSEE_WAIT 300 135 139 136 140 static const char * const ashs_ids[] = { "ATK4001", "ATK4002", NULL }; 137 141 ··· 305 299 struct work_struct hotplug_work; 306 300 307 301 bool fnlock_locked; 302 + 303 + /* The ROG Ally device requires the MCU USB device be disconnected before suspend */ 304 + bool ally_mcu_usb_switch; 308 305 309 306 struct asus_wmi_debug debug; 310 307 ··· 4497 4488 asus->nv_temp_tgt_available = asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_NV_THERM_TARGET); 4498 4489 asus->panel_overdrive_available = asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_PANEL_OD); 4499 4490 asus->mini_led_mode_available = asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_MINI_LED_MODE); 4491 + asus->ally_mcu_usb_switch = acpi_has_method(NULL, ASUS_USB0_PWR_EC0_CSEE) 4492 + && dmi_match(DMI_BOARD_NAME, "RC71L"); 4500 4493 4501 4494 err = fan_boost_mode_check_present(asus); 4502 4495 if (err) ··· 4578 4567 goto fail_wmi_handler; 4579 4568 } 4580 4569 4570 + if (asus->driver->i8042_filter) { 4571 + err = i8042_install_filter(asus->driver->i8042_filter); 4572 + if (err) 4573 + pr_warn("Unable to install key filter - %d\n", err); 4574 + } 4575 + 4581 4576 asus_wmi_battery_init(asus); 4582 4577 4583 4578 asus_wmi_debugfs_init(asus); ··· 4620 4603 struct asus_wmi *asus; 4621 4604 4622 4605 asus = platform_get_drvdata(device); 4606 + if (asus->driver->i8042_filter) 4607 + i8042_remove_filter(asus->driver->i8042_filter); 4623 4608 wmi_remove_notify_handler(asus->driver->event_guid); 4624 4609 asus_wmi_backlight_exit(asus); 4625 4610 asus_screenpad_exit(asus); ··· 4672 4653 asus_wmi_fnlock_update(asus); 4673 4654 4674 4655 asus_wmi_tablet_mode_get_state(asus); 4656 + 4657 + return 0; 4658 + } 4659 + 4660 + static int asus_hotk_resume_early(struct device *device) 4661 + { 4662 + struct asus_wmi *asus = dev_get_drvdata(device); 4663 + 4664 + if (asus->ally_mcu_usb_switch) { 4665 + if (ACPI_FAILURE(acpi_execute_simple_method(NULL, ASUS_USB0_PWR_EC0_CSEE, 0xB8))) 4666 + dev_err(device, "ROG Ally MCU failed to connect USB dev\n"); 4667 + else 4668 + msleep(ASUS_USB0_PWR_EC0_CSEE_WAIT); 4669 + } 4670 + return 0; 4671 + } 4672 + 4673 + static int asus_hotk_prepare(struct device *device) 4674 + { 4675 + struct asus_wmi *asus = dev_get_drvdata(device); 4676 + int result, err; 4677 + 4678 + if (asus->ally_mcu_usb_switch) { 4679 + /* When powersave is enabled it causes many issues with resume of USB hub */ 4680 + result = asus_wmi_get_devstate_simple(asus, ASUS_WMI_DEVID_MCU_POWERSAVE); 4681 + if (result == 1) { 4682 + dev_warn(device, "MCU powersave enabled, disabling to prevent resume issues"); 4683 + err = asus_wmi_set_devstate(ASUS_WMI_DEVID_MCU_POWERSAVE, 0, &result); 4684 + if (err || result != 1) 4685 + dev_err(device, "Failed to set MCU powersave mode: %d\n", err); 4686 + } 4687 + /* sleep required to ensure USB0 is disabled before sleep continues */ 4688 + if (ACPI_FAILURE(acpi_execute_simple_method(NULL, ASUS_USB0_PWR_EC0_CSEE, 0xB7))) 4689 + dev_err(device, "ROG Ally MCU failed to disconnect USB dev\n"); 4690 + else 4691 + msleep(ASUS_USB0_PWR_EC0_CSEE_WAIT); 4692 + } 4675 4693 return 0; 4676 4694 } 4677 4695 ··· 4756 4700 .thaw = asus_hotk_thaw, 4757 4701 .restore = asus_hotk_restore, 4758 4702 .resume = asus_hotk_resume, 4703 + .resume_early = asus_hotk_resume_early, 4704 + .prepare = asus_hotk_prepare, 4759 4705 }; 4760 4706 4761 4707 /* Registration ***************************************************************/
+4 -3
drivers/platform/x86/asus-wmi.h
··· 39 39 bool wmi_backlight_set_devstate; 40 40 bool wmi_force_als_set; 41 41 bool wmi_ignore_fan; 42 + bool filter_i8042_e1_extended_codes; 42 43 enum asus_wmi_tablet_switch_mode tablet_switch_mode; 43 44 int wapf; 44 45 /* ··· 50 49 */ 51 50 int no_display_toggle; 52 51 u32 xusb2pr; 53 - 54 - bool (*i8042_filter)(unsigned char data, unsigned char str, 55 - struct serio *serio); 56 52 }; 57 53 58 54 struct asus_wmi_driver { ··· 71 73 * Return ASUS_WMI_KEY_IGNORE in code if event should be ignored. */ 72 74 void (*key_filter) (struct asus_wmi_driver *driver, int *code, 73 75 unsigned int *value, bool *autorelease); 76 + /* Optional standard i8042 filter */ 77 + bool (*i8042_filter)(unsigned char data, unsigned char str, 78 + struct serio *serio); 74 79 75 80 int (*probe) (struct platform_device *device); 76 81 void (*detect_quirks) (struct asus_wmi_driver *driver);
+11 -15
drivers/platform/x86/hp/hp-bioscfg/bioscfg.c
··· 588 588 static int hp_add_other_attributes(int attr_type) 589 589 { 590 590 struct kobject *attr_name_kobj; 591 - union acpi_object *obj = NULL; 592 591 int ret; 593 592 char *attr_name; 594 593 595 - mutex_lock(&bioscfg_drv.mutex); 596 - 597 594 attr_name_kobj = kzalloc(sizeof(*attr_name_kobj), GFP_KERNEL); 598 - if (!attr_name_kobj) { 599 - ret = -ENOMEM; 600 - goto err_other_attr_init; 601 - } 595 + if (!attr_name_kobj) 596 + return -ENOMEM; 597 + 598 + mutex_lock(&bioscfg_drv.mutex); 602 599 603 600 /* Check if attribute type is supported */ 604 601 switch (attr_type) { ··· 612 615 default: 613 616 pr_err("Error: Unknown attr_type: %d\n", attr_type); 614 617 ret = -EINVAL; 615 - goto err_other_attr_init; 618 + kfree(attr_name_kobj); 619 + goto unlock_drv_mutex; 616 620 } 617 621 618 622 ret = kobject_init_and_add(attr_name_kobj, &attr_name_ktype, 619 623 NULL, "%s", attr_name); 620 624 if (ret) { 621 625 pr_err("Error encountered [%d]\n", ret); 622 - kobject_put(attr_name_kobj); 623 626 goto err_other_attr_init; 624 627 } 625 628 ··· 627 630 switch (attr_type) { 628 631 case HPWMI_SECURE_PLATFORM_TYPE: 629 632 ret = hp_populate_secure_platform_data(attr_name_kobj); 630 - if (ret) 631 - goto err_other_attr_init; 632 633 break; 633 634 634 635 case HPWMI_SURE_START_TYPE: 635 636 ret = hp_populate_sure_start_data(attr_name_kobj); 636 - if (ret) 637 - goto err_other_attr_init; 638 637 break; 639 638 640 639 default: 641 640 ret = -EINVAL; 642 - goto err_other_attr_init; 643 641 } 642 + 643 + if (ret) 644 + goto err_other_attr_init; 644 645 645 646 mutex_unlock(&bioscfg_drv.mutex); 646 647 return 0; 647 648 648 649 err_other_attr_init: 650 + kobject_put(attr_name_kobj); 651 + unlock_drv_mutex: 649 652 mutex_unlock(&bioscfg_drv.mutex); 650 - kfree(obj); 651 653 return ret; 652 654 } 653 655
+5 -6
drivers/platform/x86/ideapad-laptop.c
··· 1425 1425 if (WARN_ON(priv->kbd_bl.initialized)) 1426 1426 return -EEXIST; 1427 1427 1428 - brightness = ideapad_kbd_bl_brightness_get(priv); 1429 - if (brightness < 0) 1430 - return brightness; 1431 - 1432 - priv->kbd_bl.last_brightness = brightness; 1433 - 1434 1428 if (ideapad_kbd_bl_check_tristate(priv->kbd_bl.type)) { 1435 1429 priv->kbd_bl.led.max_brightness = 2; 1436 1430 } else { 1437 1431 priv->kbd_bl.led.max_brightness = 1; 1438 1432 } 1439 1433 1434 + brightness = ideapad_kbd_bl_brightness_get(priv); 1435 + if (brightness < 0) 1436 + return brightness; 1437 + 1438 + priv->kbd_bl.last_brightness = brightness; 1440 1439 priv->kbd_bl.led.name = "platform::" LED_FUNCTION_KBD_BACKLIGHT; 1441 1440 priv->kbd_bl.led.brightness_get = ideapad_kbd_bl_led_cdev_brightness_get; 1442 1441 priv->kbd_bl.led.brightness_set_blocking = ideapad_kbd_bl_led_cdev_brightness_set;
+2 -2
drivers/platform/x86/intel/telemetry/core.c
··· 102 102 /** 103 103 * telemetry_update_events() - Update telemetry Configuration 104 104 * @pss_evtconfig: PSS related config. No change if num_evts = 0. 105 - * @pss_evtconfig: IOSS related config. No change if num_evts = 0. 105 + * @ioss_evtconfig: IOSS related config. No change if num_evts = 0. 106 106 * 107 107 * This API updates the IOSS & PSS Telemetry configuration. Old config 108 108 * is overwritten. Call telemetry_reset_events when logging is over ··· 176 176 /** 177 177 * telemetry_get_eventconfig() - Returns the pss and ioss events enabled 178 178 * @pss_evtconfig: Pointer to PSS related configuration. 179 - * @pss_evtconfig: Pointer to IOSS related configuration. 179 + * @ioss_evtconfig: Pointer to IOSS related configuration. 180 180 * @pss_len: Number of u32 elements allocated for pss_evtconfig array 181 181 * @ioss_len: Number of u32 elements allocated for ioss_evtconfig array 182 182 *
+5
drivers/platform/x86/wmi.c
··· 1346 1346 if (debug_dump_wdg) 1347 1347 wmi_dump_wdg(&gblock[i]); 1348 1348 1349 + if (!gblock[i].instance_count) { 1350 + dev_info(wmi_bus_dev, FW_INFO "%pUL has zero instances\n", &gblock[i].guid); 1351 + continue; 1352 + } 1353 + 1349 1354 if (guid_already_parsed_for_legacy(device, &gblock[i].guid)) 1350 1355 continue; 1351 1356
+3
include/linux/platform_data/x86/asus-wmi.h
··· 114 114 /* Charging mode - 1=Barrel, 2=USB */ 115 115 #define ASUS_WMI_DEVID_CHARGE_MODE 0x0012006C 116 116 117 + /* MCU powersave mode */ 118 + #define ASUS_WMI_DEVID_MCU_POWERSAVE 0x001200E2 119 + 117 120 /* epu is connected? 1 == true */ 118 121 #define ASUS_WMI_DEVID_EGPU_CONNECTED 0x00090018 119 122 /* egpu on/off */