linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: ira.weiny@intel.com
Cc: Dan Williams <dan.j.williams@intel.com>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Jonathan Cameron <Jonathan.Cameron@huawei.com>,
	Davidlohr Bueso <dave@stgolabs.net>,
	Lukas Wunner <lukas@wunner.de>,
	Alison Schofield <alison.schofield@intel.com>,
	Vishal Verma <vishal.l.verma@intel.com>,
	Dave Jiang <dave.jiang@intel.com>,
	Ben Widawsky <bwidawsk@kernel.org>,
	linux-kernel@vger.kernel.org, linux-cxl@vger.kernel.org,
	linux-pci@vger.kernel.org
Subject: Re: [PATCH V16 4/6] cxl/pci: Create PCI DOE mailbox's for memory devices
Date: Tue, 19 Jul 2022 17:16:37 -0500	[thread overview]
Message-ID: <20220719221637.GA1585132@bhelgaas> (raw)
In-Reply-To: <20220719205249.566684-5-ira.weiny@intel.com>

In subject, s/mailbox's/mailboxes/

On Tue, Jul 19, 2022 at 01:52:47PM -0700, ira.weiny@intel.com wrote:
> From: Ira Weiny <ira.weiny@intel.com>
> 
> DOE mailbox objects will be needed for various mailbox communications
> with each memory device.
> 
> Iterate each DOE mailbox capability and create PCI DOE mailbox objects
> as found.
> 
> It is not anticipated that this is the final resting place for the
> iteration of the DOE devices.  The support of switch ports will drive
> this code into the PCIe side.  In this imagined architecture the CXL
> port driver would then query into the PCI device for the DOE mailbox
> array.
> 
> For now creating the mailboxes in the CXL port is good enough for the
> endpoints.  Later PCIe ports will need to support this to support switch
> ports more generically.

> +static void devm_cxl_pci_create_doe(struct cxl_dev_state *cxlds)
> +{
> +	struct device *dev = cxlds->dev;
> +	struct pci_dev *pdev = to_pci_dev(dev);
> +	u16 off = 0;
> +
> +	xa_init(&cxlds->doe_mbs);
> +	if (devm_add_action(&pdev->dev, cxl_pci_destroy_doe, &cxlds->doe_mbs)) {
> +		dev_err(dev, "Failed to create XArray for DOE's\n");

s/DOE's/DOEs/

> +		return;
> +	}
> +
> +	/*
> +	 * Mailbox creation is best effort.  Higher layers must determine if
> +	 * the lack of a mailbox for their protocol is a device failure or not.
> +	 */
> +	pci_doe_for_each_off(pdev, off) {
> +		struct pci_doe_mb *doe_mb;
> +
> +		doe_mb = pcim_doe_create_mb(pdev, off);
> +		if (IS_ERR(doe_mb)) {
> +			dev_err(dev, "Failed to create MB object for MB @ %x\n",

Maybe "%#x" to avoid ambiguity?  Also below.

> +				off);
> +			continue;
> +		}
> +
> +		if (xa_insert(&cxlds->doe_mbs, off, doe_mb, GFP_KERNEL)) {
> +			dev_err(dev, "xa_insert failed to insert MB @ %x\n",
> +				off);
> +			continue;
> +		}
> +
> +		dev_dbg(dev, "Created DOE mailbox @%x\n", off);
> +	}
> +}
> +
>  static int cxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
>  {
>  	struct cxl_register_map map;
> @@ -434,6 +476,8 @@ static int cxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
>  
>  	cxlds->component_reg_phys = cxl_regmap_to_base(pdev, &map);
>  
> +	devm_cxl_pci_create_doe(cxlds);
> +
>  	rc = cxl_pci_setup_mailbox(cxlds);
>  	if (rc)
>  		return rc;
> -- 
> 2.35.3
> 

  reply	other threads:[~2022-07-19 22:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-19 20:52 [PATCH V16 0/6] CXL: Read CDAT ira.weiny
2022-07-19 20:52 ` [PATCH V16 1/6] PCI: Add vendor ID for the PCI SIG ira.weiny
2022-07-19 20:52 ` [PATCH V16 2/6] PCI: Replace magic constant for PCI Sig Vendor ID ira.weiny
2022-07-19 20:52 ` [PATCH V16 3/6] PCI/DOE: Add DOE mailbox support functions ira.weiny
2022-08-15  2:17   ` Li, Ming
2022-08-15  9:50     ` Jonathan Cameron
2022-08-15 22:42       ` Dan Williams
2022-10-25 11:03   ` Jonathan Cameron
2022-07-19 20:52 ` [PATCH V16 4/6] cxl/pci: Create PCI DOE mailbox's for memory devices ira.weiny
2022-07-19 22:16   ` Bjorn Helgaas [this message]
2022-07-19 20:52 ` [PATCH V16 5/6] driver-core: Introduce BIN_ATTR_ADMIN_{RO,RW} ira.weiny
2022-07-19 20:52 ` [PATCH V16 6/6] cxl/port: Read CDAT table ira.weiny
2022-07-19 22:57 ` [PATCH V16 0/6] CXL: Read CDAT 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=20220719221637.GA1585132@bhelgaas \
    --to=helgaas@kernel.org \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=alison.schofield@intel.com \
    --cc=bhelgaas@google.com \
    --cc=bwidawsk@kernel.org \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=dave@stgolabs.net \
    --cc=ira.weiny@intel.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lukas@wunner.de \
    --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;
as well as URLs for NNTP newsgroup(s).