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

Pull x86 platform driver fixes from Hans de Goede:
"A small set of assorted bug and build/warning fixes"

* tag 'platform-drivers-x86-v6.3-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86:
platform: mellanox: mlx-platform: Initialize shift variable to 0
platform/x86: int3472: Add GPIOs to Surface Go 3 Board data
platform/x86: ISST: Fix kernel documentation warnings
platform: x86: MLX_PLATFORM: select REGMAP instead of depending on it
platform: mellanox: select REGMAP instead of depending on it
platform/x86/intel/tpmi: Fix double free reported by Smatch
platform/x86: ISST: Increase range of valid mail box commands
platform/x86: dell-ddv: Fix temperature scaling
platform/x86: dell-ddv: Fix cache invalidation on resume
platform/x86/amd: pmc: remove CONFIG_SUSPEND checks

+39 -42
+4 -5
drivers/platform/mellanox/Kconfig
··· 16 16 17 17 config MLXREG_HOTPLUG 18 18 tristate "Mellanox platform hotplug driver support" 19 - depends on REGMAP 20 19 depends on HWMON 21 20 depends on I2C 21 + select REGMAP 22 22 help 23 23 This driver handles hot-plug events for the power suppliers, power 24 24 cables and fans on the wide range Mellanox IB and Ethernet systems. 25 25 26 26 config MLXREG_IO 27 27 tristate "Mellanox platform register access driver support" 28 - depends on REGMAP 29 28 depends on HWMON 29 + select REGMAP 30 30 help 31 31 This driver allows access to Mellanox programmable device register 32 32 space through sysfs interface. The sets of registers for sysfs access ··· 36 36 37 37 config MLXREG_LC 38 38 tristate "Mellanox line card platform driver support" 39 - depends on REGMAP 40 39 depends on HWMON 41 40 depends on I2C 41 + select REGMAP 42 42 help 43 43 This driver provides support for the Mellanox MSN4800-XX line cards, 44 44 which are the part of MSN4800 Ethernet modular switch systems ··· 80 80 81 81 config NVSW_SN2201 82 82 tristate "Nvidia SN2201 platform driver support" 83 - depends on REGMAP 84 83 depends on HWMON 85 84 depends on I2C 86 - depends on REGMAP_I2C 85 + select REGMAP_I2C 87 86 help 88 87 This driver provides support for the Nvidia SN2201 platform. 89 88 The SN2201 is a highly integrated for one rack unit system with
+2 -1
drivers/platform/x86/Kconfig
··· 955 955 956 956 config MLX_PLATFORM 957 957 tristate "Mellanox Technologies platform support" 958 - depends on I2C && REGMAP 958 + depends on I2C 959 + select REGMAP 959 960 help 960 961 This option enables system support for the Mellanox Technologies 961 962 platform. The Mellanox systems provide data center networking
+9 -21
drivers/platform/x86/amd/pmc.c
··· 171 171 static struct amd_pmc_dev pmc; 172 172 static int amd_pmc_send_cmd(struct amd_pmc_dev *dev, u32 arg, u32 *data, u8 msg, bool ret); 173 173 static int amd_pmc_read_stb(struct amd_pmc_dev *dev, u32 *buf); 174 - #ifdef CONFIG_SUSPEND 175 174 static int amd_pmc_write_stb(struct amd_pmc_dev *dev, u32 data); 176 - #endif 177 175 178 176 static inline u32 amd_pmc_reg_read(struct amd_pmc_dev *dev, int reg_offset) 179 177 { ··· 384 386 return 0; 385 387 } 386 388 387 - #ifdef CONFIG_SUSPEND 388 389 static void amd_pmc_validate_deepest(struct amd_pmc_dev *pdev) 389 390 { 390 391 struct smu_metrics table; ··· 397 400 dev_dbg(pdev->dev, "Last suspend in deepest state for %lluus\n", 398 401 table.timein_s0i3_lastcapture); 399 402 } 400 - #endif 401 403 402 404 static int amd_pmc_get_smu_version(struct amd_pmc_dev *dev) 403 405 { ··· 669 673 return rc; 670 674 } 671 675 672 - #ifdef CONFIG_SUSPEND 673 676 static int amd_pmc_get_os_hint(struct amd_pmc_dev *dev) 674 677 { 675 678 switch (dev->cpu_id) { ··· 856 861 return 0; 857 862 } 858 863 859 - static SIMPLE_DEV_PM_OPS(amd_pmc_pm, amd_pmc_suspend_handler, NULL); 860 - 861 - #endif 864 + static DEFINE_SIMPLE_DEV_PM_OPS(amd_pmc_pm, amd_pmc_suspend_handler, NULL); 862 865 863 866 static const struct pci_device_id pmc_pci_ids[] = { 864 867 { PCI_DEVICE(PCI_VENDOR_ID_AMD, AMD_CPU_ID_PS) }, ··· 898 905 return 0; 899 906 } 900 907 901 - #ifdef CONFIG_SUSPEND 902 908 static int amd_pmc_write_stb(struct amd_pmc_dev *dev, u32 data) 903 909 { 904 910 int err; ··· 918 926 919 927 return 0; 920 928 } 921 - #endif 922 929 923 930 static int amd_pmc_read_stb(struct amd_pmc_dev *dev, u32 *buf) 924 931 { ··· 1008 1017 } 1009 1018 1010 1019 platform_set_drvdata(pdev, dev); 1011 - #ifdef CONFIG_SUSPEND 1012 - err = acpi_register_lps0_dev(&amd_pmc_s2idle_dev_ops); 1013 - if (err) 1014 - dev_warn(dev->dev, "failed to register LPS0 sleep handler, expect increased power consumption\n"); 1015 - #endif 1020 + if (IS_ENABLED(CONFIG_SUSPEND)) { 1021 + err = acpi_register_lps0_dev(&amd_pmc_s2idle_dev_ops); 1022 + if (err) 1023 + dev_warn(dev->dev, "failed to register LPS0 sleep handler, expect increased power consumption\n"); 1024 + } 1016 1025 1017 1026 amd_pmc_dbgfs_register(dev); 1018 1027 return 0; ··· 1026 1035 { 1027 1036 struct amd_pmc_dev *dev = platform_get_drvdata(pdev); 1028 1037 1029 - #ifdef CONFIG_SUSPEND 1030 - acpi_unregister_lps0_dev(&amd_pmc_s2idle_dev_ops); 1031 - #endif 1038 + if (IS_ENABLED(CONFIG_SUSPEND)) 1039 + acpi_unregister_lps0_dev(&amd_pmc_s2idle_dev_ops); 1032 1040 amd_pmc_dbgfs_unregister(dev); 1033 1041 pci_dev_put(dev->rdev); 1034 1042 mutex_destroy(&dev->lock); ··· 1051 1061 .name = "amd_pmc", 1052 1062 .acpi_match_table = amd_pmc_acpi_ids, 1053 1063 .dev_groups = pmc_groups, 1054 - #ifdef CONFIG_SUSPEND 1055 - .pm = &amd_pmc_pm, 1056 - #endif 1064 + .pm = pm_sleep_ptr(&amd_pmc_pm), 1057 1065 }, 1058 1066 .probe = amd_pmc_probe, 1059 1067 .remove = amd_pmc_remove,
+9 -3
drivers/platform/x86/dell/dell-wmi-ddv.c
··· 17 17 #include <linux/kernel.h> 18 18 #include <linux/hwmon.h> 19 19 #include <linux/kstrtox.h> 20 - #include <linux/math.h> 21 20 #include <linux/math64.h> 22 21 #include <linux/module.h> 23 22 #include <linux/mutex.h> ··· 95 96 }; 96 97 97 98 struct dell_wmi_ddv_sensors { 99 + bool active; 98 100 struct mutex lock; /* protect caching */ 99 101 unsigned long timestamp; 100 102 union acpi_object *obj; ··· 520 520 521 521 static void dell_wmi_ddv_hwmon_cache_invalidate(struct dell_wmi_ddv_sensors *sensors) 522 522 { 523 + if (!sensors->active) 524 + return; 525 + 523 526 mutex_lock(&sensors->lock); 524 527 kfree(sensors->obj); 525 528 sensors->obj = NULL; ··· 533 530 { 534 531 struct dell_wmi_ddv_sensors *sensors = data; 535 532 533 + sensors->active = false; 536 534 mutex_destroy(&sensors->lock); 537 535 kfree(sensors->obj); 538 536 } ··· 553 549 return ERR_PTR(ret); 554 550 555 551 mutex_init(&sensors->lock); 552 + sensors->active = true; 556 553 557 554 ret = devm_add_action_or_reset(&wdev->dev, dell_wmi_ddv_hwmon_cache_destroy, sensors); 558 555 if (ret < 0) ··· 664 659 if (ret < 0) 665 660 return ret; 666 661 667 - return sysfs_emit(buf, "%d\n", DIV_ROUND_CLOSEST(value, 10)); 662 + /* Use 2731 instead of 2731.5 to avoid unnecessary rounding */ 663 + return sysfs_emit(buf, "%d\n", value - 2731); 668 664 } 669 665 670 666 static ssize_t eppid_show(struct device *dev, struct device_attribute *attr, char *buf) ··· 858 852 { 859 853 struct dell_wmi_ddv_data *data = dev_get_drvdata(dev); 860 854 861 - /* Force re-reading of all sensors */ 855 + /* Force re-reading of all active sensors */ 862 856 dell_wmi_ddv_hwmon_cache_invalidate(&data->fans); 863 857 dell_wmi_ddv_hwmon_cache_invalidate(&data->temps); 864 858
+3 -2
drivers/platform/x86/intel/int3472/tps68470_board_data.c
··· 159 159 static const struct int3472_tps68470_board_data surface_go3_tps68470_board_data = { 160 160 .dev_name = "i2c-INT3472:01", 161 161 .tps68470_regulator_pdata = &surface_go_tps68470_pdata, 162 - .n_gpiod_lookups = 1, 162 + .n_gpiod_lookups = 2, 163 163 .tps68470_gpio_lookup_tables = { 164 - &surface_go_int347a_gpios 164 + &surface_go_int347a_gpios, 165 + &surface_go_int347e_gpios, 165 166 }, 166 167 }; 167 168
+3 -2
drivers/platform/x86/intel/speed_select_if/isst_if_common.c
··· 47 47 48 48 static const struct isst_valid_cmd_ranges isst_valid_cmds[] = { 49 49 {0xD0, 0x00, 0x03}, 50 - {0x7F, 0x00, 0x0B}, 50 + {0x7F, 0x00, 0x0C}, 51 51 {0x7F, 0x10, 0x12}, 52 52 {0x7F, 0x20, 0x23}, 53 53 {0x94, 0x03, 0x03}, ··· 112 112 * isst_store_cmd() - Store command to a hash table 113 113 * @cmd: Mailbox command. 114 114 * @sub_cmd: Mailbox sub-command or MSR id. 115 + * @cpu: Target CPU for the command 115 116 * @mbox_cmd_type: Mailbox or MSR command. 116 117 * @param: Mailbox parameter. 117 118 * @data: Mailbox request data or MSR data. ··· 364 363 /** 365 364 * isst_if_get_pci_dev() - Get the PCI device instance for a CPU 366 365 * @cpu: Logical CPU number. 367 - * @bus_number: The bus number assigned by the hardware. 366 + * @bus_no: The bus number assigned by the hardware. 368 367 * @dev: The device number assigned by the hardware. 369 368 * @fn: The function number assigned by the hardware. 370 369 *
+1
drivers/platform/x86/intel/speed_select_if/isst_if_common.h
··· 40 40 * @offset: Offset to the first valid member in command structure. 41 41 * This will be the offset of the start of the command 42 42 * after command count field 43 + * @owner: Registered module owner 43 44 * @cmd_callback: Callback function to handle IOCTL. The callback has the 44 45 * command pointer with data for command. There is a pointer 45 46 * called write_only, which when set, will not copy the
+7 -7
drivers/platform/x86/intel/tpmi.c
··· 209 209 if (!name) 210 210 return -EOPNOTSUPP; 211 211 212 - feature_vsec_dev = kzalloc(sizeof(*feature_vsec_dev), GFP_KERNEL); 213 - if (!feature_vsec_dev) 212 + res = kcalloc(pfs->pfs_header.num_entries, sizeof(*res), GFP_KERNEL); 213 + if (!res) 214 214 return -ENOMEM; 215 215 216 - res = kcalloc(pfs->pfs_header.num_entries, sizeof(*res), GFP_KERNEL); 217 - if (!res) { 216 + feature_vsec_dev = kzalloc(sizeof(*feature_vsec_dev), GFP_KERNEL); 217 + if (!feature_vsec_dev) { 218 218 ret = -ENOMEM; 219 - goto free_vsec; 219 + goto free_res; 220 220 } 221 221 222 222 snprintf(feature_id_name, sizeof(feature_id_name), "tpmi-%s", name); ··· 239 239 /* 240 240 * intel_vsec_add_aux() is resource managed, no explicit 241 241 * delete is required on error or on module unload. 242 + * feature_vsec_dev memory is also freed as part of device 243 + * delete. 242 244 */ 243 245 ret = intel_vsec_add_aux(vsec_dev->pcidev, &vsec_dev->auxdev.dev, 244 246 feature_vsec_dev, feature_id_name); ··· 251 249 252 250 free_res: 253 251 kfree(res); 254 - free_vsec: 255 - kfree(feature_vsec_dev); 256 252 257 253 return ret; 258 254 }
+1 -1
drivers/platform/x86/mlx-platform.c
··· 5980 5980 static int mlxplat_mlxcpld_verify_bus_topology(int *nr) 5981 5981 { 5982 5982 struct i2c_adapter *search_adap; 5983 - int shift, i; 5983 + int i, shift = 0; 5984 5984 5985 5985 /* Scan adapters from expected id to verify it is free. */ 5986 5986 *nr = MLXPLAT_CPLD_PHYS_ADAPTER_DEF_NR;