From: Dan Williams <dan.j.williams@intel.com>
To: Jonathan Cameron <Jonathan.Cameron@huawei.com>,
<linux-cxl@vger.kernel.org>
Cc: Dan Williams <dan.j.williams@intel.com>,
Alison Schofield <alison.schofield@intel.com>,
Vishal Verma <vishal.l.verma@intel.com>,
"Ira Weiny" <ira.weiny@intel.com>,
Ben Widawsky <bwidawsk@kernel.org>, <linuxarm@huawei.com>,
"Viacheslav A . Dubeyko" <viacheslav.dubeyko@bytedance.com>
Subject: RE: [RFC PATCH v2 2/4] cxl/mbox: Change parameters to cxl_send_cmd() to not assume a cxl memory device.
Date: Mon, 12 Dec 2022 16:12:17 -0800 [thread overview]
Message-ID: <6397c361826e2_b41e3294bf@dwillia2-xfh.jf.intel.com.notmuch> (raw)
In-Reply-To: <20221025104243.20836-3-Jonathan.Cameron@huawei.com>
Jonathan Cameron wrote:
> Intent here is to enable CXL switch CCIs in the following patch.
>
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> ---
> drivers/cxl/core/core.h | 5 ++++-
> drivers/cxl/core/mbox.c | 5 ++---
> drivers/cxl/core/memdev.c | 4 +++-
> 3 files changed, 9 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/cxl/core/core.h b/drivers/cxl/core/core.h
> index 1d8f87be283f..0835942bcea6 100644
> --- a/drivers/cxl/core/core.h
> +++ b/drivers/cxl/core/core.h
> @@ -41,9 +41,12 @@ static inline void cxl_region_exit(void)
>
> struct cxl_send_command;
> struct cxl_mem_query_commands;
> +struct cxl_dev_state;
> +struct device;
> int cxl_query_cmd(struct cxl_memdev *cxlmd,
> struct cxl_mem_query_commands __user *q);
> -int cxl_send_cmd(struct cxl_memdev *cxlmd, struct cxl_send_command __user *s);
> +int cxl_send_cmd(struct cxl_dev_state *cxlds, struct device *dev,
> + struct cxl_send_command __user *s);
Me thinks this wants another level of indirection to move the generic
mailbox bits out of 'struct cxl_dev_state' into a common structure that
endpoint and switch drivers can include in their local driver states.
> void __iomem *devm_cxl_iomap_block(struct device *dev, resource_size_t addr,
> resource_size_t length);
>
> diff --git a/drivers/cxl/core/mbox.c b/drivers/cxl/core/mbox.c
> index dd9e0aac37ae..3823d450fdd2 100644
> --- a/drivers/cxl/core/mbox.c
> +++ b/drivers/cxl/core/mbox.c
> @@ -526,10 +526,9 @@ static int handle_mailbox_cmd_from_user(struct cxl_dev_state *cxlds,
> return rc;
> }
>
> -int cxl_send_cmd(struct cxl_memdev *cxlmd, struct cxl_send_command __user *s)
> +int cxl_send_cmd(struct cxl_dev_state *cxlds, struct device *dev,
> + struct cxl_send_command __user *s)
> {
> - struct cxl_dev_state *cxlds = cxlmd->cxlds;
> - struct device *dev = &cxlmd->dev;
> struct cxl_send_command send;
> struct cxl_mbox_cmd mbox_cmd;
> int rc;
> diff --git a/drivers/cxl/core/memdev.c b/drivers/cxl/core/memdev.c
> index 20ce488a7754..62840a6da140 100644
> --- a/drivers/cxl/core/memdev.c
> +++ b/drivers/cxl/core/memdev.c
> @@ -269,11 +269,13 @@ static struct cxl_memdev *cxl_memdev_alloc(struct cxl_dev_state *cxlds,
> static long __cxl_memdev_ioctl(struct cxl_memdev *cxlmd, unsigned int cmd,
> unsigned long arg)
> {
> + struct cxl_dev_state *cxlds = cxlmd->cxlds;
> + struct device *dev = &cxlmd->dev;
> switch (cmd) {
> case CXL_MEM_QUERY_COMMANDS:
> return cxl_query_cmd(cxlmd, (void __user *)arg);
> case CXL_MEM_SEND_COMMAND:
> - return cxl_send_cmd(cxlmd, (void __user *)arg);
> + return cxl_send_cmd(cxlds, dev, (void __user *)arg);
> default:
> return -ENOTTY;
> }
> --
> 2.37.2
>
next prev parent reply other threads:[~2022-12-13 0:12 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-25 10:42 [RFC PATCH v2 0/4] CXL: Standalone switch CCI driver Jonathan Cameron
2022-10-25 10:42 ` [RFC PATCH v2 1/4] cxl/mbox: Use local cxl_device_state variable Jonathan Cameron
2022-11-04 23:25 ` Dave Jiang
2023-02-15 4:17 ` Ira Weiny
2022-10-25 10:42 ` [RFC PATCH v2 2/4] cxl/mbox: Change parameters to cxl_send_cmd() to not assume a cxl memory device Jonathan Cameron
2022-12-13 0:12 ` Dan Williams [this message]
2022-10-25 10:42 ` [RFC PATCH v2 3/4] PCI: Add PCI_CLASS_SERIAL_CXL_SWITCH_CCI class ID to pci_ids.h Jonathan Cameron
2022-10-25 10:42 ` [RFC PATCH v2 4/4] cxl/pci: Add support for stand alone CXL Switch mailbox CCI Jonathan Cameron
2022-12-13 1:13 ` Dan Williams
2023-08-04 10:46 ` Jonathan Cameron
2022-12-12 23:10 ` [RFC PATCH v2 0/4] CXL: Standalone switch CCI driver 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=6397c361826e2_b41e3294bf@dwillia2-xfh.jf.intel.com.notmuch \
--to=dan.j.williams@intel.com \
--cc=Jonathan.Cameron@huawei.com \
--cc=alison.schofield@intel.com \
--cc=bwidawsk@kernel.org \
--cc=ira.weiny@intel.com \
--cc=linux-cxl@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=viacheslav.dubeyko@bytedance.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