linux-cxl.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cxl/acpi: Do not fail cxl_acpi_probe() based on a missing CHBS
@ 2021-10-07 21:34 alison.schofield
  2021-10-07 22:08 ` Ira Weiny
  2021-10-07 22:51 ` Verma, Vishal L
  0 siblings, 2 replies; 4+ messages in thread
From: alison.schofield @ 2021-10-07 21:34 UTC (permalink / raw)
  To: Ben Widawsky, Dan Williams, Ira Weiny, Vishal Verma
  Cc: Alison Schofield, linux-cxl

From: Alison Schofield <alison.schofield@intel.com>

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.

Suggested-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Alison Schofield <alison.schofield@intel.com>
---
 drivers/cxl/acpi.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/cxl/acpi.c b/drivers/cxl/acpi.c
index af1c6c1875ac..dadc7f64b9ff 100644
--- a/drivers/cxl/acpi.c
+++ b/drivers/cxl/acpi.c
@@ -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) {
-- 
2.31.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] cxl/acpi: Do not fail cxl_acpi_probe() based on a missing CHBS
  2021-10-07 21:34 [PATCH] cxl/acpi: Do not fail cxl_acpi_probe() based on a missing CHBS alison.schofield
@ 2021-10-07 22:08 ` Ira Weiny
  2021-10-07 22:51 ` Verma, Vishal L
  1 sibling, 0 replies; 4+ messages in thread
From: Ira Weiny @ 2021-10-07 22:08 UTC (permalink / raw)
  To: alison.schofield; +Cc: Ben Widawsky, Dan Williams, Vishal Verma, linux-cxl

On Thu, Oct 07, 2021 at 02:34:26PM -0700, Schofield, Alison wrote:
> From: Alison Schofield <alison.schofield@intel.com>
> 
> 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.
> 
> Suggested-by: Ira Weiny <ira.weiny@intel.com>
> Signed-off-by: Alison Schofield <alison.schofield@intel.com>

Reviewed-by: Ira Weiny <ira.weiny@intel.com>

> ---
>  drivers/cxl/acpi.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/cxl/acpi.c b/drivers/cxl/acpi.c
> index af1c6c1875ac..dadc7f64b9ff 100644
> --- a/drivers/cxl/acpi.c
> +++ b/drivers/cxl/acpi.c
> @@ -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) {
> -- 
> 2.31.1
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] cxl/acpi: Do not fail cxl_acpi_probe() based on a missing CHBS
  2021-10-07 21:34 [PATCH] cxl/acpi: Do not fail cxl_acpi_probe() based on a missing CHBS alison.schofield
  2021-10-07 22:08 ` Ira Weiny
@ 2021-10-07 22:51 ` Verma, Vishal L
  2021-10-08 18:13   ` Dan Williams
  1 sibling, 1 reply; 4+ messages in thread
From: Verma, Vishal L @ 2021-10-07 22:51 UTC (permalink / raw)
  To: Williams, Dan J, Schofield, Alison, Widawsky, Ben, Weiny, Ira; +Cc: linux-cxl

On Thu, 2021-10-07 at 14:34 -0700, alison.schofield@intel.com wrote:
> From: Alison Schofield <alison.schofield@intel.com>
> 
> 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.
> 
> Suggested-by: Ira Weiny <ira.weiny@intel.com>
> Signed-off-by: Alison Schofield <alison.schofield@intel.com>
> ---
>  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:

Tested-by: Vishal Verma <vishal.l.verma@intel.com>

> 
> diff --git a/drivers/cxl/acpi.c b/drivers/cxl/acpi.c
> index af1c6c1875ac..dadc7f64b9ff 100644
> --- a/drivers/cxl/acpi.c
> +++ b/drivers/cxl/acpi.c
> @@ -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) {


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] cxl/acpi: Do not fail cxl_acpi_probe() based on a missing CHBS
  2021-10-07 22:51 ` Verma, Vishal L
@ 2021-10-08 18:13   ` Dan Williams
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Williams @ 2021-10-08 18:13 UTC (permalink / raw)
  To: Verma, Vishal L; +Cc: Schofield, Alison, Widawsky, Ben, Weiny, Ira, linux-cxl

On Thu, Oct 7, 2021 at 3:51 PM Verma, Vishal L <vishal.l.verma@intel.com> wrote:
>
> On Thu, 2021-10-07 at 14:34 -0700, alison.schofield@intel.com wrote:
> > From: Alison Schofield <alison.schofield@intel.com>
> >
> > 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.
> >
> > Suggested-by: Ira Weiny <ira.weiny@intel.com>
> > Signed-off-by: Alison Schofield <alison.schofield@intel.com>
> > ---
> >  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:
>
> Tested-by: Vishal Verma <vishal.l.verma@intel.com>

Applied to cxl/pending.

Thanks!

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-10-08 18:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-07 21:34 [PATCH] cxl/acpi: Do not fail cxl_acpi_probe() based on a missing CHBS alison.schofield
2021-10-07 22:08 ` Ira Weiny
2021-10-07 22:51 ` Verma, Vishal L
2021-10-08 18:13   ` Dan Williams

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).