mirror of
https://github.com/torvalds/linux.git
synced 2026-05-23 22:52:19 +02:00
hwmon fixes for v6.19 (final)
- occ: Mark occ_init_attribute() as __printf to avoid build failure - gpio-fan: Allow to stop fans when CONFIG_PM is disabled, and fix set_rpm() return value - acpi_power_meter: Fix deadlocks related to acpi_power_meter_notify() - dell-smm: Add Dell G15 5510 to fan control whitelist -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEiHPvMQj9QTOCiqgVyx8mb86fmYEFAmmFV70ACgkQyx8mb86f mYE2Aw/+ODcZGeTGkanPZiaEn6MbT/KxjdoYgvi61wyLH06JblPX7ae7qRNXHKBZ ZW2/+DDWNBrQxRImIKyyAwYVxm+fz4DB5iMZeYsdfl5JWKDUYh0sx5MGMPlkhzZt kOVr0nphPTsI5NgEp7bL5dFIMzGazk3vNyD94p6FXtdfDhHRqxZU0B4ji6LfeP7P hI1POoA2H5anP+KFpnBC8q0f6rNmvxl41qVhBJLknmmJbFpr8gRLw+3vyYweBKiU Sqxm0SL6nVlC5MeLlB1aZVHJNhzvK+S/l5iGaVFsxlc3A2wNE037p2SsBZ7TWyDl dBSdu49yAkDRP3C4nV8sAPhteZjTIC1PR2I6mh3xBkm2SYrPsksYw4aoCLYkAKNu 1Y1eabSXC+tpCL4Gn771qJA1/Wbn87H78zG9wRd3uTKgpk1zxner3XqnH8OeF+b8 uR+9Ery6GK2D4NZLwtbgxpd7iFf+Znr4LIBZyKYpERNgx/5pAVZUMal4FRwIr9vb E9iQ4g8lTTfdthRy5pZYB0JQrAH34q22f5CFC0YHOMDgyJQqWsg0GlsK/0mt1hP9 gqfOAWxwiyLg6jml2IXXOZhROxPYy9Pg4vXVWzIPk4nfiS/u4GGIQ7QvIwcFNd+/ h7OmPkFrNoUcbBRVE6x8Yk1sFEvy86EVsDBZSLDjwcODEdVkdrQ= =DUEL -----END PGP SIGNATURE----- Merge tag 'hwmon-for-v6.19-final' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging Pull hwmon fixes from Guenter Roeck: - occ: Mark occ_init_attribute() as __printf to avoid build failure due to '-Werror=suggest-attribute=format' - gpio-fan: Allow to stop fans when CONFIG_PM is disabled, and fix set_rpm() return value - acpi_power_meter: Fix deadlocks related to acpi_power_meter_notify() - dell-smm: Add Dell G15 5510 to fan control whitelist * tag 'hwmon-for-v6.19-final' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: hwmon: (occ) Mark occ_init_attribute() as __printf hwmon: (gpio-fan) Allow to stop FANs when CONFIG_PM is disabled hwmon: (gpio-fan) Fix set_rpm() return value hwmon: (acpi_power_meter) Fix deadlocks related to acpi_power_meter_notify() hwmon: (dell-smm) Add Dell G15 5510 to fan control whitelist
This commit is contained in:
commit
b7ff7151e6
|
|
@ -47,6 +47,8 @@
|
|||
static int cap_in_hardware;
|
||||
static bool force_cap_on;
|
||||
|
||||
static DEFINE_MUTEX(acpi_notify_lock);
|
||||
|
||||
static int can_cap_in_hardware(void)
|
||||
{
|
||||
return force_cap_on || cap_in_hardware;
|
||||
|
|
@ -823,18 +825,26 @@ static void acpi_power_meter_notify(struct acpi_device *device, u32 event)
|
|||
|
||||
resource = acpi_driver_data(device);
|
||||
|
||||
guard(mutex)(&acpi_notify_lock);
|
||||
|
||||
switch (event) {
|
||||
case METER_NOTIFY_CONFIG:
|
||||
if (!IS_ERR(resource->hwmon_dev))
|
||||
hwmon_device_unregister(resource->hwmon_dev);
|
||||
|
||||
mutex_lock(&resource->lock);
|
||||
|
||||
free_capabilities(resource);
|
||||
remove_domain_devices(resource);
|
||||
hwmon_device_unregister(resource->hwmon_dev);
|
||||
res = read_capabilities(resource);
|
||||
if (res)
|
||||
dev_err_once(&device->dev, "read capabilities failed.\n");
|
||||
res = read_domain_devices(resource);
|
||||
if (res && res != -ENODEV)
|
||||
dev_err_once(&device->dev, "read domain devices failed.\n");
|
||||
|
||||
mutex_unlock(&resource->lock);
|
||||
|
||||
resource->hwmon_dev =
|
||||
hwmon_device_register_with_info(&device->dev,
|
||||
ACPI_POWER_METER_NAME,
|
||||
|
|
@ -843,7 +853,7 @@ static void acpi_power_meter_notify(struct acpi_device *device, u32 event)
|
|||
power_extra_groups);
|
||||
if (IS_ERR(resource->hwmon_dev))
|
||||
dev_err_once(&device->dev, "register hwmon device failed.\n");
|
||||
mutex_unlock(&resource->lock);
|
||||
|
||||
break;
|
||||
case METER_NOTIFY_TRIP:
|
||||
sysfs_notify(&device->dev.kobj, NULL, POWER_AVERAGE_NAME);
|
||||
|
|
@ -953,7 +963,8 @@ static void acpi_power_meter_remove(struct acpi_device *device)
|
|||
return;
|
||||
|
||||
resource = acpi_driver_data(device);
|
||||
hwmon_device_unregister(resource->hwmon_dev);
|
||||
if (!IS_ERR(resource->hwmon_dev))
|
||||
hwmon_device_unregister(resource->hwmon_dev);
|
||||
|
||||
remove_domain_devices(resource);
|
||||
free_capabilities(resource);
|
||||
|
|
|
|||
|
|
@ -1639,6 +1639,14 @@ static const struct dmi_system_id i8k_whitelist_fan_control[] __initconst = {
|
|||
},
|
||||
.driver_data = (void *)&i8k_fan_control_data[I8K_FAN_30A3_31A3],
|
||||
},
|
||||
{
|
||||
.ident = "Dell G15 5510",
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
|
||||
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Dell G15 5510"),
|
||||
},
|
||||
.driver_data = (void *)&i8k_fan_control_data[I8K_FAN_30A3_31A3],
|
||||
},
|
||||
{
|
||||
.ident = "Dell G15 5511",
|
||||
.matches = {
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ static int set_fan_speed(struct gpio_fan_data *fan_data, int speed_index)
|
|||
int ret;
|
||||
|
||||
ret = pm_runtime_put_sync(fan_data->dev);
|
||||
if (ret < 0)
|
||||
if (ret < 0 && ret != -ENOSYS)
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -291,7 +291,7 @@ static ssize_t set_rpm(struct device *dev, struct device_attribute *attr,
|
|||
{
|
||||
struct gpio_fan_data *fan_data = dev_get_drvdata(dev);
|
||||
unsigned long rpm;
|
||||
int ret = count;
|
||||
int ret;
|
||||
|
||||
if (kstrtoul(buf, 10, &rpm))
|
||||
return -EINVAL;
|
||||
|
|
@ -308,7 +308,7 @@ static ssize_t set_rpm(struct device *dev, struct device_attribute *attr,
|
|||
exit_unlock:
|
||||
mutex_unlock(&fan_data->lock);
|
||||
|
||||
return ret;
|
||||
return ret ? ret : count;
|
||||
}
|
||||
|
||||
static DEVICE_ATTR_RW(pwm1);
|
||||
|
|
|
|||
|
|
@ -749,6 +749,7 @@ static ssize_t occ_show_extended(struct device *dev,
|
|||
* are dynamically allocated, we cannot use the existing kernel macros which
|
||||
* stringify the name argument.
|
||||
*/
|
||||
__printf(7, 8)
|
||||
static void occ_init_attribute(struct occ_attribute *attr, int mode,
|
||||
ssize_t (*show)(struct device *dev, struct device_attribute *attr, char *buf),
|
||||
ssize_t (*store)(struct device *dev, struct device_attribute *attr,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user