Linux CXL
 help / color / mirror / Atom feed
From: Ira Weiny <ira.weiny@intel.com>
To: Davidlohr Bueso <dave@stgolabs.net>,
	Nabeel M Mohamed <nabeelmd.linux@gmail.com>
Cc: Jonathan Cameron <Jonathan.Cameron@huawei.com>,
	<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 v2] cxl/pci: Set the device timestamp
Date: Thu, 23 Feb 2023 14:11:31 -0800	[thread overview]
Message-ID: <63f7e493394da_20753229444@iweiny-mobl.notmuch> (raw)
In-Reply-To: <20230223164227.djns4grt3qeydmn6@offworld>

Davidlohr Bueso wrote:
> On Wed, 22 Feb 2023, Nabeel M Mohamed wrote:
> 
> >So, I'm wondering if there's any checklist listing the prerequisites
> >for submitting a patch to the CXL driver - for instance, requirements
> >on adding new tests for coverage, any existing CXL regression suites
> >that the patch must pass, etc.
> 
> Btw we might want to support timestamps in the mock device, no? I am
> aware that qemu has both get and set.
> 
> --<8-----
> [PATCH] cxl/test: Add mock test for set_timestamp
> 
> Support the command testing in a unit-test fashion.
> 

Reviewed-by: Ira Weiny <ira.weiny@intel.com>

> Signed-off-by: Davidlohr Bueso <dave@stgolabs.net>
> ---
>   tools/testing/cxl/test/mem.c | 23 +++++++++++++++++++++++
>   1 file changed, 23 insertions(+)
> 
> diff --git a/tools/testing/cxl/test/mem.c b/tools/testing/cxl/test/mem.c
> index 9263b04d35f7..09511f2fbe54 100644
> --- a/tools/testing/cxl/test/mem.c
> +++ b/tools/testing/cxl/test/mem.c
> @@ -98,6 +98,7 @@ struct cxl_mockmem_data {
>   	int master_limit;
>   	struct mock_event_store mes;
>   	u8 event_buf[SZ_4K];
> +	u64 timestamp;
>   };
>   
>   static struct mock_event_log *event_find_log(struct device *dev, int log_type)
> @@ -361,6 +362,21 @@ struct cxl_event_mem_module mem_module = {
>   	}
>   };
>   
> +static int mock_set_timestamp(struct cxl_dev_state *cxlds, struct cxl_mbox_cmd *cmd)
> +{
> +	struct cxl_mockmem_data *mdata = dev_get_drvdata(cxlds->dev);
> +	struct cxl_mbox_set_timestamp_in *ts = cmd->payload_in;
> +
> +	if (cmd->size_in != sizeof(*ts))
> +		return -EINVAL;
> +
> +	if (cmd->size_out != 0)
> +		return -EINVAL;
> +
> +	mdata->timestamp = le64_to_cpu(ts->timestamp);
> +	return 0;
> +}
> +
>   static void cxl_mock_add_event_logs(struct mock_event_store *mes)
>   {
>   	put_unaligned_le16(CXL_GMER_VALID_CHANNEL | CXL_GMER_VALID_RANK,
> @@ -894,6 +910,9 @@ static int cxl_mock_mbox_send(struct cxl_dev_state *cxlds, struct cxl_mbox_cmd *
>   	int rc = -EIO;
>   
>   	switch (cmd->opcode) {
> +	case CXL_MBOX_OP_SET_TIMESTAMP:
> +		rc = mock_set_timestamp(cxlds, cmd);
> +		break;
>   	case CXL_MBOX_OP_GET_SUPPORTED_LOGS:
>   		rc = mock_gsl(cmd);
>   		break;
> @@ -1010,6 +1029,10 @@ static int cxl_mock_mem_probe(struct platform_device *pdev)
>   	if (rc)
>   		return rc;
>   
> +	rc = cxl_set_timestamp(cxlds);
> +	if (rc)
> +		return rc;
> +
>   	rc = cxl_dev_state_identify(cxlds);
>   	if (rc)
>   		return rc;
> -- 
> 2.39.0
> 



  reply	other threads:[~2023-02-23 22:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-30 15:13 [PATCH v2] cxl/pci: Set the device timestamp Jonathan Cameron
2023-01-30 19:29 ` Dan Williams
2023-02-22 15:34 ` Nabeel M Mohamed
2023-02-22 16:27   ` Jonathan Cameron
2023-02-23  3:55     ` Nabeel M Mohamed
2023-02-23 15:05       ` Jonathan Cameron
2023-02-23 16:10         ` Nabeel M Mohamed
2023-02-23 16:42       ` Davidlohr Bueso
2023-02-23 22:11         ` Ira Weiny [this message]
2023-04-22  1:34         ` Dan Williams

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=63f7e493394da_20753229444@iweiny-mobl.notmuch \
    --to=ira.weiny@intel.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=alison.schofield@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave@stgolabs.net \
    --cc=linux-cxl@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=nabeelmd.linux@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox