<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/drivers/nvme/host/hwmon.c, branch linux-6.9.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.9.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.9.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2023-08-21T19:54:02Z</updated>
<entry>
<title>nvme: host: hwmon: constify pointers to hwmon_channel_info</title>
<updated>2023-08-21T19:54:02Z</updated>
<author>
<name>Krzysztof Kozlowski</name>
<email>krzysztof.kozlowski@linaro.org</email>
</author>
<published>2023-08-20T09:21:39Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=71be868472dc5beb82feb4da2d3eb9cba785d660'/>
<id>urn:sha1:71be868472dc5beb82feb4da2d3eb9cba785d660</id>
<content type='text'>
Statically allocated array of pointed to hwmon_channel_info can be made
const for safety.

Signed-off-by: Krzysztof Kozlowski &lt;krzysztof.kozlowski@linaro.org&gt;
Acked-by: Christoph Hellwig &lt;hch@lst.de&gt;
Acked-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Keith Busch &lt;kbusch@kernel.org&gt;
</content>
</entry>
<entry>
<title>nvme-pci: add quirk for missing secondary temperature thresholds</title>
<updated>2023-05-03T16:11:43Z</updated>
<author>
<name>Hristo Venev</name>
<email>hristo@venev.name</email>
</author>
<published>2023-04-25T19:58:54Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=bd375feeaf3408ed00e08c3bc918d6be15f691ad'/>
<id>urn:sha1:bd375feeaf3408ed00e08c3bc918d6be15f691ad</id>
<content type='text'>
On Kingston KC3000 and Kingston FURY Renegade (both have the same PCI
IDs) accessing temp3_{min,max} fails with an invalid field error (note
that there is no problem setting the thresholds for temp1).

This contradicts the NVM Express Base Specification 2.0b, page 292:

  The over temperature threshold and under temperature threshold
  features shall be implemented for all implemented temperature sensors
  (i.e., all Temperature Sensor fields that report a non-zero value).

Define NVME_QUIRK_NO_SECONDARY_TEMP_THRESH that disables the thresholds
for all but the composite temperature and set it for this device.

Signed-off-by: Hristo Venev &lt;hristo@venev.name&gt;
Reviewed-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>nvme-hwmon: kmalloc the NVME SMART log buffer</title>
<updated>2022-10-19T10:43:13Z</updated>
<author>
<name>Serge Semin</name>
<email>Sergey.Semin@baikalelectronics.ru</email>
</author>
<published>2022-10-18T15:33:52Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=c94b7f9bab22ac504f9153767676e659988575ad'/>
<id>urn:sha1:c94b7f9bab22ac504f9153767676e659988575ad</id>
<content type='text'>
Recent commit 52fde2c07da6 ("nvme: set dma alignment to dword") has
caused a regression on our platform.

It turned out that the nvme_get_log() method invocation caused the
nvme_hwmon_data structure instance corruption.  In particular the
nvme_hwmon_data.ctrl pointer was overwritten either with zeros or with
garbage.  After some research we discovered that the problem happened
even before the actual NVME DMA execution, but during the buffer mapping.
Since our platform is DMA-noncoherent, the mapping implied the cache-line
invalidations or write-backs depending on the DMA-direction parameter.
In case of the NVME SMART log getting the DMA was performed
from-device-to-memory, thus the cache-invalidation was activated during
the buffer mapping.  Since the log-buffer isn't cache-line aligned, the
cache-invalidation caused the neighbour data to be discarded.  The
neighbouring data turned to be the data surrounding the buffer in the
framework of the nvme_hwmon_data structure.

In order to fix that we need to make sure that the whole log-buffer is
defined within the cache-line-aligned memory region so the
cache-invalidation procedure wouldn't involve the adjacent data. One of
the option to guarantee that is to kmalloc the DMA-buffer [1]. Seeing the
rest of the NVME core driver prefer that method it has been chosen to fix
this problem too.

Note after a deeper researches we found out that the denoted commit wasn't
a root cause of the problem. It just revealed the invalidity by activating
the DMA-based NVME SMART log getting performed in the framework of the
NVME hwmon driver. The problem was here since the initial commit of the
driver.

[1] Documentation/core-api/dma-api-howto.rst

Fixes: 400b6a7b13a3 ("nvme: Add hardware monitoring support")
Signed-off-by: Serge Semin &lt;Sergey.Semin@baikalelectronics.ru&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>nvme-hwmon: consistently ignore errors from nvme_hwmon_init</title>
<updated>2022-10-19T10:42:58Z</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2022-10-18T14:55:55Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=6b8cf94005187952f794c0c4ed3920a1e8accfa3'/>
<id>urn:sha1:6b8cf94005187952f794c0c4ed3920a1e8accfa3</id>
<content type='text'>
An NVMe controller works perfectly fine even when the hwmon
initialization fails.  Stop returning errors that do not come from a
controller reset from nvme_hwmon_init to handle this case consistently.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Reviewed-by: Serge Semin &lt;fancer.lancer@gmail.com&gt;
</content>
</entry>
<entry>
<title>nvme-hwmon: Return error code when registration fails</title>
<updated>2021-03-05T12:41:03Z</updated>
<author>
<name>Daniel Wagner</name>
<email>dwagner@suse.de</email>
</author>
<published>2021-02-12T09:30:15Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=78570f8873c8cd44c12714c7fa7db2601ec5617d'/>
<id>urn:sha1:78570f8873c8cd44c12714c7fa7db2601ec5617d</id>
<content type='text'>
The hwmon pointer wont be NULL if the registration fails. Though the
exit code path will assign it to ctrl-&gt;hwmon_device. Later
nvme_hwmon_exit() will try to free the invalid pointer. Avoid this by
returning the error code from hwmon_device_register_with_info().

Fixes: ed7770f66286 ("nvme/hwmon: rework to avoid devm allocation")
Signed-off-by: Daniel Wagner &lt;dwagner@suse.de&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>nvme-hwmon: rework to avoid devm allocation</title>
<updated>2021-02-10T15:38:06Z</updated>
<author>
<name>Hannes Reinecke</name>
<email>hare@suse.de</email>
</author>
<published>2021-01-19T06:43:18Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=ed7770f6628691c13c9423bce7eee7cff2399c12'/>
<id>urn:sha1:ed7770f6628691c13c9423bce7eee7cff2399c12</id>
<content type='text'>
The original design to use device-managed resource allocation
doesn't really work as the NVMe controller has a vastly different
lifetime than the hwmon sysfs attributes, causing warning about
duplicate sysfs entries upon reconnection.
This patch reworks the hwmon allocation to avoid device-managed
resource allocation, and uses the NVMe controller as parent for
the sysfs attributes.

Cc: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Hannes Reinecke &lt;hare@suse.de&gt;
Tested-by: Enzo Matsumiya &lt;ematsumiya@suse.de&gt;
Tested-by: Daniel Wagner &lt;dwagner@suse.de&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>nvme: return errors for hwmon init</title>
<updated>2020-09-22T15:49:55Z</updated>
<author>
<name>Keith Busch</name>
<email>kbusch@kernel.org</email>
</author>
<published>2020-09-17T15:50:25Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=59e330f8ff7ada7aa64fa422f6adf22a45152a7e'/>
<id>urn:sha1:59e330f8ff7ada7aa64fa422f6adf22a45152a7e</id>
<content type='text'>
Initializing the nvme hwmon retrieves a log from the controller. If the
controller is broken, we need to return the appropriate error so that
subsequent initialization doesn't attempt to continue.

Reported-by: Tong Zhang &lt;ztong0001@gmail.com&gt;
Signed-off-by: Keith Busch &lt;kbusch@kernel.org&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>nvme-hwmon: log the controller device name</title>
<updated>2020-07-29T05:45:20Z</updated>
<author>
<name>Sagi Grimberg</name>
<email>sagi@grimberg.me</email>
</author>
<published>2020-07-24T01:14:10Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=653303f21682916dc3a70c24f68233b4392d52d6'/>
<id>urn:sha1:653303f21682916dc3a70c24f68233b4392d52d6</id>
<content type='text'>
Stay consistent with the rest of the driver

Signed-off-by: Sagi Grimberg &lt;sagi@grimberg.me&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>nvme: support for multiple Command Sets Supported and Effects log pages</title>
<updated>2020-07-08T14:16:20Z</updated>
<author>
<name>Keith Busch</name>
<email>keith.busch@wdc.com</email>
</author>
<published>2020-06-29T19:06:40Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=be93e87e780253780df9bb6ecc9bc1199b0d94c3'/>
<id>urn:sha1:be93e87e780253780df9bb6ecc9bc1199b0d94c3</id>
<content type='text'>
The Commands Supported and Effects log page was extended with a CSI
field that enables the host to query the log page for each command set
supported. Retrieve this log page for each command set that an attached
namespace supports, and save a pointer to that log in the namespace head.

Reviewed-by: Matias Bjørling &lt;matias.bjorling@wdc.com&gt;
Reviewed-by: Javier González &lt;javier.gonz@samsung.com&gt;
Reviewed-by: Himanshu Madhani &lt;himanshu.madhani@oracle.com&gt;
Reviewed-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.de&gt;
Reviewed-by: Johannes Thumshirn &lt;johannes.thumshirn@wdc.com&gt;
Reviewed-by: Daniel Wagner &lt;dwagner@suse.de&gt;
Signed-off-by: Keith Busch &lt;keith.busch@wdc.com&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>nvme: hwmon: switch to use &lt;linux/units.h&gt; helpers</title>
<updated>2020-01-31T18:30:40Z</updated>
<author>
<name>Akinobu Mita</name>
<email>akinobu.mita@gmail.com</email>
</author>
<published>2020-01-31T06:15:53Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=7724cd2bff55d29206d6f6d236ec222d155b2e41'/>
<id>urn:sha1:7724cd2bff55d29206d6f6d236ec222d155b2e41</id>
<content type='text'>
This switches the nvme driver to use kelvin_to_millicelsius() and
millicelsius_to_kelvin() in &lt;linux/units.h&gt;.

Link: http://lkml.kernel.org/r/1576386975-7941-8-git-send-email-akinobu.mita@gmail.com
Signed-off-by: Akinobu Mita &lt;akinobu.mita@gmail.com&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Reviewed-by: Keith Busch &lt;kbusch@kernel.org&gt;
Reviewed-by: Andy Shevchenko &lt;andy.shevchenko@gmail.com&gt;
Cc: Sujith Thomas &lt;sujith.thomas@intel.com&gt;
Cc: Darren Hart &lt;dvhart@infradead.org&gt;
Cc: Andy Shevchenko &lt;andy@infradead.org&gt;
Cc: Zhang Rui &lt;rui.zhang@intel.com&gt;
Cc: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Cc: Amit Kucheria &lt;amit.kucheria@verdurent.com&gt;
Cc: Jean Delvare &lt;jdelvare@suse.com&gt;
Cc: Guenter Roeck &lt;linux@roeck-us.net&gt;
Cc: Keith Busch &lt;kbusch@kernel.org&gt;
Cc: Jens Axboe &lt;axboe@fb.com&gt;
Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Cc: Sagi Grimberg &lt;sagi@grimberg.me&gt;
Cc: Emmanuel Grumbach &lt;emmanuel.grumbach@intel.com&gt;
Cc: Hartmut Knaack &lt;knaack.h@gmx.de&gt;
Cc: Johannes Berg &lt;johannes.berg@intel.com&gt;
Cc: Jonathan Cameron &lt;jic23@kernel.org&gt;
Cc: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
Cc: Kalle Valo &lt;kvalo@codeaurora.org&gt;
Cc: Lars-Peter Clausen &lt;lars@metafoo.de&gt;
Cc: Luca Coelho &lt;luciano.coelho@intel.com&gt;
Cc: Peter Meerwald-Stadler &lt;pmeerw@pmeerw.net&gt;
Cc: Stanislaw Gruszka &lt;sgruszka@redhat.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
</feed>
