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-4' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86

Pull x86 platform driver fixes from Hans de Goede:

- thinkpad_acpi AMD suspend/resume + fan detection fixes

- two other small fixes

- one hardware-id addition

* tag 'platform-drivers-x86-v5.18-4' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86:
platform/surface: aggregator: Fix initialization order when compiling as builtin module
platform/surface: gpe: Add support for Surface Pro 8
platform/x86/intel: Fix 'rmmod pmt_telemetry' panic
platform/x86: thinkpad_acpi: Correct dual fan probe
platform/x86: thinkpad_acpi: Add a s2idle resume quirk for a number of laptops
platform/x86: thinkpad_acpi: Convert btusb DMI list to quirks

+173 -14
+1 -1
drivers/platform/surface/aggregator/core.c
··· 817 817 err_bus: 818 818 return status; 819 819 } 820 - module_init(ssam_core_init); 820 + subsys_initcall(ssam_core_init); 821 821 822 822 static void __exit ssam_core_exit(void) 823 823 {
+8
drivers/platform/surface/surface_gpe.c
··· 100 100 .driver_data = (void *)lid_device_props_l4D, 101 101 }, 102 102 { 103 + .ident = "Surface Pro 8", 104 + .matches = { 105 + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"), 106 + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Surface Pro 8"), 107 + }, 108 + .driver_data = (void *)lid_device_props_l4B, 109 + }, 110 + { 103 111 .ident = "Surface Book 1", 104 112 .matches = { 105 113 DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
+1 -1
drivers/platform/x86/intel/pmt/telemetry.c
··· 103 103 auxiliary_set_drvdata(auxdev, priv); 104 104 105 105 for (i = 0; i < intel_vsec_dev->num_resources; i++) { 106 - struct intel_pmt_entry *entry = &priv->entry[i]; 106 + struct intel_pmt_entry *entry = &priv->entry[priv->num_entries]; 107 107 108 108 ret = intel_pmt_dev_create(entry, &pmt_telem_ns, intel_vsec_dev, i); 109 109 if (ret < 0)
+163 -12
drivers/platform/x86/thinkpad_acpi.c
··· 309 309 struct ibm_struct *data; 310 310 }; 311 311 312 + /* DMI Quirks */ 313 + struct quirk_entry { 314 + bool btusb_bug; 315 + u32 s2idle_bug_mmio; 316 + }; 317 + 318 + static struct quirk_entry quirk_btusb_bug = { 319 + .btusb_bug = true, 320 + }; 321 + 322 + static struct quirk_entry quirk_s2idle_bug = { 323 + .s2idle_bug_mmio = 0xfed80380, 324 + }; 325 + 312 326 static struct { 313 327 u32 bluetooth:1; 314 328 u32 hotkey:1; ··· 352 338 u32 hotkey_poll_active:1; 353 339 u32 has_adaptive_kbd:1; 354 340 u32 kbd_lang:1; 341 + struct quirk_entry *quirks; 355 342 } tp_features; 356 343 357 344 static struct { ··· 4374 4359 bluetooth_shutdown(); 4375 4360 } 4376 4361 4377 - static const struct dmi_system_id bt_fwbug_list[] __initconst = { 4362 + static const struct dmi_system_id fwbug_list[] __initconst = { 4378 4363 { 4379 4364 .ident = "ThinkPad E485", 4365 + .driver_data = &quirk_btusb_bug, 4380 4366 .matches = { 4381 4367 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), 4382 4368 DMI_MATCH(DMI_BOARD_NAME, "20KU"), ··· 4385 4369 }, 4386 4370 { 4387 4371 .ident = "ThinkPad E585", 4372 + .driver_data = &quirk_btusb_bug, 4388 4373 .matches = { 4389 4374 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), 4390 4375 DMI_MATCH(DMI_BOARD_NAME, "20KV"), ··· 4393 4376 }, 4394 4377 { 4395 4378 .ident = "ThinkPad A285 - 20MW", 4379 + .driver_data = &quirk_btusb_bug, 4396 4380 .matches = { 4397 4381 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), 4398 4382 DMI_MATCH(DMI_BOARD_NAME, "20MW"), ··· 4401 4383 }, 4402 4384 { 4403 4385 .ident = "ThinkPad A285 - 20MX", 4386 + .driver_data = &quirk_btusb_bug, 4404 4387 .matches = { 4405 4388 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), 4406 4389 DMI_MATCH(DMI_BOARD_NAME, "20MX"), ··· 4409 4390 }, 4410 4391 { 4411 4392 .ident = "ThinkPad A485 - 20MU", 4393 + .driver_data = &quirk_btusb_bug, 4412 4394 .matches = { 4413 4395 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), 4414 4396 DMI_MATCH(DMI_BOARD_NAME, "20MU"), ··· 4417 4397 }, 4418 4398 { 4419 4399 .ident = "ThinkPad A485 - 20MV", 4400 + .driver_data = &quirk_btusb_bug, 4420 4401 .matches = { 4421 4402 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), 4422 4403 DMI_MATCH(DMI_BOARD_NAME, "20MV"), 4423 4404 }, 4424 4405 }, 4406 + { 4407 + .ident = "L14 Gen2 AMD", 4408 + .driver_data = &quirk_s2idle_bug, 4409 + .matches = { 4410 + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), 4411 + DMI_MATCH(DMI_PRODUCT_NAME, "20X5"), 4412 + } 4413 + }, 4414 + { 4415 + .ident = "T14s Gen2 AMD", 4416 + .driver_data = &quirk_s2idle_bug, 4417 + .matches = { 4418 + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), 4419 + DMI_MATCH(DMI_PRODUCT_NAME, "20XF"), 4420 + } 4421 + }, 4422 + { 4423 + .ident = "X13 Gen2 AMD", 4424 + .driver_data = &quirk_s2idle_bug, 4425 + .matches = { 4426 + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), 4427 + DMI_MATCH(DMI_PRODUCT_NAME, "20XH"), 4428 + } 4429 + }, 4430 + { 4431 + .ident = "T14 Gen2 AMD", 4432 + .driver_data = &quirk_s2idle_bug, 4433 + .matches = { 4434 + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), 4435 + DMI_MATCH(DMI_PRODUCT_NAME, "20XK"), 4436 + } 4437 + }, 4438 + { 4439 + .ident = "T14 Gen1 AMD", 4440 + .driver_data = &quirk_s2idle_bug, 4441 + .matches = { 4442 + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), 4443 + DMI_MATCH(DMI_PRODUCT_NAME, "20UD"), 4444 + } 4445 + }, 4446 + { 4447 + .ident = "T14 Gen1 AMD", 4448 + .driver_data = &quirk_s2idle_bug, 4449 + .matches = { 4450 + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), 4451 + DMI_MATCH(DMI_PRODUCT_NAME, "20UE"), 4452 + } 4453 + }, 4454 + { 4455 + .ident = "T14s Gen1 AMD", 4456 + .driver_data = &quirk_s2idle_bug, 4457 + .matches = { 4458 + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), 4459 + DMI_MATCH(DMI_PRODUCT_NAME, "20UH"), 4460 + } 4461 + }, 4462 + { 4463 + .ident = "P14s Gen1 AMD", 4464 + .driver_data = &quirk_s2idle_bug, 4465 + .matches = { 4466 + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), 4467 + DMI_MATCH(DMI_PRODUCT_NAME, "20Y1"), 4468 + } 4469 + }, 4470 + { 4471 + .ident = "P14s Gen2 AMD", 4472 + .driver_data = &quirk_s2idle_bug, 4473 + .matches = { 4474 + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), 4475 + DMI_MATCH(DMI_PRODUCT_NAME, "21A0"), 4476 + } 4477 + }, 4425 4478 {} 4426 4479 }; 4480 + 4481 + #ifdef CONFIG_SUSPEND 4482 + /* 4483 + * Lenovo laptops from a variety of generations run a SMI handler during the D3->D0 4484 + * transition that occurs specifically when exiting suspend to idle which can cause 4485 + * large delays during resume when the IOMMU translation layer is enabled (the default 4486 + * behavior) for NVME devices: 4487 + * 4488 + * To avoid this firmware problem, skip the SMI handler on these machines before the 4489 + * D0 transition occurs. 4490 + */ 4491 + static void thinkpad_acpi_amd_s2idle_restore(void) 4492 + { 4493 + struct resource *res; 4494 + void __iomem *addr; 4495 + u8 val; 4496 + 4497 + res = request_mem_region_muxed(tp_features.quirks->s2idle_bug_mmio, 1, 4498 + "thinkpad_acpi_pm80"); 4499 + if (!res) 4500 + return; 4501 + 4502 + addr = ioremap(tp_features.quirks->s2idle_bug_mmio, 1); 4503 + if (!addr) 4504 + goto cleanup_resource; 4505 + 4506 + val = ioread8(addr); 4507 + iowrite8(val & ~BIT(0), addr); 4508 + 4509 + iounmap(addr); 4510 + cleanup_resource: 4511 + release_resource(res); 4512 + } 4513 + 4514 + static struct acpi_s2idle_dev_ops thinkpad_acpi_s2idle_dev_ops = { 4515 + .restore = thinkpad_acpi_amd_s2idle_restore, 4516 + }; 4517 + #endif 4427 4518 4428 4519 static const struct pci_device_id fwbug_cards_ids[] __initconst = { 4429 4520 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x24F3) }, ··· 4550 4419 * Some AMD based ThinkPads have a firmware bug that calling 4551 4420 * "GBDC" will cause bluetooth on Intel wireless cards blocked 4552 4421 */ 4553 - if (dmi_check_system(bt_fwbug_list) && pci_dev_present(fwbug_cards_ids)) { 4422 + if (tp_features.quirks && tp_features.quirks->btusb_bug && 4423 + pci_dev_present(fwbug_cards_ids)) { 4554 4424 vdbg_printk(TPACPI_DBG_INIT | TPACPI_DBG_RFKILL, 4555 4425 FW_BUG "disable bluetooth subdriver for Intel cards\n"); 4556 4426 return 1; ··· 8880 8748 fan_status_access_mode = TPACPI_FAN_RD_TPEC; 8881 8749 if (quirks & TPACPI_FAN_Q1) 8882 8750 fan_quirk1_setup(); 8883 - if (quirks & TPACPI_FAN_2FAN) { 8884 - tp_features.second_fan = 1; 8885 - pr_info("secondary fan support enabled\n"); 8886 - } 8887 - if (quirks & TPACPI_FAN_2CTL) { 8888 - tp_features.second_fan = 1; 8889 - tp_features.second_fan_ctl = 1; 8890 - pr_info("secondary fan control enabled\n"); 8891 - } 8892 8751 /* Try and probe the 2nd fan */ 8752 + tp_features.second_fan = 1; /* needed for get_speed to work */ 8893 8753 res = fan2_get_speed(&speed); 8894 8754 if (res >= 0) { 8895 8755 /* It responded - so let's assume it's there */ 8896 8756 tp_features.second_fan = 1; 8897 8757 tp_features.second_fan_ctl = 1; 8898 8758 pr_info("secondary fan control detected & enabled\n"); 8759 + } else { 8760 + /* Fan not auto-detected */ 8761 + tp_features.second_fan = 0; 8762 + if (quirks & TPACPI_FAN_2FAN) { 8763 + tp_features.second_fan = 1; 8764 + pr_info("secondary fan support enabled\n"); 8765 + } 8766 + if (quirks & TPACPI_FAN_2CTL) { 8767 + tp_features.second_fan = 1; 8768 + tp_features.second_fan_ctl = 1; 8769 + pr_info("secondary fan control enabled\n"); 8770 + } 8899 8771 } 8900 - 8901 8772 } else { 8902 8773 pr_err("ThinkPad ACPI EC access misbehaving, fan status and control unavailable\n"); 8903 8774 return -ENODEV; ··· 11590 11455 11591 11456 tpacpi_lifecycle = TPACPI_LIFE_EXITING; 11592 11457 11458 + #ifdef CONFIG_SUSPEND 11459 + if (tp_features.quirks && tp_features.quirks->s2idle_bug_mmio) 11460 + acpi_unregister_lps0_dev(&thinkpad_acpi_s2idle_dev_ops); 11461 + #endif 11593 11462 if (tpacpi_hwmon) 11594 11463 hwmon_device_unregister(tpacpi_hwmon); 11595 11464 if (tp_features.sensors_pdrv_registered) ··· 11635 11496 11636 11497 static int __init thinkpad_acpi_module_init(void) 11637 11498 { 11499 + const struct dmi_system_id *dmi_id; 11638 11500 int ret, i; 11639 11501 11640 11502 tpacpi_lifecycle = TPACPI_LIFE_INIT; ··· 11674 11534 thinkpad_acpi_module_exit(); 11675 11535 return -ENODEV; 11676 11536 } 11537 + 11538 + dmi_id = dmi_first_match(fwbug_list); 11539 + if (dmi_id) 11540 + tp_features.quirks = dmi_id->driver_data; 11677 11541 11678 11542 /* Device initialization */ 11679 11543 tpacpi_pdev = platform_device_register_simple(TPACPI_DRVR_NAME, -1, ··· 11767 11623 tp_features.input_device_registered = 1; 11768 11624 } 11769 11625 11626 + #ifdef CONFIG_SUSPEND 11627 + if (tp_features.quirks && tp_features.quirks->s2idle_bug_mmio) { 11628 + if (!acpi_register_lps0_dev(&thinkpad_acpi_s2idle_dev_ops)) 11629 + pr_info("Using s2idle quirk to avoid %s platform firmware bug\n", 11630 + (dmi_id && dmi_id->ident) ? dmi_id->ident : ""); 11631 + } 11632 + #endif 11770 11633 return 0; 11771 11634 } 11772 11635