Linux CXL
 help / color / mirror / Atom feed
From: Jehoon Park <jehoon.park@samsung.com>
To: Nathan Fontenot <nafonten@amd.com>
Cc: linux-cxl@vger.kernel.org, nvdimm@lists.linux.dev,
	Alison Schofield <alison.schofield@intel.com>,
	Vishal Verma <vishal.l.verma@intel.com>,
	Ira Weiny <ira.weiny@intel.com>,
	Dan Williams <dan.j.williams@intel.com>,
	Dave Jiang <dave.jiang@intel.com>,
	Davidlohr Bueso <dave@stgolabs.net>,
	Jonathan Cameron <jonathan.cameron@huawei.com>,
	Kyungsan Kim <ks0204.kim@samsung.com>,
	Junhyeok Im <junhyeok.im@samsung.com>
Subject: Re: [ndctl PATCH RESEND 1/2] cxl: Update a revision by CXL 3.0 specification
Date: Tue, 18 Jul 2023 13:34:08 +0900	[thread overview]
Message-ID: <20230718043408.GA4295@jehoon-Precision-7920-Tower> (raw)
In-Reply-To: <f9caa859-0f65-a658-d144-0332cd4f0833@amd.com>

[-- Attachment #1: Type: text/plain, Size: 1963 bytes --]

On Mon, Jul 17, 2023 at 08:18:55AM -0500, Nathan Fontenot wrote:
> On 7/17/23 01:29, Jehoon Park wrote:
> > Update the value of device temperature field when it is not implemented.
> > (CXL 3.0 8.2.9.8.3.1)
> > 
> > Signed-off-by: Jehoon Park <jehoon.park@samsung.com>
> > ---
> >  cxl/json.c        | 2 +-
> >  cxl/lib/private.h | 2 +-
> >  2 files changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/cxl/json.c b/cxl/json.c
> > index 9a4b5c7..3661eb9 100644
> > --- a/cxl/json.c
> > +++ b/cxl/json.c
> > @@ -155,7 +155,7 @@ static struct json_object *util_cxl_memdev_health_to_json(
> >  	}
> >  
> >  	field = cxl_cmd_health_info_get_temperature(cmd);
> > -	if (field != 0xffff) {
> > +	if (field != 0x7fff) {
> 
> Should you also update this field check to use CXL_CMD_HEALTH_INFO_TEMPERATURE_NOT_IMPL
> instead of using 0x7fff directly?
> 
> -Nathan
>

Hi, Nathan

I agree with your suggestion since it is more understandable. However, the
constant macro is defined in "cxl/lib/private.h" which should be included only
under "cxl/lib/" (as I understand properly). To use the macro in json.c,
we have to define it somewhere under "cxl/" e.g. libcxl.h, json.h, ...

I'm not sure about this approach is right, so I followed existing
implementation that used NOT_IMPL value directly.

Jehoon

> >  		jobj = json_object_new_int(field);
> >  		if (jobj)
> >  			json_object_object_add(jhealth, "temperature", jobj);
> > diff --git a/cxl/lib/private.h b/cxl/lib/private.h
> > index d49b560..e92592d 100644
> > --- a/cxl/lib/private.h
> > +++ b/cxl/lib/private.h
> > @@ -324,7 +324,7 @@ struct cxl_cmd_set_partition {
> >  #define CXL_CMD_HEALTH_INFO_EXT_CORRECTED_PERSISTENT_WARNING		(1)
> >  
> >  #define CXL_CMD_HEALTH_INFO_LIFE_USED_NOT_IMPL				0xff
> > -#define CXL_CMD_HEALTH_INFO_TEMPERATURE_NOT_IMPL			0xffff
> > +#define CXL_CMD_HEALTH_INFO_TEMPERATURE_NOT_IMPL			0x7fff
> >  
> >  static inline int check_kmod(struct kmod_ctx *kmod_ctx)
> >  {

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



  reply	other threads:[~2023-07-18  4:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20230717062617epcas2p46229ab9feac5a094afd44761e2b9a403@epcas2p4.samsung.com>
2023-07-17  6:29 ` [ndctl PATCH RESEND 0/2] Fix accessors for temperature field when it is negative Jehoon Park
2023-07-17  6:29   ` [ndctl PATCH RESEND 1/2] cxl: Update a revision by CXL 3.0 specification Jehoon Park
2023-07-17 13:18     ` Nathan Fontenot
2023-07-18  4:34       ` Jehoon Park [this message]
2023-07-17  6:29   ` [ndctl PATCH RESEND 2/2] libcxl: Fix accessors for temperature field to support negative value Jehoon Park
2023-07-24 21:08     ` Verma, Vishal L
2023-07-31  3:17       ` Jehoon Park
2023-07-31 18:45         ` Verma, Vishal L

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230718043408.GA4295@jehoon-Precision-7920-Tower \
    --to=jehoon.park@samsung.com \
    --cc=alison.schofield@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=dave@stgolabs.net \
    --cc=ira.weiny@intel.com \
    --cc=jonathan.cameron@huawei.com \
    --cc=junhyeok.im@samsung.com \
    --cc=ks0204.kim@samsung.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=nafonten@amd.com \
    --cc=nvdimm@lists.linux.dev \
    --cc=vishal.l.verma@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox