hwmon fixes for v5.6-rc3

- Fix crash in w83627ehf driver seen with W83627DHG-P
 - Fix lockdep splat in acpi_power_meter driver
 - Fix xdpe12284 documentation Sphinx warnings
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiHPvMQj9QTOCiqgVyx8mb86fmYEFAl5Qin0ACgkQyx8mb86f
 mYHhgRAAlb9UdDHf2BSUGoWGqJQYl+akQwhlqggOMVJKONCRJe53xzfpTlQclPfZ
 fBgHqWWVHosSe4QqUd6+OhNWW1njzKNsoDV3rwpeprZfBbTsgUu0o9emqOJKmTTg
 DbhqPvNUBFF+MYhTObFEKcHJUHhxp6UsCwigInfoV8T7EWYJbe4QVDr3zIVm3Yvu
 7Fpap32Jmm3btLaEk8FOCrZMNRPkLgR2vgHmhHpWYDpqccz+uCPEwkKBVez7ix3e
 g0mNzZGJXFmgc6jzYhB7YpYhQp1OyJDNldnYfmqYoaZ97JNKe04qRP8+vaN2PTmY
 6Vvt7HvzToSYO6PGbcIQkFxI63Pm3ZOv0v/wnbi1MFPraAJg5eKN4NpgnnzBm06d
 3u+TUTREHYappBNS+x8xw3D+gpZeHQ0izJAmFV3WnM36kGUaFD4N0oZ0x/em4veG
 kVBJJvxgv5hcLtaaJSc63DawiITRR1PkZhcvIfOAH37M4NMu9jMvFabWTJTmje7I
 uNfMV0cJEx8aILNEAEC37wTL5jddD5FbComRO3adFNRKGElhe7IpjAD2Zj1FwDVw
 8X3kbu183bUWf6i+gaA+ZuR4zOWSLFMUYDU6YtyrPHTlerYdzTYHy0PHypGLhKPI
 dszDxZDCyleE7t2cdPyMfmJc0FRE127voosllZkVheNkcBxzR/0=
 =ANSh
 -----END PGP SIGNATURE-----

Merge tag 'hwmon-for-v5.6-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging

Pull hwmon fixes from Guenter Roeck:

 - Fix crash in w83627ehf driver seen with W83627DHG-P

 - Fix lockdep splat in acpi_power_meter driver

 - Fix xdpe12284 documentation Sphinx warnings

* tag 'hwmon-for-v5.6-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
  hwmon: (w83627ehf) Fix crash seen with W83627DHG-P
  hwmon: (acpi_power_meter) Fix lockdep splat
  Documentation/hwmon: fix xdpe12284 Sphinx warnings
This commit is contained in:
Linus Torvalds 2020-02-22 10:52:54 -08:00
commit 5b442b1a4e
3 changed files with 15 additions and 9 deletions

View File

@ -24,6 +24,7 @@ This driver implements support for Infineon Multi-phase XDPE122 family
dual loop voltage regulators. dual loop voltage regulators.
The family includes XDPE12284 and XDPE12254 devices. The family includes XDPE12284 and XDPE12254 devices.
The devices from this family complaint with: The devices from this family complaint with:
- Intel VR13 and VR13HC rev 1.3, IMVP8 rev 1.2 and IMPVP9 rev 1.3 DC-DC - Intel VR13 and VR13HC rev 1.3, IMVP8 rev 1.2 and IMPVP9 rev 1.3 DC-DC
converter specification. converter specification.
- Intel SVID rev 1.9. protocol. - Intel SVID rev 1.9. protocol.

View File

@ -355,7 +355,9 @@ static ssize_t show_str(struct device *dev,
struct acpi_device *acpi_dev = to_acpi_device(dev); struct acpi_device *acpi_dev = to_acpi_device(dev);
struct acpi_power_meter_resource *resource = acpi_dev->driver_data; struct acpi_power_meter_resource *resource = acpi_dev->driver_data;
acpi_string val; acpi_string val;
int ret;
mutex_lock(&resource->lock);
switch (attr->index) { switch (attr->index) {
case 0: case 0:
val = resource->model_number; val = resource->model_number;
@ -372,8 +374,9 @@ static ssize_t show_str(struct device *dev,
val = ""; val = "";
break; break;
} }
ret = sprintf(buf, "%s\n", val);
return sprintf(buf, "%s\n", val); mutex_unlock(&resource->lock);
return ret;
} }
static ssize_t show_val(struct device *dev, static ssize_t show_val(struct device *dev,
@ -817,11 +820,12 @@ static void acpi_power_meter_notify(struct acpi_device *device, u32 event)
resource = acpi_driver_data(device); resource = acpi_driver_data(device);
mutex_lock(&resource->lock);
switch (event) { switch (event) {
case METER_NOTIFY_CONFIG: case METER_NOTIFY_CONFIG:
mutex_lock(&resource->lock);
free_capabilities(resource); free_capabilities(resource);
res = read_capabilities(resource); res = read_capabilities(resource);
mutex_unlock(&resource->lock);
if (res) if (res)
break; break;
@ -830,15 +834,12 @@ static void acpi_power_meter_notify(struct acpi_device *device, u32 event)
break; break;
case METER_NOTIFY_TRIP: case METER_NOTIFY_TRIP:
sysfs_notify(&device->dev.kobj, NULL, POWER_AVERAGE_NAME); sysfs_notify(&device->dev.kobj, NULL, POWER_AVERAGE_NAME);
update_meter(resource);
break; break;
case METER_NOTIFY_CAP: case METER_NOTIFY_CAP:
sysfs_notify(&device->dev.kobj, NULL, POWER_CAP_NAME); sysfs_notify(&device->dev.kobj, NULL, POWER_CAP_NAME);
update_cap(resource);
break; break;
case METER_NOTIFY_INTERVAL: case METER_NOTIFY_INTERVAL:
sysfs_notify(&device->dev.kobj, NULL, POWER_AVG_INTERVAL_NAME); sysfs_notify(&device->dev.kobj, NULL, POWER_AVG_INTERVAL_NAME);
update_avg_interval(resource);
break; break;
case METER_NOTIFY_CAPPING: case METER_NOTIFY_CAPPING:
sysfs_notify(&device->dev.kobj, NULL, POWER_ALARM_NAME); sysfs_notify(&device->dev.kobj, NULL, POWER_ALARM_NAME);
@ -848,7 +849,6 @@ static void acpi_power_meter_notify(struct acpi_device *device, u32 event)
WARN(1, "Unexpected event %d\n", event); WARN(1, "Unexpected event %d\n", event);
break; break;
} }
mutex_unlock(&resource->lock);
acpi_bus_generate_netlink_event(ACPI_POWER_METER_CLASS, acpi_bus_generate_netlink_event(ACPI_POWER_METER_CLASS,
dev_name(&device->dev), event, 0); dev_name(&device->dev), event, 0);
@ -912,8 +912,8 @@ static int acpi_power_meter_remove(struct acpi_device *device)
resource = acpi_driver_data(device); resource = acpi_driver_data(device);
hwmon_device_unregister(resource->hwmon_dev); hwmon_device_unregister(resource->hwmon_dev);
free_capabilities(resource);
remove_attrs(resource); remove_attrs(resource);
free_capabilities(resource);
kfree(resource); kfree(resource);
return 0; return 0;

View File

@ -1346,8 +1346,13 @@ w83627ehf_is_visible(const void *drvdata, enum hwmon_sensor_types type,
/* channel 0.., name 1.. */ /* channel 0.., name 1.. */
if (!(data->have_temp & (1 << channel))) if (!(data->have_temp & (1 << channel)))
return 0; return 0;
if (attr == hwmon_temp_input || attr == hwmon_temp_label) if (attr == hwmon_temp_input)
return 0444; return 0444;
if (attr == hwmon_temp_label) {
if (data->temp_label)
return 0444;
return 0;
}
if (channel == 2 && data->temp3_val_only) if (channel == 2 && data->temp3_val_only)
return 0; return 0;
if (attr == hwmon_temp_max) { if (attr == hwmon_temp_max) {