Skip to contentSkip to conversation

cxl/acpi: Do not fail cxl_acpi_probe() based on a missing CHBS

PATCH Applied [email protected] 4 participants 4 messages Oct 7, 2021 – Oct 8, 2021 CXL

lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 1/1 cxl/acpi: Do not fail cxl_acpi_probe() based on a missing CHBS

From: Alison Schofield <[email protected]>

When an ACPI0016 Host Bridge device is present yet no corresponding CEDT Host Bridge Structure (CHBS) exists, the ACPI probe method fails.

Rather than fail, emit this warning and continue:
cxl_acpi ACPI0017:00: No CHBS found for Host Bridge: ACPI0016:02

This error may occur on systems that are not compliant with the ACPI specification. Compliant systems include a CHBS entry for every CXL host bridge that is present at boot.

---
 drivers/cxl/acpi.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/cxl/acpi.c +6 -4
index af1c6c1875ac..dadc7f64b9ff 100644
@@ -288,7 +288,7 @@ static int add_host_bridge_uport(struct device *match, void *arg)
 	dport = find_dport_by_dev(root_port, match);
 	if (!dport) {
 		dev_dbg(host, "host bridge expected and not found\n");
-		return -ENODEV;
+		return 0;
 	}
 
 	port = devm_cxl_add_port(host, match, dport->component_reg_phys,
@@ -377,9 +377,11 @@ static int add_host_bridge_dport(struct device *match, void *arg)
 	}
 
 	chbs = cxl_acpi_match_chbs(host, uid);
-	if (IS_ERR(chbs))
-		dev_dbg(host, "No CHBS found for Host Bridge: %s\n",
-			dev_name(match));
+	if (IS_ERR(chbs)) {
+		dev_warn(host, "No CHBS found for Host Bridge: %s\n",
+			 dev_name(match));
+		return 0;
+	}
 
 	rc = cxl_add_dport(root_port, match, uid, get_chbcr(chbs));
 	if (rc) {
Signature · 1 line
2.31.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Alison

From: Alison Schofield <[email protected]>

When an ACPI0016 Host Bridge device is present yet no corresponding CEDT Host Bridge Structure (CHBS) exists, the ACPI probe method fails.

Rather than fail, emit this warning and continue:
cxl_acpi ACPI0017:00: No CHBS found for Host Bridge: ACPI0016:02

Quoted 6 lines

This error may occur on systems that are not compliant with the ACPI specification. Compliant systems include a CHBS entry for every CXL host bridge that is present at boot.

Quoted 35 lines
---
 drivers/cxl/acpi.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/cxl/acpi.c +6 -4
index af1c6c1875ac..dadc7f64b9ff 100644
@@ -288,7 +288,7 @@ static int add_host_bridge_uport(struct device *match, void *arg)
 	dport = find_dport_by_dev(root_port, match);
 	if (!dport) {
 		dev_dbg(host, "host bridge expected and not found\n");
-		return -ENODEV;
+		return 0;
 	}
 
 	port = devm_cxl_add_port(host, match, dport->component_reg_phys,
@@ -377,9 +377,11 @@ static int add_host_bridge_dport(struct device *match, void *arg)
 	}
 
 	chbs = cxl_acpi_match_chbs(host, uid);
-	if (IS_ERR(chbs))
-		dev_dbg(host, "No CHBS found for Host Bridge: %s\n",
-			dev_name(match));
+	if (IS_ERR(chbs)) {
+		dev_warn(host, "No CHBS found for Host Bridge: %s\n",
+			 dev_name(match));
+		return 0;
+	}
 
 	rc = cxl_add_dport(root_port, match, uid, get_chbcr(chbs));
 	if (rc) {
Signature · 1 line
2.31.1
maintainer Tested-by on v1 1/1
#2 lore raw
In reply to [email protected]
Quoted 13 lines · On Thu, 2021-10-07 at 14:34 -0700, [email protected] wrote:

From: Alison Schofield <[email protected]>

When an ACPI0016 Host Bridge device is present yet no corresponding CEDT Host Bridge Structure (CHBS) exists, the ACPI probe method fails.

Rather than fail, emit this warning and continue:
cxl_acpi ACPI0017:00: No CHBS found for Host Bridge: ACPI0016:02

This error may occur on systems that are not compliant with the ACPI specification. Compliant systems include a CHBS entry for every CXL host bridge that is present at boot.

Quoted 5 lines
---
 drivers/cxl/acpi.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

Tested with a non-compliant system, and works as expected (remaining roots and decoders still show up). You can add:

Quoted 29 lines
drivers/cxl/acpi.c +6 -4
index af1c6c1875ac..dadc7f64b9ff 100644
@@ -288,7 +288,7 @@ static int add_host_bridge_uport(struct device *match, void *arg)
 	dport = find_dport_by_dev(root_port, match);
 	if (!dport) {
 		dev_dbg(host, "host bridge expected and not found\n");
-		return -ENODEV;
+		return 0;
 	}
 
 	port = devm_cxl_add_port(host, match, dport->component_reg_phys,
@@ -377,9 +377,11 @@ static int add_host_bridge_dport(struct device *match, void *arg)
 	}
 
 	chbs = cxl_acpi_match_chbs(host, uid);
-	if (IS_ERR(chbs))
-		dev_dbg(host, "No CHBS found for Host Bridge: %s\n",
-			dev_name(match));
+	if (IS_ERR(chbs)) {
+		dev_warn(host, "No CHBS found for Host Bridge: %s\n",
+			 dev_name(match));
+		return 0;
+	}
 
 	rc = cxl_add_dport(root_port, match, uid, get_chbcr(chbs));
 	if (rc) {
Applied
#3 lore raw
Quoted 21 lines · Vishal L
Quoted 13 lines · On Thu, 2021-10-07 at 14:34 -0700, [email protected] wrote:

From: Alison Schofield <[email protected]>

When an ACPI0016 Host Bridge device is present yet no corresponding CEDT Host Bridge Structure (CHBS) exists, the ACPI probe method fails.

Rather than fail, emit this warning and continue:
cxl_acpi ACPI0017:00: No CHBS found for Host Bridge: ACPI0016:02

This error may occur on systems that are not compliant with the ACPI specification. Compliant systems include a CHBS entry for every CXL host bridge that is present at boot.

Quoted 5 lines
---
 drivers/cxl/acpi.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
Quoted 4 lines

Tested with a non-compliant system, and works as expected (remaining roots and decoders still show up). You can add:

Applied to cxl/pending.

Thanks!