linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
To: Dan Williams <dan.j.williams@intel.com>
Cc: <linux-cxl@vger.kernel.org>, <linux-pci@vger.kernel.org>,
	<nvdimm@lists.linux.dev>, <ben.widawsky@intel.com>
Subject: Re: [PATCH 1/2] cxl/core/port: Fix / relax decoder target enumeration
Date: Tue, 1 Feb 2022 12:55:45 +0000	[thread overview]
Message-ID: <20220201125545.00003d48@Huawei.com> (raw)
In-Reply-To: <164317464406.3438644.6609329492458460242.stgit@dwillia2-desk3.amr.corp.intel.com>

On Tue, 25 Jan 2022 21:24:04 -0800
Dan Williams <dan.j.williams@intel.com> wrote:

> If the decoder is not presently active the target_list may not be
> accurate. Perform a best effort mapping and assume that it will be fixed
> up when the decoder is enabled.
> 
> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Make sense.

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

> ---
>  drivers/cxl/acpi.c      |    2 +-
>  drivers/cxl/core/port.c |    5 ++++-
>  2 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/cxl/acpi.c b/drivers/cxl/acpi.c
> index df6691d0a6d0..f64d98bfcb3b 100644
> --- a/drivers/cxl/acpi.c
> +++ b/drivers/cxl/acpi.c
> @@ -15,7 +15,7 @@
>  
>  static unsigned long cfmws_to_decoder_flags(int restrictions)
>  {
> -	unsigned long flags = 0;
> +	unsigned long flags = CXL_DECODER_F_ENABLE;
>  
>  	if (restrictions & ACPI_CEDT_CFMWS_RESTRICT_TYPE2)
>  		flags |= CXL_DECODER_F_TYPE2;
> diff --git a/drivers/cxl/core/port.c b/drivers/cxl/core/port.c
> index 224a4853a33e..e75e0d4fb894 100644
> --- a/drivers/cxl/core/port.c
> +++ b/drivers/cxl/core/port.c
> @@ -1263,8 +1263,11 @@ int cxl_decoder_add_locked(struct cxl_decoder *cxld, int *target_map)
>  	port = to_cxl_port(cxld->dev.parent);
>  	if (!is_endpoint_decoder(dev)) {
>  		rc = decoder_populate_targets(cxld, port, target_map);
> -		if (rc)
> +		if (rc && (cxld->flags & CXL_DECODER_F_ENABLE)) {
> +			dev_err(&port->dev,
> +				"Failed to populate active decoder targets\n");
>  			return rc;
> +		}
>  	}
>  
>  	rc = dev_set_name(dev, "decoder%d.%d", port->id, cxld->id);
> 


  reply	other threads:[~2022-02-01 12:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-26  5:23 [PATCH 0/2] cxl/port: Robustness fixes for decoder enumeration Dan Williams
2022-01-26  5:24 ` [PATCH 1/2] cxl/core/port: Fix / relax decoder target enumeration Dan Williams
2022-02-01 12:55   ` Jonathan Cameron [this message]
2022-01-26  5:24 ` [PATCH 2/2] cxl/core/port: Handle invalid decoders Dan Williams
2022-02-01 12:59   ` Jonathan Cameron

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=20220201125545.00003d48@Huawei.com \
    --to=jonathan.cameron@huawei.com \
    --cc=ben.widawsky@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=nvdimm@lists.linux.dev \
    /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).