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>,
	Dan Williams <dan.j.williams@intel.com>, <linuxarm@huawei.com>,
	Alison Schofield <alison.schofield@intel.com>,
	"Ira Weiny" <ira.weiny@intel.com>,
	Dave Jiang <dave.jiang@intel.com>,
	"Shesha Bhushan Sreenivasamurthy" <sheshas@marvell.com>,
	Gregory Price <gregory.price@memverge.com>,
	Viacheslav Dubeyko <slava@dubeyko.com>, <fan.ni@samsung.com>,
	<a.manzanares@samsung.com>
Subject: Re: [RFC PATCH v4 4/4] cxl/pci: Add support for stand alone CXL Switch mailbox CCI
Date: Thu, 27 Jul 2023 10:49:16 +0100	[thread overview]
Message-ID: <20230727104916.00007a21@Huawei.com> (raw)
In-Reply-To: <r7djcwxcuzsvqcwbct3iiyljdhpsobvgjwuxjmlew3cuo52lcg@xkrkc4srqzju>

On Wed, 26 Jul 2023 13:00:31 -0700
Davidlohr Bueso <dave@stgolabs.net> wrote:

> On Wed, 19 Jul 2023, Jonathan Cameron wrote:
> 
> >+static int cxl_swmbcci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
> >+{
> >+	struct cxl_register_map map;
> >+	struct cxl_swdev *cxlswd;
> >+	int rc;
> >+
> >+	rc = pcim_enable_device(pdev);
> >+	if (rc)
> >+		return rc;
> >+
> >+	cxlswd = cxl_swdev_alloc(&pdev->dev);
> >+	if (IS_ERR(cxlswd))
> >+		return PTR_ERR(cxlswd);
> >+
> >+	mutex_init(&cxlswd->mbox.mbox_mutex);
> >+	rc = cxl_find_regblock(pdev, CXL_REGLOC_RBI_MEMDEV, &map);
> >+	if (rc)
> >+		return rc;
> >+	rc = cxl_setup_regs(&map);
> >+	if (rc)
> >+		return rc;
> >+
> >+	rc = cxl_map_device_regs(&map, &cxlswd->cxlds.regs.device_regs);
> >+	if (rc)
> >+		return rc;
> >+
> >+	rc = cxl_map_mbox_regs(&map, &cxlswd->mbox.mbox);
> >+	if (rc)
> >+		return rc;
> >+
> >+	cxlswd->mbox.status = cxlswd->cxlds.regs.status;
> >+	cxlswd->mbox.dev = &pdev->dev;
> >+
> >+	rc = cxl_swmbcci_setup_mailbox(&cxlswd->mbox);
> >+	if (rc)
> >+		return rc;
> >+
> >+
> >+	pci_set_drvdata(pdev, cxlswd);
> >+
> >+	rc = cxl_enumerate_cmds(&cxlswd->mbox);  
> 
> Making the whole mbox more generically available makes me wonder if
> we want to start using Get Supported Logs Sub-List instead of the current
> gsl? The spec is pretty explicit about this:
> 
> ""
> It is strongly recommended that the Get Supported Logs Sub-List (see
> Section 8.2.9.5.6) is supported by Components and used by software instead of Get
> Supported Logs so that requestors may control the output payload size, as needed.
> Type 3 Devices that implement support for the Get Supported Logs opcode on an
> MCTP-based CCI shall also support the Get Supported Logs Sub-List opcode.
> ""

Agreed - it would be good to make that move on any devices that support
the command.  Patches welcome :)


Jonathan

> 
> Thanks,
> Davidlohr
> 
> >+	if (rc)
> >+		goto error_put_device;
> >+
> >+	rc = cdev_device_add(&cxlswd->cdev, &cxlswd->dev);
> >+	if (rc)
> >+		goto error_put_device;
> >+
> >+	return 0;
> >+
> >+error_put_device:
> >+	cxl_swdev_shutdown(cxlswd);
> >+	put_device(&cxlswd->dev);
> >+	return rc;
> >+}  


      reply	other threads:[~2023-07-27  9:50 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-19  9:19 [RFC PATCH v4 0/4] CXL: Standalone switch CCI driver Jonathan Cameron
2023-07-19  9:19 ` [RFC PATCH v4 1/4] cxl: mbox: Preparatory move of functions to core/mbox.c Jonathan Cameron
2023-07-19  9:19 ` [RFC PATCH v4 2/4] cxl: mbox: Factor out the mbox specific data for reuse in switch cci Jonathan Cameron
2023-07-21 16:48   ` Davidlohr Bueso
2023-08-03 16:47     ` Jonathan Cameron
2023-08-03 17:12       ` Jonathan Cameron
2023-08-04  9:38     ` Jonathan Cameron
2023-07-19  9:19 ` [RFC PATCH v4 3/4] PCI: Add PCI_CLASS_SERIAL_CXL_SWITCH_CCI class ID to pci_ids.h Jonathan Cameron
2023-07-19  9:19 ` [RFC PATCH v4 4/4] cxl/pci: Add support for stand alone CXL Switch mailbox CCI Jonathan Cameron
2023-07-26 16:29   ` Davidlohr Bueso
2023-07-26 20:00   ` Davidlohr Bueso
2023-07-27  9:49     ` Jonathan Cameron [this message]

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=20230727104916.00007a21@Huawei.com \
    --to=jonathan.cameron@huawei.com \
    --cc=a.manzanares@samsung.com \
    --cc=alison.schofield@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=dave@stgolabs.net \
    --cc=fan.ni@samsung.com \
    --cc=gregory.price@memverge.com \
    --cc=ira.weiny@intel.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=sheshas@marvell.com \
    --cc=slava@dubeyko.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.