All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Williams <dan.j.williams@intel.com>
To: linux-cxl@vger.kernel.org
Cc: Ben Widawsky <ben.widawsky@intel.com>,
	Jonathan Cameron <Jonathan.Cameron@huawei.com>,
	Davidlohr Bueso <dave@stgolabs.net>
Subject: [PATCH v3 6/6] cxl/mem: Replace redundant debug message with a comment
Date: Fri, 08 Apr 2022 12:30:29 -0700	[thread overview]
Message-ID: <164944616743.454665.7055846627973202403.stgit@dwillia2-desk3.amr.corp.intel.com> (raw)
In-Reply-To: <164730736948.3806189.17828261054974867700.stgit@dwillia2-desk3.amr.corp.intel.com>

cxl_mem_probe() already emits a log message when HDM operation can not
be established. Delete the similar one in cxl_hdm_decode_init().

What is less obvious is why global_ctrl being enabled makes positive
values of info->ranges irrelevant, and the Linux behavior with respect
to the spec recommendation to mirror CXL Range registers with HDM
Decoder Base + Size registers.

Cc: Ben Widawsky <ben.widawsky@intel.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Davidlohr Bueso <dave@stgolabs.net>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
Changes since v2:
- Clarify that Linux does not maintain the spec recommended match
  between HDM decoders and CXL DVSEC range registers. (Ben and Jonathan)

 drivers/cxl/mem.c |   14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/cxl/mem.c b/drivers/cxl/mem.c
index 3baae1332760..43e73d259207 100644
--- a/drivers/cxl/mem.c
+++ b/drivers/cxl/mem.c
@@ -107,11 +107,17 @@ __mock bool cxl_hdm_decode_init(struct cxl_dev_state *cxlds)
 	global_ctrl = readl(crb + cmap->hdm_decoder.offset +
 			    CXL_HDM_DECODER_CTRL_OFFSET);
 	global_enable = global_ctrl & CXL_HDM_DECODER_ENABLE;
-	if (!global_enable && info->ranges) {
-		dev_dbg(cxlds->dev,
-			"DVSEC ranges already programmed and HDM decoders not enabled.\n");
+
+	/*
+	 * Per CXL 2.0 Section 8.1.3.8.3 and 8.1.3.8.4 DVSEC CXL Range 1 Base
+	 * [High,Low] when HDM operation is enabled the range register values
+	 * are ignored by the device, but the spec also recommends matching the
+	 * DVSEC Range 1,2 to HDM Decoder Range 0,1. So, non-zero info->ranges
+	 * are expected even though Linux does not require or maintain that
+	 * match.
+	 */
+	if (!global_enable && info->ranges)
 		goto out;
-	}
 
 	retval = true;
 


  parent reply	other threads:[~2022-04-08 19:30 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-15  1:22 [PATCH v2 0/6] cxl: Handle DVSEC range init failures Dan Williams
2022-03-15  1:22 ` [PATCH v2 1/6] cxl/mem: Drop DVSEC vs EFI Memory Map sanity check Dan Williams
2022-03-17 17:33   ` Ben Widawsky
2022-03-25 11:34   ` Jonathan Cameron
2022-03-15  1:22 ` [PATCH v2 2/6] cxl/pci: Add debug for DVSEC range init failures Dan Williams
2022-03-17 17:36   ` Ben Widawsky
2022-03-25 11:38   ` Jonathan Cameron
2022-03-15  1:22 ` [PATCH v2 3/6] cxl/mem: Make cxl_dvsec_range() init failure fatal Dan Williams
2022-03-16  2:00   ` Davidlohr Bueso
2022-03-16  2:14     ` Dan Williams
2022-03-17 17:49   ` Ben Widawsky
2022-03-25 11:39   ` Jonathan Cameron
2022-03-15  1:22 ` [PATCH v2 4/6] cxl/pci: Make cxl_dvsec_ranges() failure not fatal to cxl_pci Dan Williams
2022-03-17 17:52   ` Ben Widawsky
2022-03-17 18:20     ` Dan Williams
2022-03-17 18:29       ` Ben Widawsky
2022-03-17 18:30         ` Dan Williams
2022-03-25 11:47   ` Jonathan Cameron
2022-03-15  1:22 ` [PATCH v2 5/6] cxl/mem: Rename cxl_dvsec_decode_init() to cxl_hdm_decode_init() Dan Williams
2022-03-17 17:54   ` Ben Widawsky
2022-03-17 18:45     ` Dan Williams
2022-03-25 11:50   ` Jonathan Cameron
2022-03-15  1:22 ` [PATCH v2 6/6] cxl/mem: Replace redundant debug message with a comment Dan Williams
2022-03-25 11:54   ` Jonathan Cameron
2022-04-08 19:30   ` Dan Williams [this message]
2022-03-17  0:39 ` [PATCH v2 0/6] cxl: Handle DVSEC range init failures Davidlohr Bueso

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=164944616743.454665.7055846627973202403.stgit@dwillia2-desk3.amr.corp.intel.com \
    --to=dan.j.williams@intel.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=ben.widawsky@intel.com \
    --cc=dave@stgolabs.net \
    --cc=linux-cxl@vger.kernel.org \
    /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.