Skip to content

ntb: idt: Add hwmon temperature sensor interface

Serge Semin lkml ntb 2 versions – Applied

Status from this message: Applied to the ntb-next branch

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 1 replyApplied
  2. v14 patches 1 replySuperseded

Changes in v2 from the cover letter

- Add "select HWMON" to the NTB_IDT kconfig

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/4ntb: idt: Alter temperature read methoddrivers/ntb/hw/idt/ntb_hw_idt.c drivers/ntb/hw/idt/ntb_hw_idt.h+152 -170 replies
2/4ntb: idt: Add basic hwmon sysfs interfacedrivers/ntb/hw/idt/Kconfig drivers/ntb/hw/idt/ntb_hw_idt.c drivers/ntb/hw/idt/ntb_hw_idt.h+206 -10 replies
3/4ntb: idt: Discard temperature sensor IRQ handlerdrivers/ntb/hw/idt/ntb_hw_idt.c drivers/ntb/hw/idt/ntb_hw_idt.h+3 -430 replies
4/4ntb: idt: Alter the driver info commentsdrivers/ntb/hw/idt/Kconfig drivers/ntb/hw/idt/ntb_hw_idt.c drivers/ntb/hw/idt/ntb_hw_idt.h+8 -90 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/4] ntb: idt: Add hwmon temperature sensor interface

IDT PCIe-switches are equipped with an embedded temperature sensor. It works within the range [0; 127.5]C with a resolution of 0.5C. It can be used to monitor the chip core temperature so to have prevent it from possible overheating. It might be very topical for the chip, since it gets heated like in hell especially if ASPM isn't enabled.

Other than the current sampled temperatur, the sensor interface exposes history registors with lowest and highest measured temperature, thresholds and alarm IRQs enabled/disable bits, ADC/filter settings. The device manual states that the switch is able to generate a msi interrupt on PCIe upstreams if the temperature crosses one of three configurable thresholds. But in practice we discovered that the enable/disable threshold IRQs bits interface is very broken (see the third patch commit message), so it can't be used to create the hwmon alarm interface. As the result we had to remove the already available temperature sensor IRQ handler and disable the corresponding interrupt.

Current version of the driver provides following standard hwmon sysfs
files: temperature input, lowest and highest measured temperature with possibility to reset the history, temperature offset. The rest of the nodes can't be safely implemented for the chip due to the described issues.

Changelog v2:
- Add "select HWMON" to the NTB_IDT kconfig

Serge Semin (4):
ntb: idt: Alter temperature read method
ntb: idt: Add basic hwmon sysfs interface
ntb: idt: Discard temperature sensor IRQ handler
ntb: idt: Alter the driver info comments

 drivers/ntb/hw/idt/Kconfig      |   4 +-
 drivers/ntb/hw/idt/ntb_hw_idt.c | 317 ++++++++++++++++++++++++++++++++++------
 drivers/ntb/hw/idt/ntb_hw_idt.h |  87 ++++++++++-
 3 files changed, 353 insertions(+), 55 deletions(-)
Signature · 1 line
2.12.0