[PATCHv2] nvme/hwmon: rework to avoid devm allocation

Daniel Wagner dwagner at suse.de
Tue Feb 9 07:37:36 EST 2021


On Wed, Jan 27, 2021 at 05:35:55PM +0100, Christoph Hellwig wrote:
> On Tue, Jan 19, 2021 at 09:54:30PM -0800, Guenter Roeck wrote:
> > It needs lm-sensors version 3.5.0 or later. Older versions
> > don't support a device hierarchy.
>
> Hannes, did you get a chance to test this with lm-sensors?

I gave it a go. All looks good.

Tested-by: Daniel Wagner <dwagner at suse.de>


  dolin:~/:[0]# sensors --version
  sensors version 3.5.0 with libsensors version 3.5.0

Baseline:

  dolin:~/:[0]# sensors
  coretemp-isa-0000
  Adapter: ISA adapter
  Package id 0:  +36.0°C  (high = +67.0°C, crit = +77.0°C)
  Core 0:        +28.0°C  (high = +67.0°C, crit = +77.0°C)
  Core 1:        +29.0°C  (high = +67.0°C, crit = +77.0°C)
  Core 2:        +29.0°C  (high = +67.0°C, crit = +77.0°C)
  Core 3:        +28.0°C  (high = +67.0°C, crit = +77.0°C)
  Core 4:        +29.0°C  (high = +67.0°C, crit = +77.0°C)
  Core 8:        +27.0°C  (high = +67.0°C, crit = +77.0°C)
  Core 9:        +28.0°C  (high = +67.0°C, crit = +77.0°C)
  Core 10:       +28.0°C  (high = +67.0°C, crit = +77.0°C)
  Core 11:       +28.0°C  (high = +67.0°C, crit = +77.0°C)
  Core 12:       +28.0°C  (high = +67.0°C, crit = +77.0°C)

  nvme-virtual-0
  Adapter: Virtual device
  Composite:   -273.1°C

  nvme-virtual-0
  Adapter: Virtual device
  Composite:   -273.1°C
  [...]


With the patch:

  dolin:~/:[0]# sensors
  coretemp-isa-0000
  Adapter: ISA adapter
  Package id 0:  +38.0°C  (high = +67.0°C, crit = +77.0°C)
  Core 0:        +29.0°C  (high = +67.0°C, crit = +77.0°C)
  Core 1:        +31.0°C  (high = +67.0°C, crit = +77.0°C)
  Core 2:        +29.0°C  (high = +67.0°C, crit = +77.0°C)
  Core 3:        +30.0°C  (high = +67.0°C, crit = +77.0°C)
  Core 4:        +29.0°C  (high = +67.0°C, crit = +77.0°C)
  Core 8:        +30.0°C  (high = +67.0°C, crit = +77.0°C)
  Core 9:        +28.0°C  (high = +67.0°C, crit = +77.0°C)
  Core 10:       +30.0°C  (high = +67.0°C, crit = +77.0°C)
  Core 11:       +30.0°C  (high = +67.0°C, crit = +77.0°C)
  Core 12:       +28.0°C  (high = +67.0°C, crit = +77.0°C)

  nvme-virtual-0
  Adapter: Virtual device
  Composite:   -273.1°C

  nvme-virtual-0
  Adapter: Virtual device
  Composite:   -273.1°C
  [...]


  dolin:~/:[0]# find /sys -name hwmon*
  /sys/kernel/debug/tracing/events/hwmon
  /sys/kernel/debug/tracing/events/hwmon/hwmon_attr_show
  /sys/kernel/debug/tracing/events/hwmon/hwmon_attr_store
  /sys/kernel/debug/tracing/events/hwmon/hwmon_attr_show_string
  /sys/class/hwmon
  /sys/class/hwmon/hwmon16
  /sys/class/hwmon/hwmon14
  /sys/class/hwmon/hwmon8
  /sys/class/hwmon/hwmon12
  /sys/class/hwmon/hwmon6
  /sys/class/hwmon/hwmon20
  /sys/class/hwmon/hwmon10
  /sys/class/hwmon/hwmon4
  /sys/class/hwmon/hwmon19
  /sys/class/hwmon/hwmon2
  /sys/class/hwmon/hwmon17
  /sys/class/hwmon/hwmon0
  /sys/class/hwmon/hwmon15
  /sys/class/hwmon/hwmon9
  /sys/class/hwmon/hwmon13
  /sys/class/hwmon/hwmon7
  /sys/class/hwmon/hwmon11
  /sys/class/hwmon/hwmon5
  /sys/class/hwmon/hwmon3
  /sys/class/hwmon/hwmon18
  /sys/class/hwmon/hwmon1
  /sys/devices/platform/coretemp.3/hwmon
  /sys/devices/platform/coretemp.3/hwmon/hwmon19
  /sys/devices/platform/coretemp.1/hwmon
  /sys/devices/platform/coretemp.1/hwmon/hwmon17
  /sys/devices/platform/coretemp.2/hwmon
  /sys/devices/platform/coretemp.2/hwmon/hwmon18
  /sys/devices/platform/coretemp.0/hwmon
  /sys/devices/platform/coretemp.0/hwmon/hwmon16
  /sys/devices/pci0000:00/0000:00:02.2/0000:03:00.0/hwmon
  /sys/devices/pci0000:00/0000:00:02.2/0000:03:00.0/hwmon/hwmon20
  /sys/devices/virtual/nvme-fabrics/ctl/nvme23/hwmon11
  /sys/devices/virtual/nvme-fabrics/ctl/nvme7/hwmon1
  /sys/devices/virtual/nvme-fabrics/ctl/nvme21/hwmon9
  /sys/devices/virtual/nvme-fabrics/ctl/nvme18/hwmon6
  /sys/devices/virtual/nvme-fabrics/ctl/nvme26/hwmon14
  /sys/devices/virtual/nvme-fabrics/ctl/nvme16/hwmon4
  /sys/devices/virtual/nvme-fabrics/ctl/nvme24/hwmon12
  /sys/devices/virtual/nvme-fabrics/ctl/nvme14/hwmon2
  /sys/devices/virtual/nvme-fabrics/ctl/nvme22/hwmon10
  /sys/devices/virtual/nvme-fabrics/ctl/nvme6/hwmon0
  /sys/devices/virtual/nvme-fabrics/ctl/nvme20/hwmon8
  /sys/devices/virtual/nvme-fabrics/ctl/nvme19/hwmon7
  /sys/devices/virtual/nvme-fabrics/ctl/nvme27/hwmon15
  /sys/devices/virtual/nvme-fabrics/ctl/nvme17/hwmon5
  /sys/devices/virtual/nvme-fabrics/ctl/nvme25/hwmon13
  /sys/devices/virtual/nvme-fabrics/ctl/nvme15/hwmon3
  



More information about the Linux-nvme mailing list