Skip to content

Commit 5b442b1

Browse files
committed
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
2 parents fea6302 + e61d239 commit 5b442b1

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

Documentation/hwmon/xdpe12284.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ This driver implements support for Infineon Multi-phase XDPE122 family
2424
dual loop voltage regulators.
2525
The family includes XDPE12284 and XDPE12254 devices.
2626
The devices from this family complaint with:
27+
2728
- Intel VR13 and VR13HC rev 1.3, IMVP8 rev 1.2 and IMPVP9 rev 1.3 DC-DC
2829
converter specification.
2930
- Intel SVID rev 1.9. protocol.

drivers/hwmon/acpi_power_meter.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,9 @@ static ssize_t show_str(struct device *dev,
355355
struct acpi_device *acpi_dev = to_acpi_device(dev);
356356
struct acpi_power_meter_resource *resource = acpi_dev->driver_data;
357357
acpi_string val;
358+
int ret;
358359

360+
mutex_lock(&resource->lock);
359361
switch (attr->index) {
360362
case 0:
361363
val = resource->model_number;
@@ -372,8 +374,9 @@ static ssize_t show_str(struct device *dev,
372374
val = "";
373375
break;
374376
}
375-
376-
return sprintf(buf, "%s\n", val);
377+
ret = sprintf(buf, "%s\n", val);
378+
mutex_unlock(&resource->lock);
379+
return ret;
377380
}
378381

379382
static ssize_t show_val(struct device *dev,
@@ -817,11 +820,12 @@ static void acpi_power_meter_notify(struct acpi_device *device, u32 event)
817820

818821
resource = acpi_driver_data(device);
819822

820-
mutex_lock(&resource->lock);
821823
switch (event) {
822824
case METER_NOTIFY_CONFIG:
825+
mutex_lock(&resource->lock);
823826
free_capabilities(resource);
824827
res = read_capabilities(resource);
828+
mutex_unlock(&resource->lock);
825829
if (res)
826830
break;
827831

@@ -830,15 +834,12 @@ static void acpi_power_meter_notify(struct acpi_device *device, u32 event)
830834
break;
831835
case METER_NOTIFY_TRIP:
832836
sysfs_notify(&device->dev.kobj, NULL, POWER_AVERAGE_NAME);
833-
update_meter(resource);
834837
break;
835838
case METER_NOTIFY_CAP:
836839
sysfs_notify(&device->dev.kobj, NULL, POWER_CAP_NAME);
837-
update_cap(resource);
838840
break;
839841
case METER_NOTIFY_INTERVAL:
840842
sysfs_notify(&device->dev.kobj, NULL, POWER_AVG_INTERVAL_NAME);
841-
update_avg_interval(resource);
842843
break;
843844
case METER_NOTIFY_CAPPING:
844845
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)
848849
WARN(1, "Unexpected event %d\n", event);
849850
break;
850851
}
851-
mutex_unlock(&resource->lock);
852852

853853
acpi_bus_generate_netlink_event(ACPI_POWER_METER_CLASS,
854854
dev_name(&device->dev), event, 0);
@@ -912,8 +912,8 @@ static int acpi_power_meter_remove(struct acpi_device *device)
912912
resource = acpi_driver_data(device);
913913
hwmon_device_unregister(resource->hwmon_dev);
914914

915-
free_capabilities(resource);
916915
remove_attrs(resource);
916+
free_capabilities(resource);
917917

918918
kfree(resource);
919919
return 0;

drivers/hwmon/w83627ehf.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1346,8 +1346,13 @@ w83627ehf_is_visible(const void *drvdata, enum hwmon_sensor_types type,
13461346
/* channel 0.., name 1.. */
13471347
if (!(data->have_temp & (1 << channel)))
13481348
return 0;
1349-
if (attr == hwmon_temp_input || attr == hwmon_temp_label)
1349+
if (attr == hwmon_temp_input)
13501350
return 0444;
1351+
if (attr == hwmon_temp_label) {
1352+
if (data->temp_label)
1353+
return 0444;
1354+
return 0;
1355+
}
13511356
if (channel == 2 && data->temp3_val_only)
13521357
return 0;
13531358
if (attr == hwmon_temp_max) {

0 commit comments

Comments
 (0)