From: Jehoon Park <jehoon.p...@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 -- 2.17.1