History

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

Hans de Goede committed 2 years ago

Commit 23e65242 parents 682b43a 3494a5914 files · +173 −97Browse files

Unified · Split

14 files
  1. MAINTAINERS +0 −4
  2. drivers/platform/mellanox/mlxbf-bootctl.c +26 −13
  3. drivers/platform/mellanox/mlxbf-pmc.c +14 −0
  4. drivers/platform/surface/aggregator/core.c +4 −1
  5. drivers/platform/x86/Kconfig +1 −1
  6. drivers/platform/x86/amd/pmc/pmc.c +2 −29
  7. drivers/platform/x86/asus-nb-wmi.c +38 −23
  8. drivers/platform/x86/asus-wmi.c +58 −0
  9. drivers/platform/x86/asus-wmi.h +4 −3
  10. drivers/platform/x86/hp/hp-bioscfg/bioscfg.c +11 −15
  11. drivers/platform/x86/ideapad-laptop.c +5 −6
  12. drivers/platform/x86/intel/telemetry/core.c +2 −2
  13. drivers/platform/x86/wmi.c +5 −0
  14. include/linux/platform_data/x86/asus-wmi.h +3 −0
MAINTAINERS+0−4
@@ -11025,7 +11025,6 @@ F: drivers/net/wireless/intel/iwlwifi/ · 11024 unmodified lines
1102511025
1102611026 INTEL WMI SLIM BOOTLOADER (SBL) FIRMWARE UPDATE DRIVER
1102711027 M: Jithu Joseph <jithu.joseph@intel.com>
11028−R: Maurice Ma <maurice.ma@intel.com>
1102911028 S: Maintained
1103011029 W: https://slimbootloader.github.io/security/firmware-update.html
1103111030 F: drivers/platform/x86/intel/wmi/sbl-fw-update.c
@@ -13779,7 +13778,6 @@ F: drivers/net/ethernet/mellanox/mlxfw/ · 2747 unmodified lines
1377913778 MELLANOX HARDWARE PLATFORM SUPPORT
1378013779 M: Hans de Goede <hdegoede@redhat.com>
1378113780 M: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
13782−M: Mark Gross <markgross@kernel.org>
1378313781 M: Vadim Pasternak <vadimp@nvidia.com>
1378413782 L: platform-driver-x86@vger.kernel.org
1378513783 S: Supported
@@ -14388,7 +14386,6 @@ F: drivers/platform/surface/surface_gpe.c · 602 unmodified lines
1438814386 MICROSOFT SURFACE HARDWARE PLATFORM SUPPORT
1438914387 M: Hans de Goede <hdegoede@redhat.com>
1439014388 M: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
14391−M: Mark Gross <markgross@kernel.org>
1439214389 M: Maximilian Luz <luzmaximilian@gmail.com>
1439314390 L: platform-driver-x86@vger.kernel.org
1439414391 S: Maintained
@@ -23654,7 +23651,6 @@ F: drivers/platform/x86/x86-android-tablets/ · 9259 unmodified lines
2365423651 X86 PLATFORM DRIVERS
2365523652 M: Hans de Goede <hdegoede@redhat.com>
2365623653 M: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
23657−M: Mark Gross <markgross@kernel.org>
2365823654 L: platform-driver-x86@vger.kernel.org
2365923655 S: Maintained
2366023656 Q: https://patchwork.kernel.org/project/platform-driver-x86/list/
drivers/platform/mellanox/mlxbf-bootctl.c+26−13
@@ -20,6 +20,7 @@ · 19 unmodified lines
2020
2121 #define MLXBF_BOOTCTL_SB_SECURE_MASK 0x03
2222 #define MLXBF_BOOTCTL_SB_TEST_MASK 0x0c
23+#define MLXBF_BOOTCTL_SB_DEV_MASK BIT(4)
2324
2425 #define MLXBF_SB_KEY_NUM 4
2526
@@ -40,11 +41,18 @@ static struct mlxbf_bootctl_name boot_names[] = { · 14 unmodified lines
4041 { MLXBF_BOOTCTL_NONE, "none" },
4142 };
4243
44+enum {
45+ MLXBF_BOOTCTL_SB_LIFECYCLE_PRODUCTION = 0,
46+ MLXBF_BOOTCTL_SB_LIFECYCLE_GA_SECURE = 1,
47+ MLXBF_BOOTCTL_SB_LIFECYCLE_GA_NON_SECURE = 2,
48+ MLXBF_BOOTCTL_SB_LIFECYCLE_RMA = 3
49+};
50+
4351 static const char * const mlxbf_bootctl_lifecycle_states[] = {
44− [0] = "Production",
45− [1] = "GA Secured",
46− [2] = "GA Non-Secured",
47− [3] = "RMA",
52+ [MLXBF_BOOTCTL_SB_LIFECYCLE_PRODUCTION] = "Production",
53+ [MLXBF_BOOTCTL_SB_LIFECYCLE_GA_SECURE] = "GA Secured",
54+ [MLXBF_BOOTCTL_SB_LIFECYCLE_GA_NON_SECURE] = "GA Non-Secured",
55+ [MLXBF_BOOTCTL_SB_LIFECYCLE_RMA] = "RMA",
4856 };
4957
5058 /* Log header format. */
@@ -247,25 +255,30 @@ static ssize_t second_reset_action_store(struct device *dev, · 196 unmodified lines
247255 static ssize_t lifecycle_state_show(struct device *dev,
248256 struct device_attribute *attr, char *buf)
249257 {
258+ int status_bits;
259+ int use_dev_key;
260+ int test_state;
250261 int lc_state;
251262
252− lc_state = mlxbf_bootctl_smc(MLXBF_BOOTCTL_GET_TBB_FUSE_STATUS,
253− MLXBF_BOOTCTL_FUSE_STATUS_LIFECYCLE);
254− if (lc_state < 0)
255− return lc_state;
263+ status_bits = mlxbf_bootctl_smc(MLXBF_BOOTCTL_GET_TBB_FUSE_STATUS,
264+ MLXBF_BOOTCTL_FUSE_STATUS_LIFECYCLE);
265+ if (status_bits < 0)
266+ return status_bits;
256267
257− lc_state &=
258− MLXBF_BOOTCTL_SB_TEST_MASK | MLXBF_BOOTCTL_SB_SECURE_MASK;
268+ use_dev_key = status_bits & MLXBF_BOOTCTL_SB_DEV_MASK;
269+ test_state = status_bits & MLXBF_BOOTCTL_SB_TEST_MASK;
270+ lc_state = status_bits & MLXBF_BOOTCTL_SB_SECURE_MASK;
259271
260272 /*
261273 * If the test bits are set, we specify that the current state may be
262274 * due to using the test bits.
263275 */
264− if (lc_state & MLXBF_BOOTCTL_SB_TEST_MASK) {
265− lc_state &= MLXBF_BOOTCTL_SB_SECURE_MASK;
266−
276+ if (test_state) {
267277 return sprintf(buf, "%s(test)\n",
268278 mlxbf_bootctl_lifecycle_states[lc_state]);
279+ } else if (use_dev_key &&
280+ (lc_state == MLXBF_BOOTCTL_SB_LIFECYCLE_GA_SECURE)) {
281+ return sprintf(buf, "Secured (development)\n");
269282 }
270283
271284 return sprintf(buf, "%s\n", mlxbf_bootctl_lifecycle_states[lc_state]);
drivers/platform/mellanox/mlxbf-pmc.c+14−0
@@ -1771,6 +1771,8 @@ static int mlxbf_pmc_init_perftype_counter(struct device *dev, int blk_num) · 1770 unmodified lines
17711771 attr->dev_attr.show = mlxbf_pmc_event_list_show;
17721772 attr->nr = blk_num;
17731773 attr->dev_attr.attr.name = devm_kasprintf(dev, GFP_KERNEL, "event_list");
1774+ if (!attr->dev_attr.attr.name)
1775+ return -ENOMEM;
17741776 pmc->block[blk_num].block_attr[i] = &attr->dev_attr.attr;
17751777 attr = NULL;
17761778
@@ -1784,6 +1786,8 @@ static int mlxbf_pmc_init_perftype_counter(struct device *dev, int blk_num) · 7 unmodified lines
17841786 attr->nr = blk_num;
17851787 attr->dev_attr.attr.name = devm_kasprintf(dev, GFP_KERNEL,
17861788 "enable");
1789+ if (!attr->dev_attr.attr.name)
1790+ return -ENOMEM;
17871791 pmc->block[blk_num].block_attr[++i] = &attr->dev_attr.attr;
17881792 attr = NULL;
17891793 }
@@ -1810,6 +1814,8 @@ static int mlxbf_pmc_init_perftype_counter(struct device *dev, int blk_num) · 20 unmodified lines
18101814 attr->nr = blk_num;
18111815 attr->dev_attr.attr.name = devm_kasprintf(dev, GFP_KERNEL,
18121816 "counter%d", j);
1817+ if (!attr->dev_attr.attr.name)
1818+ return -ENOMEM;
18131819 pmc->block[blk_num].block_attr[++i] = &attr->dev_attr.attr;
18141820 attr = NULL;
18151821
@@ -1821,6 +1827,8 @@ static int mlxbf_pmc_init_perftype_counter(struct device *dev, int blk_num) · 5 unmodified lines
18211827 attr->nr = blk_num;
18221828 attr->dev_attr.attr.name = devm_kasprintf(dev, GFP_KERNEL,
18231829 "event%d", j);
1830+ if (!attr->dev_attr.attr.name)
1831+ return -ENOMEM;
18241832 pmc->block[blk_num].block_attr[++i] = &attr->dev_attr.attr;
18251833 attr = NULL;
18261834 }
@@ -1853,6 +1861,8 @@ static int mlxbf_pmc_init_perftype_reg(struct device *dev, int blk_num) · 26 unmodified lines
18531861 attr->nr = blk_num;
18541862 attr->dev_attr.attr.name = devm_kasprintf(dev, GFP_KERNEL,
18551863 events[j].evt_name);
1864+ if (!attr->dev_attr.attr.name)
1865+ return -ENOMEM;
18561866 pmc->block[blk_num].block_attr[i] = &attr->dev_attr.attr;
18571867 attr = NULL;
18581868 i++;
@@ -1882,6 +1892,8 @@ static int mlxbf_pmc_create_groups(struct device *dev, int blk_num) · 23 unmodified lines
18821892 pmc->block[blk_num].block_attr_grp.attrs = pmc->block[blk_num].block_attr;
18831893 pmc->block[blk_num].block_attr_grp.name = devm_kasprintf(
18841894 dev, GFP_KERNEL, pmc->block_name[blk_num]);
1895+ if (!pmc->block[blk_num].block_attr_grp.name)
1896+ return -ENOMEM;
18851897 pmc->groups[pmc->group_num] = &pmc->block[blk_num].block_attr_grp;
18861898 pmc->group_num++;
18871899
@@ -2063,6 +2075,8 @@ static int mlxbf_pmc_probe(struct platform_device *pdev) · 175 unmodified lines
20632075
20642076 pmc->hwmon_dev = devm_hwmon_device_register_with_groups(
20652077 dev, "bfperf", pmc, pmc->groups);
2078+ if (IS_ERR(pmc->hwmon_dev))
2079+ return PTR_ERR(pmc->hwmon_dev);
20662080 platform_set_drvdata(pdev, pmc);
20672081
20682082 return 0;
drivers/platform/surface/aggregator/core.c+4−1
@@ -231,9 +231,12 @@ static int ssam_receive_buf(struct serdev_device *dev, const unsigned char *buf, · 230 unmodified lines
231231 size_t n)
232232 {
233233 struct ssam_controller *ctrl;
234+ int ret;
234235
235236 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;
237240 }
238241
239242 static void ssam_write_wakeup(struct serdev_device *dev)
drivers/platform/x86/Kconfig+1−1
@@ -265,6 +265,7 @@ config ASUS_WMI · 264 unmodified lines
265265 depends on RFKILL || RFKILL = n
266266 depends on HOTPLUG_PCI
267267 depends on ACPI_VIDEO || ACPI_VIDEO = n
268+ depends on SERIO_I8042 || SERIO_I8042 = n
268269 select INPUT_SPARSEKMAP
269270 select LEDS_CLASS
270271 select NEW_LEDS
@@ -281,7 +282,6 @@ config ASUS_WMI · 10 unmodified lines
281282 config ASUS_NB_WMI
282283 tristate "Asus Notebook WMI Driver"
283284 depends on ASUS_WMI
284− depends on SERIO_I8042 || SERIO_I8042 = n
285285 help
286286 This is a driver for newer Asus notebooks. It adds extra features
287287 like wireless radio and bluetooth control, leds, hotkeys, backlight...
drivers/platform/x86/amd/pmc/pmc.c+2−29
@@ -964,33 +964,6 @@ static const struct pci_device_id pmc_pci_ids[] = { · 963 unmodified lines
964964 { }
965965 };
966966
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−
994967 static int amd_pmc_s2d_init(struct amd_pmc_dev *dev)
995968 {
996969 u32 phys_addr_low, phys_addr_hi;
@@ -1009,8 +982,8 @@ static int amd_pmc_s2d_init(struct amd_pmc_dev *dev) · 12 unmodified lines
1009982 return -EIO;
1010983
1011984 /* Get DRAM size */
1012− ret = amd_pmc_get_dram_size(dev);
1013− if (ret)
985+ ret = amd_pmc_send_cmd(dev, S2D_DRAM_SIZE, &dev->dram_size, dev->s2d_msg_id, true);
986+ if (ret || !dev->dram_size)
1014987 dev->dram_size = S2D_TELEMETRY_DRAMBYTES_MAX;
1015988
1016989 /* Get STB DRAM address */
drivers/platform/x86/asus-nb-wmi.c+38−23
@@ -48,25 +48,43 @@ module_param(tablet_mode_sw, uint, 0444); · 47 unmodified lines
4848 MODULE_PARM_DESC(tablet_mode_sw, "Tablet mode detect: -1:auto 0:disable 1:kbd-dock 2:lid-flip 3:lid-flip-rog");
4949
5050 static struct quirk_entry *quirks;
51+static bool atkbd_reports_vol_keys;
5152
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)
5454 {
55− static bool extended;
56− bool ret = false;
55+ static bool extended_e0;
56+ static bool extended_e1;
5757
5858 if (str & I8042_STR_AUXDATA)
5959 return false;
6060
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+ }
6771 }
6872
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;
7088 }
7189
7290 static struct quirk_entry quirk_asus_unknown = {
@@ -75,7 +93,7 @@ static struct quirk_entry quirk_asus_unknown = { · 2 unmodified lines
7593 };
7694
7795 static struct quirk_entry quirk_asus_q500a = {
78− .i8042_filter = asus_q500a_i8042_filter,
96+ .filter_i8042_e1_extended_codes = true,
7997 .wmi_backlight_set_devstate = true,
8098 };
8199
@@ -503,8 +521,6 @@ static const struct dmi_system_id asus_quirks[] = { · 421 unmodified lines
503521
504522 static void asus_nb_wmi_quirks(struct asus_wmi_driver *driver)
505523 {
506− int ret;
507−
508524 quirks = &quirk_asus_unknown;
509525 dmi_check_system(asus_quirks);
510526
@@ -519,15 +535,6 @@ static void asus_nb_wmi_quirks(struct asus_wmi_driver *driver) · 8 unmodified lines
519535
520536 if (tablet_mode_sw != -1)
521537 quirks->tablet_switch_mode = tablet_mode_sw;
522−
523− if (quirks->i8042_filter) {
524− ret = i8042_install_filter(quirks->i8042_filter);
525− if (ret) {
526− pr_warn("Unable to install key filter\n");
527− return;
528− }
529− pr_info("Using i8042 filter function for receiving events\n");
530− }
531538 }
532539
533540 static const struct key_entry asus_nb_wmi_keymap[] = {
@@ -617,6 +624,13 @@ static void asus_nb_wmi_key_filter(struct asus_wmi_driver *asus_wmi, int *code, · 83 unmodified lines
617624 if (acpi_video_handles_brightness_key_presses())
618625 *code = ASUS_WMI_KEY_IGNORE;
619626
627+ break;
628+ case 0x30: /* Volume Up */
629+ case 0x31: /* Volume Down */
630+ case 0x32: /* Volume Mute */
631+ if (atkbd_reports_vol_keys)
632+ *code = ASUS_WMI_KEY_IGNORE;
633+
620634 break;
621635 }
622636 }
@@ -630,6 +644,7 @@ static struct asus_wmi_driver asus_nb_wmi_driver = { · 7 unmodified lines
630644 .input_phys = ASUS_NB_WMI_FILE "/input0",
631645 .detect_quirks = asus_nb_wmi_quirks,
632646 .key_filter = asus_nb_wmi_key_filter,
647+ .i8042_filter = asus_i8042_filter,
633648 };
634649
635650
drivers/platform/x86/asus-wmi.c+58−0
@@ -16,6 +16,7 @@ · 15 unmodified lines
1616 #include <linux/acpi.h>
1717 #include <linux/backlight.h>
1818 #include <linux/debugfs.h>
19+#include <linux/delay.h>
1920 #include <linux/dmi.h>
2021 #include <linux/fb.h>
2122 #include <linux/hwmon.h>
@@ -132,6 +133,11 @@ module_param(fnlock_default, bool, 0444); · 110 unmodified lines
132133 #define ASUS_SCREENPAD_BRIGHT_MAX 255
133134 #define ASUS_SCREENPAD_BRIGHT_DEFAULT 60
134135
136+/* Controls the power state of the USB0 hub on ROG Ally which input is on */
137+#define ASUS_USB0_PWR_EC0_CSEE "\\_SB.PCI0.SBRG.EC0.CSEE"
138+/* 300ms so far seems to produce a reliable result on AC and battery */
139+#define ASUS_USB0_PWR_EC0_CSEE_WAIT 300
140+
135141 static const char * const ashs_ids[] = { "ATK4001", "ATK4002", NULL };
136142
137143 static int throttle_thermal_policy_write(struct asus_wmi *);
@@ -300,6 +306,9 @@ struct asus_wmi { · 162 unmodified lines
300306
301307 bool fnlock_locked;
302308
309+ /* The ROG Ally device requires the MCU USB device be disconnected before suspend */
310+ bool ally_mcu_usb_switch;
311+
303312 struct asus_wmi_debug debug;
304313
305314 struct asus_wmi_driver *driver;
@@ -4488,6 +4497,8 @@ static int asus_wmi_add(struct platform_device *pdev) · 4182 unmodified lines
44884497 asus->nv_temp_tgt_available = asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_NV_THERM_TARGET);
44894498 asus->panel_overdrive_available = asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_PANEL_OD);
44904499 asus->mini_led_mode_available = asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_MINI_LED_MODE);
4500+ asus->ally_mcu_usb_switch = acpi_has_method(NULL, ASUS_USB0_PWR_EC0_CSEE)
4501+ && dmi_match(DMI_BOARD_NAME, "RC71L");
44914502
44924503 err = fan_boost_mode_check_present(asus);
44934504 if (err)
@@ -4567,6 +4578,12 @@ static int asus_wmi_add(struct platform_device *pdev) · 73 unmodified lines
45674578 goto fail_wmi_handler;
45684579 }
45694580
4581+ if (asus->driver->i8042_filter) {
4582+ err = i8042_install_filter(asus->driver->i8042_filter);
4583+ if (err)
4584+ pr_warn("Unable to install key filter - %d\n", err);
4585+ }
4586+
45704587 asus_wmi_battery_init(asus);
45714588
45724589 asus_wmi_debugfs_init(asus);
@@ -4603,6 +4620,8 @@ static void asus_wmi_remove(struct platform_device *device) · 30 unmodified lines
46034620 struct asus_wmi *asus;
46044621
46054622 asus = platform_get_drvdata(device);
4623+ if (asus->driver->i8042_filter)
4624+ i8042_remove_filter(asus->driver->i8042_filter);
46064625 wmi_remove_notify_handler(asus->driver->event_guid);
46074626 asus_wmi_backlight_exit(asus);
46084627 asus_screenpad_exit(asus);
@@ -4653,6 +4672,43 @@ static int asus_hotk_resume(struct device *device) · 44 unmodified lines
46534672 asus_wmi_fnlock_update(asus);
46544673
46554674 asus_wmi_tablet_mode_get_state(asus);
4675+
4676+ return 0;
4677+}
4678+
4679+static int asus_hotk_resume_early(struct device *device)
4680+{
4681+ struct asus_wmi *asus = dev_get_drvdata(device);
4682+
4683+ if (asus->ally_mcu_usb_switch) {
4684+ if (ACPI_FAILURE(acpi_execute_simple_method(NULL, ASUS_USB0_PWR_EC0_CSEE, 0xB8)))
4685+ dev_err(device, "ROG Ally MCU failed to connect USB dev\n");
4686+ else
4687+ msleep(ASUS_USB0_PWR_EC0_CSEE_WAIT);
4688+ }
4689+ return 0;
4690+}
4691+
4692+static int asus_hotk_prepare(struct device *device)
4693+{
4694+ struct asus_wmi *asus = dev_get_drvdata(device);
4695+ int result, err;
4696+
4697+ if (asus->ally_mcu_usb_switch) {
4698+ /* When powersave is enabled it causes many issues with resume of USB hub */
4699+ result = asus_wmi_get_devstate_simple(asus, ASUS_WMI_DEVID_MCU_POWERSAVE);
4700+ if (result == 1) {
4701+ dev_warn(device, "MCU powersave enabled, disabling to prevent resume issues");
4702+ err = asus_wmi_set_devstate(ASUS_WMI_DEVID_MCU_POWERSAVE, 0, &result);
4703+ if (err || result != 1)
4704+ dev_err(device, "Failed to set MCU powersave mode: %d\n", err);
4705+ }
4706+ /* sleep required to ensure USB0 is disabled before sleep continues */
4707+ if (ACPI_FAILURE(acpi_execute_simple_method(NULL, ASUS_USB0_PWR_EC0_CSEE, 0xB7)))
4708+ dev_err(device, "ROG Ally MCU failed to disconnect USB dev\n");
4709+ else
4710+ msleep(ASUS_USB0_PWR_EC0_CSEE_WAIT);
4711+ }
46564712 return 0;
46574713 }
46584714
@@ -4700,6 +4756,8 @@ static const struct dev_pm_ops asus_pm_ops = { · 41 unmodified lines
47004756 .thaw = asus_hotk_thaw,
47014757 .restore = asus_hotk_restore,
47024758 .resume = asus_hotk_resume,
4759+ .resume_early = asus_hotk_resume_early,
4760+ .prepare = asus_hotk_prepare,
47034761 };
47044762
47054763 /* Registration ***************************************************************/
drivers/platform/x86/asus-wmi.h+4−3
@@ -39,6 +39,7 @@ struct quirk_entry { · 38 unmodified lines
3939 bool wmi_backlight_set_devstate;
4040 bool wmi_force_als_set;
4141 bool wmi_ignore_fan;
42+ bool filter_i8042_e1_extended_codes;
4243 enum asus_wmi_tablet_switch_mode tablet_switch_mode;
4344 int wapf;
4445 /*
@@ -49,9 +50,6 @@ struct quirk_entry { · 4 unmodified lines
4950 */
5051 int no_display_toggle;
5152 u32 xusb2pr;
52−
53− bool (*i8042_filter)(unsigned char data, unsigned char str,
54− struct serio *serio);
5553 };
5654
5755 struct asus_wmi_driver {
@@ -73,6 +71,9 @@ struct asus_wmi_driver { · 15 unmodified lines
7371 * Return ASUS_WMI_KEY_IGNORE in code if event should be ignored. */
7472 void (*key_filter) (struct asus_wmi_driver *driver, int *code,
7573 unsigned int *value, bool *autorelease);
74+ /* Optional standard i8042 filter */
75+ bool (*i8042_filter)(unsigned char data, unsigned char str,
76+ struct serio *serio);
7677
7778 int (*probe) (struct platform_device *device);
7879 void (*detect_quirks) (struct asus_wmi_driver *driver);
drivers/platform/x86/hp/hp-bioscfg/bioscfg.c+11−15
@@ -588,17 +588,14 @@ static void release_attributes_data(void) · 587 unmodified lines
588588 static int hp_add_other_attributes(int attr_type)
589589 {
590590 struct kobject *attr_name_kobj;
591− union acpi_object *obj = NULL;
592591 int ret;
593592 char *attr_name;
594593
595− mutex_lock(&bioscfg_drv.mutex);
596−
597594 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);
602599
603600 /* Check if attribute type is supported */
604601 switch (attr_type) {
@@ -615,14 +612,14 @@ static int hp_add_other_attributes(int attr_type) · 10 unmodified lines
615612 default:
616613 pr_err("Error: Unknown attr_type: %d\n", attr_type);
617614 ret = -EINVAL;
618− goto err_other_attr_init;
615+ kfree(attr_name_kobj);
616+ goto unlock_drv_mutex;
619617 }
620618
621619 ret = kobject_init_and_add(attr_name_kobj, &attr_name_ktype,
622620 NULL, "%s", attr_name);
623621 if (ret) {
624622 pr_err("Error encountered [%d]\n", ret);
625− kobject_put(attr_name_kobj);
626623 goto err_other_attr_init;
627624 }
628625
@@ -630,27 +627,26 @@ static int hp_add_other_attributes(int attr_type) · 1 unmodified line
630627 switch (attr_type) {
631628 case HPWMI_SECURE_PLATFORM_TYPE:
632629 ret = hp_populate_secure_platform_data(attr_name_kobj);
633− if (ret)
634− goto err_other_attr_init;
635630 break;
636631
637632 case HPWMI_SURE_START_TYPE:
638633 ret = hp_populate_sure_start_data(attr_name_kobj);
639− if (ret)
640− goto err_other_attr_init;
641634 break;
642635
643636 default:
644637 ret = -EINVAL;
645− goto err_other_attr_init;
646638 }
647639
640+ if (ret)
641+ goto err_other_attr_init;
642+
648643 mutex_unlock(&bioscfg_drv.mutex);
649644 return 0;
650645
651646 err_other_attr_init:
647+ kobject_put(attr_name_kobj);
648+unlock_drv_mutex:
652649 mutex_unlock(&bioscfg_drv.mutex);
653− kfree(obj);
654650 return ret;
655651 }
656652
drivers/platform/x86/ideapad-laptop.c+5−6
@@ -1425,18 +1425,17 @@ static int ideapad_kbd_bl_init(struct ideapad_private *priv) · 1424 unmodified lines
14251425 if (WARN_ON(priv->kbd_bl.initialized))
14261426 return -EEXIST;
14271427
1428− brightness = ideapad_kbd_bl_brightness_get(priv);
1429− if (brightness < 0)
1430− return brightness;
1431−
1432− priv->kbd_bl.last_brightness = brightness;
1433−
14341428 if (ideapad_kbd_bl_check_tristate(priv->kbd_bl.type)) {
14351429 priv->kbd_bl.led.max_brightness = 2;
14361430 } else {
14371431 priv->kbd_bl.led.max_brightness = 1;
14381432 }
14391433
1434+ brightness = ideapad_kbd_bl_brightness_get(priv);
1435+ if (brightness < 0)
1436+ return brightness;
1437+
1438+ priv->kbd_bl.last_brightness = brightness;
14401439 priv->kbd_bl.led.name = "platform::" LED_FUNCTION_KBD_BACKLIGHT;
14411440 priv->kbd_bl.led.brightness_get = ideapad_kbd_bl_led_cdev_brightness_get;
14421441 priv->kbd_bl.led.brightness_set_blocking = ideapad_kbd_bl_led_cdev_brightness_set;
drivers/platform/x86/intel/telemetry/core.c+2−2
@@ -102,7 +102,7 @@ static const struct telemetry_core_ops telm_defpltops = { · 101 unmodified lines
102102 /**
103103 * telemetry_update_events() - Update telemetry Configuration
104104 * @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.
106106 *
107107 * This API updates the IOSS & PSS Telemetry configuration. Old config
108108 * is overwritten. Call telemetry_reset_events when logging is over
@@ -176,7 +176,7 @@ EXPORT_SYMBOL_GPL(telemetry_reset_events); · 67 unmodified lines
176176 /**
177177 * telemetry_get_eventconfig() - Returns the pss and ioss events enabled
178178 * @pss_evtconfig: Pointer to PSS related configuration.
179− * @pss_evtconfig: Pointer to IOSS related configuration.
179+ * @ioss_evtconfig: Pointer to IOSS related configuration.
180180 * @pss_len: Number of u32 elements allocated for pss_evtconfig array
181181 * @ioss_len: Number of u32 elements allocated for ioss_evtconfig array
182182 *
drivers/platform/x86/wmi.c+5−0
@@ -1346,6 +1346,11 @@ static int parse_wdg(struct device *wmi_bus_dev, struct platform_device *pdev) · 1345 unmodified lines
13461346 if (debug_dump_wdg)
13471347 wmi_dump_wdg(&gblock[i]);
13481348
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+
13491354 if (guid_already_parsed_for_legacy(device, &gblock[i].guid))
13501355 continue;
13511356
include/linux/platform_data/x86/asus-wmi.h+3−0
@@ -114,6 +114,9 @@ · 113 unmodified lines
114114 /* Charging mode - 1=Barrel, 2=USB */
115115 #define ASUS_WMI_DEVID_CHARGE_MODE 0x0012006C
116116
117+/* MCU powersave mode */
118+#define ASUS_WMI_DEVID_MCU_POWERSAVE 0x001200E2
119+
117120 /* epu is connected? 1 == true */
118121 #define ASUS_WMI_DEVID_EGPU_CONNECTED 0x00090018
119122 /* egpu on/off */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t