All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
To: Davidlohr Bueso <dave@stgolabs.net>
Cc: <linux-cxl@vger.kernel.org>,
	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>, <linuxarm@huawei.com>
Subject: Re: [PATCH] cxl/pci: Set the device timestamp
Date: Fri, 27 Jan 2023 12:08:13 +0000	[thread overview]
Message-ID: <20230127120813.00004f65@huawei.com> (raw)
In-Reply-To: <20230127095706.00002d36@Huawei.com>

On Fri, 27 Jan 2023 09:57:06 +0000
Jonathan Cameron <Jonathan.Cameron@Huawei.com> wrote:

> On Thu, 26 Jan 2023 10:56:20 -0800
> Davidlohr Bueso <dave@stgolabs.net> wrote:
> 
> > On Thu, 26 Jan 2023, Jonathan Cameron wrote:
> >   
> > >Note that the command is optional and if
> > >not supported and the device cannot return accurate timestamps it will
> > >fill the fields in with an appropriate marker (see the specification
> > >description of each timestamp).    
> > 
> > A few questions (which I'm missing from the spec):
> > 
> > - How to verify if a ts was actually set? I would assume that if SET
> > is unsupported, GET will also be, and since you set the ts at
> > bootup, it should never occur in reality.  
> 
> I don't think we care.  If a record comes back with the magic code (all
> zeros) that is in the spec. Get can still be supported.
> 
> > 
> > - Does "unsupported" return type mean the command cannot mean that
> > flat out the device cannot handle timestamps or is it more that the
> > device cannot handle nanosecond resolution?  
> 
> Neither - it just means that it cannot be set by this means.
> There is no provision for anything other than nanoseconds, but there is also
> no statement on accuracy.  So if you only do seconds, multiply the number
> by 1x10^9
> 
> The device might have another means of setting it. MCTP for example
> or in theory might have an RTC.  The OS can only tell if that is true
> when it sees a timestamp.
> 
> 
> 
> > 
> > ...
> >   
> > >@@ -65,6 +65,7 @@ static struct cxl_mem_command cxl_mem_commands[CXL_MEM_COMMAND_ID_MAX] = {
> > >	CXL_CMD(GET_SCAN_MEDIA_CAPS, 0x10, 0x4, 0),
> > >	CXL_CMD(SCAN_MEDIA, 0x11, 0, 0),
> > >	CXL_CMD(GET_SCAN_MEDIA, 0, CXL_VARIABLE_PAYLOAD, 0),
> > >+	CXL_CMD(SET_TIMESTAMP, 8, 0, 0),
> > > };
> > >
> > > /*
> > >@@ -93,6 +94,7 @@ static u16 cxl_disabled_raw_commands[] = {
> > >	CXL_MBOX_OP_SET_SHUTDOWN_STATE,
> > >	CXL_MBOX_OP_SCAN_MEDIA,
> > >	CXL_MBOX_OP_GET_SCAN_MEDIA,
> > >+	CXL_MBOX_OP_SET_TIMESTAMP,    
> > 
> > Why no GET support?

Missed this question in first reply.

Original thought was don't provide something we aren't yet using.
After Dan's review I've removed userspace direct access and not restricted the
set here. So adding Get makes even less sense at this stage.

Thanks

Jonathan



  reply	other threads:[~2023-01-27 12:14 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-26 18:04 [PATCH] cxl/pci: Set the device timestamp Jonathan Cameron
2023-01-26 18:56 ` Davidlohr Bueso
2023-01-27  9:57   ` Jonathan Cameron
2023-01-27 12:08     ` Jonathan Cameron [this message]
2023-01-26 19:59 ` Alison Schofield
2023-01-27  9:59   ` Jonathan Cameron
2023-01-27  9:59     ` Jonathan Cameron
2023-01-26 20:22 ` Dan Williams
2023-01-27 10:04   ` Jonathan Cameron
2023-01-27 12:10     ` Jonathan Cameron
2023-01-27 19:07       ` Dan Williams
2023-01-27 23:50         ` Ira Weiny
2023-01-28  0:17           ` Dan Williams
2023-01-28 11:21 ` kernel test robot
2023-01-28 11:32 ` kernel test robot
2023-01-30 15:10   ` Jonathan Cameron
2023-01-28 16:01 ` kernel test robot

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=20230127120813.00004f65@huawei.com \
    --to=jonathan.cameron@huawei.com \
    --cc=alison.schofield@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave@stgolabs.net \
    --cc=ira.weiny@intel.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.