cxl/mem: Replace redundant debug message with a comment
authorDan Williams <dan.j.williams@intel.com>
Fri, 8 Apr 2022 19:30:29 +0000 (12:30 -0700)
committerDan Williams <dan.j.williams@intel.com>
Wed, 13 Apr 2022 02:11:58 +0000 (19:11 -0700)
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>
Link: https://lore.kernel.org/r/164944616743.454665.7055846627973202403.stgit@dwillia2-desk3.amr.corp.intel.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/cxl/mem.c

index 3baae1332760e553bb273fa7e432dff5a4b6fd66..43e73d259207c9ef06413f8f42e3b41080fd66d7 100644 (file)
@@ -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;