mbox series

[ndctl,0/2] Fix accessors for temperature field when it is negative

Message ID 20230616010841.3632-1-jehoon.park@samsung.com
Headers show
Series Fix accessors for temperature field when it is negative | expand

Message

Jehoon Park June 16, 2023, 1:08 a.m. UTC
From: Jehoon Park <jehoon.park@samsung.com>

In CXL 3.0 SPEC, 8.2.9.8.3.1 and 8.2.9.8.3.2 define temperature fields
as a 2's complement value. However, they are retrieved by the same accessor
for unsigned value. This causes inaccuracy when the value is negative.

The first patch updates the pre-defined value for temperature field of
the Get Health Info command when it is not implemented by complying
CXL 3.0 specification. (CXL 3.0 8.2.9.8.3.1)

The second patch fixes accessors for temperature fields.
Add a new payload accessor for a signed value, then use it for retrieving
temperature properly. Remove negative error numbers since they are not
distinguishable from the retrieved value because it could be negative.
They are replaced by debug message.

Jehoon Park (2):
  cxl: Update a revision by CXL 3.0 specification
  libcxl: Fix accessors for temperature field to support negative value

 cxl/json.c        |  2 +-
 cxl/lib/libcxl.c  | 36 ++++++++++++++++++++++++++----------
 cxl/lib/private.h |  2 +-
 3 files changed, 28 insertions(+), 12 deletions(-)


base-commit: 7f75ce36ce3a0d41ed74d4e2dfcfd41a6fd7fe40