[PATCH v14 06/34] PCI: Replace cxl_error_is_native() with pcie_aer_is_native()

Terry Bowman posted 34 patches 3 weeks, 4 days ago
There is a newer version of this series
[PATCH v14 06/34] PCI: Replace cxl_error_is_native() with pcie_aer_is_native()
Posted by Terry Bowman 3 weeks, 4 days ago
The AER driver includes a CXL support function cxl_error_is_native(). This
function adds no additional value from pcie_aer_is_native().

Simplify the codebase by removing cxl_error_is_native() and replace
occurrences of cxl_error_is_native() with pcie_aer_is_native().

Signed-off-by: Terry Bowman <terry.bowman@amd.com>
Reviewed-by: Dan Williams <dan.j.williams@intel.com>

---

Changes in v13->v14:
- New commit (Dan)
---
 drivers/pci/pcie/aer.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c
index e0bcaa896803..c99ba2a1159c 100644
--- a/drivers/pci/pcie/aer.c
+++ b/drivers/pci/pcie/aer.c
@@ -1166,13 +1166,6 @@ static bool is_cxl_mem_dev(struct pci_dev *dev)
 	return true;
 }
 
-static bool cxl_error_is_native(struct pci_dev *dev)
-{
-	struct pci_host_bridge *host = pci_find_host_bridge(dev->bus);
-
-	return (pcie_ports_native || host->native_aer);
-}
-
 static bool is_internal_error(struct aer_err_info *info)
 {
 	if (info->severity == AER_CORRECTABLE)
@@ -1186,7 +1179,7 @@ static int cxl_rch_handle_error_iter(struct pci_dev *dev, void *data)
 	struct aer_err_info *info = (struct aer_err_info *)data;
 	const struct pci_error_handlers *err_handler;
 
-	if (!is_cxl_mem_dev(dev) || !cxl_error_is_native(dev))
+	if (!is_cxl_mem_dev(dev) || !pcie_aer_is_native(dev))
 		return 0;
 
 	/* Protect dev->driver */
@@ -1227,7 +1220,7 @@ static int handles_cxl_error_iter(struct pci_dev *dev, void *data)
 	bool *handles_cxl = data;
 
 	if (!*handles_cxl)
-		*handles_cxl = is_cxl_mem_dev(dev) && cxl_error_is_native(dev);
+		*handles_cxl = is_cxl_mem_dev(dev) && pcie_aer_is_native(dev);
 
 	/* Non-zero terminates iteration */
 	return *handles_cxl;
-- 
2.34.1
Re: [PATCH v14 06/34] PCI: Replace cxl_error_is_native() with pcie_aer_is_native()
Posted by Bjorn Helgaas 2 weeks, 3 days ago
On Wed, Jan 14, 2026 at 12:20:27PM -0600, Terry Bowman wrote:
> The AER driver includes a CXL support function cxl_error_is_native(). This
> function adds no additional value from pcie_aer_is_native().
> 
> Simplify the codebase by removing cxl_error_is_native() and replace
> occurrences of cxl_error_is_native() with pcie_aer_is_native().
> 
> Signed-off-by: Terry Bowman <terry.bowman@amd.com>
> Reviewed-by: Dan Williams <dan.j.williams@intel.com>

Acked-by: Bjorn Helgaas <bhelgaas@google.com>

> ---
> 
> Changes in v13->v14:
> - New commit (Dan)
> ---
>  drivers/pci/pcie/aer.c | 11 ++---------
>  1 file changed, 2 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c
> index e0bcaa896803..c99ba2a1159c 100644
> --- a/drivers/pci/pcie/aer.c
> +++ b/drivers/pci/pcie/aer.c
> @@ -1166,13 +1166,6 @@ static bool is_cxl_mem_dev(struct pci_dev *dev)
>  	return true;
>  }
>  
> -static bool cxl_error_is_native(struct pci_dev *dev)
> -{
> -	struct pci_host_bridge *host = pci_find_host_bridge(dev->bus);
> -
> -	return (pcie_ports_native || host->native_aer);
> -}
> -
>  static bool is_internal_error(struct aer_err_info *info)
>  {
>  	if (info->severity == AER_CORRECTABLE)
> @@ -1186,7 +1179,7 @@ static int cxl_rch_handle_error_iter(struct pci_dev *dev, void *data)
>  	struct aer_err_info *info = (struct aer_err_info *)data;
>  	const struct pci_error_handlers *err_handler;
>  
> -	if (!is_cxl_mem_dev(dev) || !cxl_error_is_native(dev))
> +	if (!is_cxl_mem_dev(dev) || !pcie_aer_is_native(dev))
>  		return 0;
>  
>  	/* Protect dev->driver */
> @@ -1227,7 +1220,7 @@ static int handles_cxl_error_iter(struct pci_dev *dev, void *data)
>  	bool *handles_cxl = data;
>  
>  	if (!*handles_cxl)
> -		*handles_cxl = is_cxl_mem_dev(dev) && cxl_error_is_native(dev);
> +		*handles_cxl = is_cxl_mem_dev(dev) && pcie_aer_is_native(dev);
>  
>  	/* Non-zero terminates iteration */
>  	return *handles_cxl;
> -- 
> 2.34.1
>
Re: [PATCH v14 06/34] PCI: Replace cxl_error_is_native() with pcie_aer_is_native()
Posted by Dave Jiang 3 weeks, 4 days ago

On 1/14/26 11:20 AM, Terry Bowman wrote:
> The AER driver includes a CXL support function cxl_error_is_native(). This
> function adds no additional value from pcie_aer_is_native().
> 
> Simplify the codebase by removing cxl_error_is_native() and replace
> occurrences of cxl_error_is_native() with pcie_aer_is_native().
> 
> Signed-off-by: Terry Bowman <terry.bowman@amd.com>
> Reviewed-by: Dan Williams <dan.j.williams@intel.com>

Reviewed-by: Dave Jiang <dave.jiang@intel.com>


> 
> ---
> 
> Changes in v13->v14:
> - New commit (Dan)
> ---
>  drivers/pci/pcie/aer.c | 11 ++---------
>  1 file changed, 2 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c
> index e0bcaa896803..c99ba2a1159c 100644
> --- a/drivers/pci/pcie/aer.c
> +++ b/drivers/pci/pcie/aer.c
> @@ -1166,13 +1166,6 @@ static bool is_cxl_mem_dev(struct pci_dev *dev)
>  	return true;
>  }
>  
> -static bool cxl_error_is_native(struct pci_dev *dev)
> -{
> -	struct pci_host_bridge *host = pci_find_host_bridge(dev->bus);
> -
> -	return (pcie_ports_native || host->native_aer);
> -}
> -
>  static bool is_internal_error(struct aer_err_info *info)
>  {
>  	if (info->severity == AER_CORRECTABLE)
> @@ -1186,7 +1179,7 @@ static int cxl_rch_handle_error_iter(struct pci_dev *dev, void *data)
>  	struct aer_err_info *info = (struct aer_err_info *)data;
>  	const struct pci_error_handlers *err_handler;
>  
> -	if (!is_cxl_mem_dev(dev) || !cxl_error_is_native(dev))
> +	if (!is_cxl_mem_dev(dev) || !pcie_aer_is_native(dev))
>  		return 0;
>  
>  	/* Protect dev->driver */
> @@ -1227,7 +1220,7 @@ static int handles_cxl_error_iter(struct pci_dev *dev, void *data)
>  	bool *handles_cxl = data;
>  
>  	if (!*handles_cxl)
> -		*handles_cxl = is_cxl_mem_dev(dev) && cxl_error_is_native(dev);
> +		*handles_cxl = is_cxl_mem_dev(dev) && pcie_aer_is_native(dev);
>  
>  	/* Non-zero terminates iteration */
>  	return *handles_cxl;
Re: [PATCH v14 06/34] PCI: Replace cxl_error_is_native() with pcie_aer_is_native()
Posted by Jonathan Cameron 3 weeks, 4 days ago
On Wed, 14 Jan 2026 12:20:27 -0600
Terry Bowman <terry.bowman@amd.com> wrote:

> The AER driver includes a CXL support function cxl_error_is_native(). This
> function adds no additional value from pcie_aer_is_native().
> 
> Simplify the codebase by removing cxl_error_is_native() and replace
> occurrences of cxl_error_is_native() with pcie_aer_is_native().
> 
> Signed-off-by: Terry Bowman <terry.bowman@amd.com>
> Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>

Dave, if for any reason the rest gets delayed, nice if we can
pick this one up anyway.
Re: [PATCH v14 06/34] PCI: Replace cxl_error_is_native() with pcie_aer_is_native()
Posted by Dave Jiang 3 weeks, 4 days ago

On 1/14/26 11:55 AM, Jonathan Cameron wrote:
> On Wed, 14 Jan 2026 12:20:27 -0600
> Terry Bowman <terry.bowman@amd.com> wrote:
> 
>> The AER driver includes a CXL support function cxl_error_is_native(). This
>> function adds no additional value from pcie_aer_is_native().
>>
>> Simplify the codebase by removing cxl_error_is_native() and replace
>> occurrences of cxl_error_is_native() with pcie_aer_is_native().
>>
>> Signed-off-by: Terry Bowman <terry.bowman@amd.com>
>> Reviewed-by: Dan Williams <dan.j.williams@intel.com>
> Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
> 
> Dave, if for any reason the rest gets delayed, nice if we can
> pick this one up anyway.

Needs an Ack from Bjorn one way or another.