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

Pull x86 platform driver fixes from Hans de Goede:
"Various bug-fixes"

* tag 'platform-drivers-x86-v5.16-4' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86:
platform/x86: intel_pmc_core: fix memleak on registration failure
platform/x86/intel: Remove X86_PLATFORM_DRIVERS_INTEL
platform/x86: system76_acpi: Guard System76 EC specific functionality
platform/x86: apple-gmux: use resource_size() with res
platform/x86: amd-pmc: only use callbacks for suspend
platform/mellanox: mlxbf-pmc: Fix an IS_ERR() vs NULL bug in mlxbf_pmc_map_counters

+37 -49
+2 -2
drivers/platform/mellanox/mlxbf-pmc.c
··· 1374 1374 pmc->block[i].counters = info[2]; 1375 1375 pmc->block[i].type = info[3]; 1376 1376 1377 - if (IS_ERR(pmc->block[i].mmio_base)) 1378 - return PTR_ERR(pmc->block[i].mmio_base); 1377 + if (!pmc->block[i].mmio_base) 1378 + return -ENOMEM; 1379 1379 1380 1380 ret = mlxbf_pmc_create_groups(dev, i); 1381 1381 if (ret)
+1 -1
drivers/platform/x86/Makefile
··· 68 68 obj-$(CONFIG_THINKPAD_LMI) += think-lmi.o 69 69 70 70 # Intel 71 - obj-$(CONFIG_X86_PLATFORM_DRIVERS_INTEL) += intel/ 71 + obj-y += intel/ 72 72 73 73 # MSI 74 74 obj-$(CONFIG_MSI_LAPTOP) += msi-laptop.o
+2 -1
drivers/platform/x86/amd-pmc.c
··· 508 508 } 509 509 510 510 static const struct dev_pm_ops amd_pmc_pm_ops = { 511 - SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(amd_pmc_suspend, amd_pmc_resume) 511 + .suspend_noirq = amd_pmc_suspend, 512 + .resume_noirq = amd_pmc_resume, 512 513 }; 513 514 514 515 static const struct pci_device_id pmc_pci_ids[] = {
+1 -1
drivers/platform/x86/apple-gmux.c
··· 625 625 } 626 626 627 627 gmux_data->iostart = res->start; 628 - gmux_data->iolen = res->end - res->start; 628 + gmux_data->iolen = resource_size(res); 629 629 630 630 if (gmux_data->iolen < GMUX_MIN_IO_LEN) { 631 631 pr_err("gmux I/O region too small (%lu < %u)\n",
-15
drivers/platform/x86/intel/Kconfig
··· 3 3 # Intel x86 Platform Specific Drivers 4 4 # 5 5 6 - menuconfig X86_PLATFORM_DRIVERS_INTEL 7 - bool "Intel x86 Platform Specific Device Drivers" 8 - default y 9 - help 10 - Say Y here to get to see options for device drivers for 11 - various Intel x86 platforms, including vendor-specific 12 - drivers. This option alone does not add any kernel code. 13 - 14 - If you say N, all options in this submenu will be skipped 15 - and disabled. 16 - 17 - if X86_PLATFORM_DRIVERS_INTEL 18 - 19 6 source "drivers/platform/x86/intel/atomisp2/Kconfig" 20 7 source "drivers/platform/x86/intel/int1092/Kconfig" 21 8 source "drivers/platform/x86/intel/int33fe/Kconfig" ··· 170 183 171 184 To compile this driver as a module, choose M here: the module 172 185 will be called intel-uncore-frequency. 173 - 174 - endif # X86_PLATFORM_DRIVERS_INTEL
+1 -1
drivers/platform/x86/intel/pmc/pltdrv.c
··· 65 65 66 66 retval = platform_device_register(pmc_core_device); 67 67 if (retval) 68 - kfree(pmc_core_device); 68 + platform_device_put(pmc_core_device); 69 69 70 70 return retval; 71 71 }
+30 -28
drivers/platform/x86/system76_acpi.c
··· 35 35 union acpi_object *nfan; 36 36 union acpi_object *ntmp; 37 37 struct input_dev *input; 38 + bool has_open_ec; 38 39 }; 39 40 40 41 static const struct acpi_device_id device_ids[] = { ··· 280 279 281 280 static void system76_battery_init(void) 282 281 { 283 - acpi_handle handle; 284 - 285 - handle = ec_get_handle(); 286 - if (handle && acpi_has_method(handle, "GBCT")) 287 - battery_hook_register(&system76_battery_hook); 282 + battery_hook_register(&system76_battery_hook); 288 283 } 289 284 290 285 static void system76_battery_exit(void) 291 286 { 292 - acpi_handle handle; 293 - 294 - handle = ec_get_handle(); 295 - if (handle && acpi_has_method(handle, "GBCT")) 296 - battery_hook_unregister(&system76_battery_hook); 287 + battery_hook_unregister(&system76_battery_hook); 297 288 } 298 289 299 290 // Get the airplane mode LED brightness ··· 666 673 acpi_dev->driver_data = data; 667 674 data->acpi_dev = acpi_dev; 668 675 676 + // Some models do not run open EC firmware. Check for an ACPI method 677 + // that only exists on open EC to guard functionality specific to it. 678 + data->has_open_ec = acpi_has_method(acpi_device_handle(data->acpi_dev), "NFAN"); 679 + 669 680 err = system76_get(data, "INIT"); 670 681 if (err) 671 682 return err; ··· 715 718 if (err) 716 719 goto error; 717 720 718 - err = system76_get_object(data, "NFAN", &data->nfan); 719 - if (err) 720 - goto error; 721 + if (data->has_open_ec) { 722 + err = system76_get_object(data, "NFAN", &data->nfan); 723 + if (err) 724 + goto error; 721 725 722 - err = system76_get_object(data, "NTMP", &data->ntmp); 723 - if (err) 724 - goto error; 726 + err = system76_get_object(data, "NTMP", &data->ntmp); 727 + if (err) 728 + goto error; 725 729 726 - data->therm = devm_hwmon_device_register_with_info(&acpi_dev->dev, 727 - "system76_acpi", data, &thermal_chip_info, NULL); 728 - err = PTR_ERR_OR_ZERO(data->therm); 729 - if (err) 730 - goto error; 730 + data->therm = devm_hwmon_device_register_with_info(&acpi_dev->dev, 731 + "system76_acpi", data, &thermal_chip_info, NULL); 732 + err = PTR_ERR_OR_ZERO(data->therm); 733 + if (err) 734 + goto error; 731 735 732 - system76_battery_init(); 736 + system76_battery_init(); 737 + } 733 738 734 739 return 0; 735 740 736 741 error: 737 - kfree(data->ntmp); 738 - kfree(data->nfan); 742 + if (data->has_open_ec) { 743 + kfree(data->ntmp); 744 + kfree(data->nfan); 745 + } 739 746 return err; 740 747 } 741 748 ··· 750 749 751 750 data = acpi_driver_data(acpi_dev); 752 751 753 - system76_battery_exit(); 752 + if (data->has_open_ec) { 753 + system76_battery_exit(); 754 + kfree(data->nfan); 755 + kfree(data->ntmp); 756 + } 754 757 755 758 devm_led_classdev_unregister(&acpi_dev->dev, &data->ap_led); 756 759 devm_led_classdev_unregister(&acpi_dev->dev, &data->kb_led); 757 - 758 - kfree(data->nfan); 759 - kfree(data->ntmp); 760 760 761 761 system76_get(data, "FINI"); 762 762