Skip to contentSkip to conversation

Fixes for hdm docoder initialization from DVSEC ranges

PATCH Superseded Yanfei Xu 2 participants 14 messages Aug 13, 2024 – Aug 28, 2024 CXL

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Yanfei Xu

author
#0 lore raw

v3 cover Fixes for hdm docoder initialization from DVSEC ranges

The first and third patch are intended to fix potential issues regarding to retrieve and record DVSEC ranges. The second and fourth are cleanup.

v2->v3:
- improved the commit message of patch1 to indicate potential impact of the change. (Dan)
- Dropped un-appropriate "Fixes" tag. (Dan)
- Dropped the patch2 which is a code movement in original patchset.
- Separated the original patch3 into cleanup one and logic change one which are corresponding to patch2 and patch3 in current patchset. (Dan)

v2:https://lore.kernel.org/linux-cxl/[email protected]/T/#t

Yanfei Xu (4):
cxl/pci: Fix to record only non-zero ranges
cxl/pci: Remove duplicated implementation of waiting for
memory_info_valid
cxl/pci: Check Mem_info_valid bit for each applicable DVSEC cxl/pci: simplify the check of mem_enabled in cxl_hdm_decode_init()

 drivers/cxl/core/pci.c        | 74 +++++++++--------------------------
 drivers/cxl/cxl.h             |  2 +-
 drivers/cxl/port.c            |  2 +-
 tools/testing/cxl/test/mock.c |  4 +-
 4 files changed, 23 insertions(+), 59 deletions(-)
Signature · 1 line
2.39.2
author
#1 lore raw

PATCH v3 1/4 cxl/pci: Fix to record only non-zero ranges

The function cxl_dvsec_rr_decode() retrieves and records DVSEC ranges into info->dvsec_range[], regardless of whether it is non-zero range, and the variable info->ranges indicates the number of non-zero ranges. However, in cxl_hdm_decode_init(), the validation for info->dvsec_range[] occurs in a for loop that iterates based on info->ranges. It may result in zero range to be validated but non-zero range not be validated, in turn, the number of allowed ranges is to be
0. Address it by only record non-zero ranges.

This fix is not urgent as it requires a configuration that zeroes out the first dvsec range while populating the second. This has not been observed, but it is theoretically possible. If this gets picked up for -stable, no harm done, but there is no urgency to backport.

Fixes 560f78559006 ("cxl/pci: Retrieve CXL DVSEC memory info")
---
 drivers/cxl/core/pci.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
drivers/cxl/core/pci.c +1 -7
index a663e7566c48..2d69340134da 100644
@@ -390,10 +390,6 @@ int cxl_dvsec_rr_decode(struct device *dev, int d,
 
 		size |= temp & CXL_DVSEC_MEM_SIZE_LOW_MASK;
 		if (!size) {
-			info->dvsec_range[i] = (struct range) {
-				.start = 0,
-				.end = CXL_RESOURCE_NONE,
-			};
 			continue;
 		}
 
@@ -411,12 +407,10 @@ int cxl_dvsec_rr_decode(struct device *dev, int d,
 
 		base |= temp & CXL_DVSEC_MEM_BASE_LOW_MASK;
 
-		info->dvsec_range[i] = (struct range) {
+		info->dvsec_range[ranges++] = (struct range) {
 			.start = base,
 			.end = base + size - 1
 		};
-
-		ranges++;
 	}
 
 	info->ranges = ranges;
Signature · 1 line
2.39.2
Reviewed-by on v3 1/4
#2 lore raw

Re: [v3 1/4] cxl/pci: Fix to record only non-zero ranges

Quoted 9 lines · On Tue, 13 Aug 2024 19:05:29 +0800 Yanfei Xu <[email protected]> wrote:

The function cxl_dvsec_rr_decode() retrieves and records DVSEC ranges into info->dvsec_range[], regardless of whether it is non-zero range, and the variable info->ranges indicates the number of non-zero ranges. However, in cxl_hdm_decode_init(), the validation for info->dvsec_range[] occurs in a for loop that iterates based on info->ranges. It may result in zero range to be validated but non-zero range not be validated, in turn, the number of allowed ranges is to be
0. Address it by only record non-zero ranges.

Quoted 7 lines

This fix is not urgent as it requires a configuration that zeroes out the first dvsec range while populating the second. This has not been observed, but it is theoretically possible. If this gets picked up for -stable, no harm done, but there is no urgency to backport.

Fixes 560f78559006 ("cxl/pci: Retrieve CXL DVSEC memory info")

LGTM

author
#3 lore raw

PATCH v3 2/4 cxl/pci: Remove duplicated implementation of waiting for memory_info_valid

In reply to Yanfei Xu

commit ce17ad0d5498 ("cxl: Wait Memory_Info_Valid before access memory related info") added another implementation of waiting for memory_info_valid without realizing it duplicated wait_for_valid()

---
 drivers/cxl/core/pci.c        | 41 +++++------------------------------
 drivers/cxl/cxl.h             |  2 +-
 drivers/cxl/port.c            |  2 +-
 tools/testing/cxl/test/mock.c |  4 ++--
 4 files changed, 9 insertions(+), 40 deletions(-)
drivers/cxl/core/pci.c +5 -36
index 2d69340134da..38c567727dbb 100644
@@ -211,37 +211,6 @@ int cxl_await_media_ready(struct cxl_dev_state *cxlds)
 }
 EXPORT_SYMBOL_NS_GPL(cxl_await_media_ready, CXL);
 
-static int wait_for_valid(struct pci_dev *pdev, int d)
-{
-	u32 val;
-	int rc;
-
-	/*
-	 * Memory_Info_Valid: When set, indicates that the CXL Range 1 Size high
-	 * and Size Low registers are valid. Must be set within 1 second of
-	 * deassertion of reset to CXL device. Likely it is already set by the
-	 * time this runs, but otherwise give a 1.5 second timeout in case of
-	 * clock skew.
-	 */
-	rc = pci_read_config_dword(pdev, d + CXL_DVSEC_RANGE_SIZE_LOW(0), &val);
-	if (rc)
-		return rc;
-
-	if (val & CXL_DVSEC_MEM_INFO_VALID)
-		return 0;
-
-	msleep(1500);
-
-	rc = pci_read_config_dword(pdev, d + CXL_DVSEC_RANGE_SIZE_LOW(0), &val);
-	if (rc)
-		return rc;
-
-	if (val & CXL_DVSEC_MEM_INFO_VALID)
-		return 0;
-
-	return -ETIMEDOUT;
-}
-
 static int cxl_set_mem_enable(struct cxl_dev_state *cxlds, u16 val)
 {
 	struct pci_dev *pdev = to_pci_dev(cxlds->dev);
@@ -322,11 +291,13 @@ static int devm_cxl_enable_hdm(struct device *host, struct cxl_hdm *cxlhdm)
 	return devm_add_action_or_reset(host, disable_hdm, cxlhdm);
 }
 
-int cxl_dvsec_rr_decode(struct device *dev, int d,
+int cxl_dvsec_rr_decode(struct device *dev, struct cxl_port *port,
 			struct cxl_endpoint_dvsec_info *info)
 {
 	struct pci_dev *pdev = to_pci_dev(dev);
+	struct cxl_dev_state *cxlds = pci_get_drvdata(pdev);
 	int hdm_count, rc, i, ranges = 0;
+	int d = cxlds->cxl_dvsec;
 	u16 cap, ctrl;
 
 	if (!d) {
@@ -353,11 +324,9 @@ int cxl_dvsec_rr_decode(struct device *dev, int d,
 	if (!hdm_count || hdm_count > 2)
 		return -EINVAL;
 
-	rc = wait_for_valid(pdev, d);
-	if (rc) {
-		dev_dbg(dev, "Failure awaiting MEM_INFO_VALID (%d)\n", rc);
+	rc = cxl_dvsec_mem_range_valid(cxlds, 0);
+	if (rc)
 		return rc;
-	}
 
 	/*
 	 * The current DVSEC values are moot if the memory capability is
drivers/cxl/cxl.h +1 -1
index 9afb407d438f..e2e277463794 100644
@@ -809,7 +809,7 @@ struct cxl_hdm *devm_cxl_setup_hdm(struct cxl_port *port,
 int devm_cxl_enumerate_decoders(struct cxl_hdm *cxlhdm,
 				struct cxl_endpoint_dvsec_info *info);
 int devm_cxl_add_passthrough_decoder(struct cxl_port *port);
-int cxl_dvsec_rr_decode(struct device *dev, int dvsec,
+int cxl_dvsec_rr_decode(struct device *dev, struct cxl_port *port,
 			struct cxl_endpoint_dvsec_info *info);
 
 bool is_cxl_region(struct device *dev);
drivers/cxl/port.c +1 -1
index d7d5d982ce69..861dde65768f 100644
@@ -98,7 +98,7 @@ static int cxl_endpoint_port_probe(struct cxl_port *port)
 	struct cxl_port *root;
 	int rc;
 
-	rc = cxl_dvsec_rr_decode(cxlds->dev, cxlds->cxl_dvsec, &info);
+	rc = cxl_dvsec_rr_decode(cxlds->dev, port, &info);
 	if (rc < 0)
 		return rc;
 
tools/testing/cxl/test/mock.c +2 -2
index 6f737941dc0e..79fdfaad49e8 100644
@@ -228,7 +228,7 @@ int __wrap_cxl_hdm_decode_init(struct cxl_dev_state *cxlds,
 }
 EXPORT_SYMBOL_NS_GPL(__wrap_cxl_hdm_decode_init, CXL);
 
-int __wrap_cxl_dvsec_rr_decode(struct device *dev, int dvsec,
+int __wrap_cxl_dvsec_rr_decode(struct device *dev, struct cxl_port *port,
 			       struct cxl_endpoint_dvsec_info *info)
 {
 	int rc = 0, index;
@@ -237,7 +237,7 @@ int __wrap_cxl_dvsec_rr_decode(struct device *dev, int dvsec,
 	if (ops && ops->is_mock_dev(dev))
 		rc = 0;
 	else
-		rc = cxl_dvsec_rr_decode(dev, dvsec, info);
+		rc = cxl_dvsec_rr_decode(dev, port, info);
 	put_cxl_mock_ops(index);
 
 	return rc;
Signature · 1 line
2.39.2
Reviewed-by on v3 2/4
#4 lore raw

Re: [v3 2/4] cxl/pci: Remove duplicated implementation of waiting for memory_info_valid

Quoted 3 lines · On Tue, 13 Aug 2024 19:05:30 +0800 Yanfei Xu <[email protected]> wrote:

commit ce17ad0d5498 ("cxl: Wait Memory_Info_Valid before access memory related info") added another implementation of waiting for memory_info_valid without realizing it duplicated wait_for_valid()

Mention here the name of the other duplicate function

Also good to call out why you picked this duplicate to remove over the other one.

Otherwise looks good to me.
So with that info added.

Quoted 49 lines
---
 drivers/cxl/core/pci.c        | 41 +++++------------------------------
 drivers/cxl/cxl.h             |  2 +-
 drivers/cxl/port.c            |  2 +-
 tools/testing/cxl/test/mock.c |  4 ++--
 4 files changed, 9 insertions(+), 40 deletions(-)
drivers/cxl/core/pci.c +0 -31
index 2d69340134da..38c567727dbb 100644
@@ -211,37 +211,6 @@ int cxl_await_media_ready(struct cxl_dev_state *cxlds)
 }
 EXPORT_SYMBOL_NS_GPL(cxl_await_media_ready, CXL);
 
-static int wait_for_valid(struct pci_dev *pdev, int d)
-{
-	u32 val;
-	int rc;
-
-	/*
-	 * Memory_Info_Valid: When set, indicates that the CXL Range 1 Size high
-	 * and Size Low registers are valid. Must be set within 1 second of
-	 * deassertion of reset to CXL device. Likely it is already set by the
-	 * time this runs, but otherwise give a 1.5 second timeout in case of
-	 * clock skew.
-	 */
-	rc = pci_read_config_dword(pdev, d + CXL_DVSEC_RANGE_SIZE_LOW(0), &val);
-	if (rc)
-		return rc;
-
-	if (val & CXL_DVSEC_MEM_INFO_VALID)
-		return 0;
-
-	msleep(1500);
-
-	rc = pci_read_config_dword(pdev, d + CXL_DVSEC_RANGE_SIZE_LOW(0), &val);
-	if (rc)
-		return rc;
-
-	if (val & CXL_DVSEC_MEM_INFO_VALID)
-		return 0;
-
-	return -ETIMEDOUT;
-}
-
author
#5 lore raw

Re: [v3 2/4] cxl/pci: Remove duplicated implementation of waiting for memory_info_valid

Quoted 6 lines · Jonathan Cameron
Quoted 3 lines · On Tue, 13 Aug 2024 19:05:30 +0800 Yanfei Xu <[email protected]> wrote:

commit ce17ad0d5498 ("cxl: Wait Memory_Info_Valid before access memory related info") added another implementation of waiting for memory_info_valid without realizing it duplicated wait_for_valid()

Quoted 8 lines

Mention here the name of the other duplicate function

Also good to call out why you picked this duplicate to remove over the other one.

Otherwise looks good to me.
So with that info added.

Thanks! will improve it in next version.

Quoted 52 lines
Quoted 50 lines
---
  drivers/cxl/core/pci.c        | 41 +++++------------------------------
  drivers/cxl/cxl.h             |  2 +-
  drivers/cxl/port.c            |  2 +-
  tools/testing/cxl/test/mock.c |  4 ++--
  4 files changed, 9 insertions(+), 40 deletions(-)
drivers/cxl/core/pci.c +0 -31
index 2d69340134da..38c567727dbb 100644
@@ -211,37 +211,6 @@ int cxl_await_media_ready(struct cxl_dev_state *cxlds)
  }
  EXPORT_SYMBOL_NS_GPL(cxl_await_media_ready, CXL);
 
-static int wait_for_valid(struct pci_dev *pdev, int d)
-{
-	u32 val;
-	int rc;
-
-	/*
-	 * Memory_Info_Valid: When set, indicates that the CXL Range 1 Size high
-	 * and Size Low registers are valid. Must be set within 1 second of
-	 * deassertion of reset to CXL device. Likely it is already set by the
-	 * time this runs, but otherwise give a 1.5 second timeout in case of
-	 * clock skew.
-	 */
-	rc = pci_read_config_dword(pdev, d + CXL_DVSEC_RANGE_SIZE_LOW(0), &val);
-	if (rc)
-		return rc;
-
-	if (val & CXL_DVSEC_MEM_INFO_VALID)
-		return 0;
-
-	msleep(1500);
-
-	rc = pci_read_config_dword(pdev, d + CXL_DVSEC_RANGE_SIZE_LOW(0), &val);
-	if (rc)
-		return rc;
-
-	if (val & CXL_DVSEC_MEM_INFO_VALID)
-		return 0;
-
-	return -ETIMEDOUT;
-}
-
author
#6 lore raw

PATCH v3 3/4 cxl/pci: Check Mem_info_valid bit for each applicable DVSEC

In reply to Yanfei Xu

The right way is to checking Mem_info_valid bit for each applicable DVSEC range against HDM_COUNT, not only for the DVSEC range 1, hence let's move the check into the "for loop" of handling each DVSEC range.

---
 drivers/cxl/core/pci.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/cxl/core/pci.c +4 -4
index 38c567727dbb..519989ada48e 100644
@@ -324,10 +324,6 @@ int cxl_dvsec_rr_decode(struct device *dev, struct cxl_port *port,
 	if (!hdm_count || hdm_count > 2)
 		return -EINVAL;
 
-	rc = cxl_dvsec_mem_range_valid(cxlds, 0);
-	if (rc)
-		return rc;
-
 	/*
 	 * The current DVSEC values are moot if the memory capability is
 	 * disabled, and they will remain moot after the HDM Decoder
@@ -345,6 +341,10 @@ int cxl_dvsec_rr_decode(struct device *dev, struct cxl_port *port,
 		u64 base, size;
 		u32 temp;
 
+		rc = cxl_dvsec_mem_range_valid(cxlds, i);
+		if (rc)
+			return rc;
+
 		rc = pci_read_config_dword(
 			pdev, d + CXL_DVSEC_RANGE_SIZE_HIGH(i), &temp);
 		if (rc)
Signature · 1 line
2.39.2
Reviewed-by on v3 3/4
#7 lore raw

Re: [v3 3/4] cxl/pci: Check Mem_info_valid bit for each applicable DVSEC

Quoted 3 lines · On Tue, 13 Aug 2024 19:05:31 +0800 Yanfei Xu <[email protected]> wrote:

The right way is to checking Mem_info_valid bit for each applicable DVSEC range against HDM_COUNT, not only for the DVSEC range 1, hence let's move the check into the "for loop" of handling each DVSEC range.

Say why it's the 'right' way. I agree it probably is, but more
detail in this patch description would be good.
I assume it's as simple as
"In theory a device might set the mem_info_valid bit for a first range
after it is ready but before as second range has reached that state."

If so looks fine to me and with that additional detail,

Quoted 32 lines
---
 drivers/cxl/core/pci.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/cxl/core/pci.c +4 -4
index 38c567727dbb..519989ada48e 100644
@@ -324,10 +324,6 @@ int cxl_dvsec_rr_decode(struct device *dev, struct cxl_port *port,
 	if (!hdm_count || hdm_count > 2)
 		return -EINVAL;
 
-	rc = cxl_dvsec_mem_range_valid(cxlds, 0);
-	if (rc)
-		return rc;
-
 	/*
 	 * The current DVSEC values are moot if the memory capability is
 	 * disabled, and they will remain moot after the HDM Decoder
@@ -345,6 +341,10 @@ int cxl_dvsec_rr_decode(struct device *dev, struct cxl_port *port,
 		u64 base, size;
 		u32 temp;
 
+		rc = cxl_dvsec_mem_range_valid(cxlds, i);
+		if (rc)
+			return rc;
+
 		rc = pci_read_config_dword(
 			pdev, d + CXL_DVSEC_RANGE_SIZE_HIGH(i), &temp);
 		if (rc)
author
#8 lore raw

Re: [v3 3/4] cxl/pci: Check Mem_info_valid bit for each applicable DVSEC

Quoted 6 lines · Jonathan Cameron
Quoted 3 lines · On Tue, 13 Aug 2024 19:05:31 +0800 Yanfei Xu <[email protected]> wrote:

The right way is to checking Mem_info_valid bit for each applicable DVSEC range against HDM_COUNT, not only for the DVSEC range 1, hence let's move the check into the "for loop" of handling each DVSEC range.

Quoted 8 lines

Say why it's the 'right' way. I agree it probably is, but more
detail in this patch description would be good.
I assume it's as simple as
"In theory a device might set the mem_info_valid bit for a first range
after it is ready but before as second range has reached that state."

If so looks fine to me and with that additional detail,

Make sense, will do in v4. Thanks for your review!

Quoted 36 lines
Quoted 34 lines
---
  drivers/cxl/core/pci.c | 8 ++++----
  1 file changed, 4 insertions(+), 4 deletions(-)
drivers/cxl/core/pci.c +4 -4
index 38c567727dbb..519989ada48e 100644
@@ -324,10 +324,6 @@ int cxl_dvsec_rr_decode(struct device *dev, struct cxl_port *port,
  	if (!hdm_count || hdm_count > 2)
  		return -EINVAL;
 
-	rc = cxl_dvsec_mem_range_valid(cxlds, 0);
-	if (rc)
-		return rc;
-
  	/*
  	 * The current DVSEC values are moot if the memory capability is
  	 * disabled, and they will remain moot after the HDM Decoder
@@ -345,6 +341,10 @@ int cxl_dvsec_rr_decode(struct device *dev, struct cxl_port *port,
  		u64 base, size;
  		u32 temp;
 
+		rc = cxl_dvsec_mem_range_valid(cxlds, i);
+		if (rc)
+			return rc;
+
  		rc = pci_read_config_dword(
  			pdev, d + CXL_DVSEC_RANGE_SIZE_HIGH(i), &temp);
  		if (rc)
author
#9 lore raw

PATCH v3 4/4 cxl/pci: simplify the check of mem_enabled in cxl_hdm_decode_init()

In reply to Yanfei Xu

Cases can be divided into two categories which are DVSEC range enabled and not enabled when HDM decoders exist but is not enabled. To avoid checking info->mem_enabled, which indicates the enablement of DVSEC range, every time, we can check !info->mem_enabled once in advance. This simplification can make the code clearer.

No functional change intended.

---
 drivers/cxl/core/pci.c | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)
drivers/cxl/core/pci.c +11 -10
index 519989ada48e..be00266c8907 100644
@@ -426,7 +426,15 @@ int cxl_hdm_decode_init(struct cxl_dev_state *cxlds, struct cxl_hdm *cxlhdm,
 		return -ENODEV;
 	}
 
-	for (i = 0, allowed = 0; info->mem_enabled && i < info->ranges; i++) {
+	if (!info->mem_enabled) {
+		rc = devm_cxl_enable_hdm(&port->dev, cxlhdm);
+		if (rc)
+			return rc;
+
+		return devm_cxl_enable_mem(&port->dev, cxlds);
+	}
+
+	for (i = 0, allowed = 0; i < info->ranges; i++) {
 		struct device *cxld_dev;
 
 		cxld_dev = device_find_child(&root->dev, &info->dvsec_range[i],
@@ -440,7 +448,7 @@ int cxl_hdm_decode_init(struct cxl_dev_state *cxlds, struct cxl_hdm *cxlhdm,
 		allowed++;
 	}
 
-	if (!allowed && info->mem_enabled) {
+	if (!allowed) {
 		dev_err(dev, "Range register decodes outside platform defined CXL ranges.\n");
 		return -ENXIO;
 	}
@@ -454,14 +462,7 @@ int cxl_hdm_decode_init(struct cxl_dev_state *cxlds, struct cxl_hdm *cxlhdm,
 	 * match. If at least one DVSEC range is enabled and allowed, skip HDM
 	 * Decoder Capability Enable.
 	 */
-	if (info->mem_enabled)
-		return 0;
-
-	rc = devm_cxl_enable_hdm(&port->dev, cxlhdm);
-	if (rc)
-		return rc;
-
-	return devm_cxl_enable_mem(&port->dev, cxlds);
+	return 0;
 }
 EXPORT_SYMBOL_NS_GPL(cxl_hdm_decode_init, CXL);
 
Signature · 1 line
2.39.2
Reviewed-by on v3 4/4
#10 lore raw

Re: [v3 4/4] cxl/pci: simplify the check of mem_enabled in cxl_hdm_decode_init()

Quoted 9 lines · On Tue, 13 Aug 2024 19:05:32 +0800 Yanfei Xu <[email protected]> wrote:

Cases can be divided into two categories which are DVSEC range enabled and not enabled when HDM decoders exist but is not enabled. To avoid checking info->mem_enabled, which indicates the enablement of DVSEC range, every time, we can check !info->mem_enabled once in advance. This simplification can make the code clearer.

No functional change intended.

LGTM as definitely simpler if we handled the !mem_enabled case first.

author
#11 lore raw
In reply to Yanfei Xu

gentle ping

Quoted 26 lines · Yanfei Xu

The first and third patch are intended to fix potential issues regarding to retrieve and record DVSEC ranges. The second and fourth are cleanup.

v2->v3:
- improved the commit message of patch1 to indicate potential impact of the change. (Dan)
- Dropped un-appropriate "Fixes" tag. (Dan)
- Dropped the patch2 which is a code movement in original patchset.
- Separated the original patch3 into cleanup one and logic change one which are corresponding to patch2 and patch3 in current patchset. (Dan)

v2:https://lore.kernel.org/linux-cxl/[email protected]/T/#t

Yanfei Xu (4):
cxl/pci: Fix to record only non-zero ranges
cxl/pci: Remove duplicated implementation of waiting for
memory_info_valid
cxl/pci: Check Mem_info_valid bit for each applicable DVSEC cxl/pci: simplify the check of mem_enabled in cxl_hdm_decode_init()

  drivers/cxl/core/pci.c        | 74 +++++++++--------------------------
  drivers/cxl/cxl.h             |  2 +-
  drivers/cxl/port.c            |  2 +-
  tools/testing/cxl/test/mock.c |  4 +-
  4 files changed, 23 insertions(+), 59 deletions(-)
#12 lore raw
In reply to Yanfei Xu
Quoted 2 lines · On Tue, 13 Aug 2024 19:05:28 +0800 Yanfei Xu <[email protected]> wrote:

The first and third patch are intended to fix potential issues regarding to retrieve and record DVSEC ranges. The second and fourth are cleanup.

typo in patch title. decoder

Also, good to include cxl: as prefix to the patch title.

Quoted 24 lines

v2->v3:
- improved the commit message of patch1 to indicate potential impact of the change. (Dan)
- Dropped un-appropriate "Fixes" tag. (Dan)
- Dropped the patch2 which is a code movement in original patchset.
- Separated the original patch3 into cleanup one and logic change one which are corresponding to patch2 and patch3 in current patchset. (Dan)

v2:https://lore.kernel.org/linux-cxl/[email protected]/T/#t

Yanfei Xu (4):
cxl/pci: Fix to record only non-zero ranges
cxl/pci: Remove duplicated implementation of waiting for
memory_info_valid
cxl/pci: Check Mem_info_valid bit for each applicable DVSEC cxl/pci: simplify the check of mem_enabled in cxl_hdm_decode_init()

 drivers/cxl/core/pci.c        | 74 +++++++++--------------------------
 drivers/cxl/cxl.h             |  2 +-
 drivers/cxl/port.c            |  2 +-
 tools/testing/cxl/test/mock.c |  4 +-
 4 files changed, 23 insertions(+), 59 deletions(-)
author
#13 lore raw
Quoted 11 lines · Jonathan Cameron
Quoted 2 lines · On Tue, 13 Aug 2024 19:05:28 +0800 Yanfei Xu <[email protected]> wrote:

The first and third patch are intended to fix potential issues regarding to retrieve and record DVSEC ranges. The second and fourth are cleanup.

typo in patch title. decoder

Also, good to include cxl: as prefix to the patch title.

Got it, will do.

Quoted 26 lines
Quoted 24 lines

v2->v3:
- improved the commit message of patch1 to indicate potential impact of the change. (Dan)
- Dropped un-appropriate "Fixes" tag. (Dan)
- Dropped the patch2 which is a code movement in original patchset.
- Separated the original patch3 into cleanup one and logic change one which are corresponding to patch2 and patch3 in current patchset. (Dan)

v2:https://lore.kernel.org/linux-cxl/[email protected]/T/#t

Yanfei Xu (4):
cxl/pci: Fix to record only non-zero ranges
cxl/pci: Remove duplicated implementation of waiting for
memory_info_valid
cxl/pci: Check Mem_info_valid bit for each applicable DVSEC cxl/pci: simplify the check of mem_enabled in cxl_hdm_decode_init()

  drivers/cxl/core/pci.c        | 74 +++++++++--------------------------
  drivers/cxl/cxl.h             |  2 +-
  drivers/cxl/port.c            |  2 +-
  tools/testing/cxl/test/mock.c |  4 +-
  4 files changed, 23 insertions(+), 59 deletions(-)