[PATCH v14 18/34] cxl/port: Remove "enumerate dports" helpers

Terry Bowman posted 34 patches 3 weeks, 4 days ago
There is a newer version of this series
[PATCH v14 18/34] cxl/port: Remove "enumerate dports" helpers
Posted by Terry Bowman 3 weeks, 4 days ago
From: Dan Williams <dan.j.williams@intel.com>

Now that cxl_switch_port_probe() no longer walks potential dports, because
they are enumerated dynamically on descendant endpoint arrival, remove the
dead code.

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

---

Changes in v13 -> v14:
- New patch
---
 drivers/cxl/core/pci.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/cxl/core/pci.c b/drivers/cxl/core/pci.c
index b838c59d7a3c..0305a421504e 100644
--- a/drivers/cxl/core/pci.c
+++ b/drivers/cxl/core/pci.c
@@ -71,6 +71,14 @@ struct cxl_dport *__devm_cxl_add_dport_by_dev(struct cxl_port *port,
 }
 EXPORT_SYMBOL_NS_GPL(__devm_cxl_add_dport_by_dev, "CXL");
 
+struct cxl_walk_context {
+	struct pci_bus *bus;
+	struct cxl_port *port;
+	int type;
+	int error;
+	int count;
+};
+
 static int cxl_dvsec_mem_range_valid(struct cxl_dev_state *cxlds, int id)
 {
 	struct pci_dev *pdev = to_pci_dev(cxlds->dev);
@@ -820,14 +828,6 @@ int cxl_gpf_port_setup(struct cxl_dport *dport)
 	return 0;
 }
 
-struct cxl_walk_context {
-	struct pci_bus *bus;
-	struct cxl_port *port;
-	int type;
-	int error;
-	int count;
-};
-
 static int count_dports(struct pci_dev *pdev, void *data)
 {
 	struct cxl_walk_context *ctx = data;
-- 
2.34.1
Re: [PATCH v14 18/34] cxl/port: Remove "enumerate dports" helpers
Posted by dan.j.williams@intel.com 3 weeks, 2 days ago
Terry Bowman wrote:
> From: Dan Williams <dan.j.williams@intel.com>
> 
> Now that cxl_switch_port_probe() no longer walks potential dports, because
> they are enumerated dynamically on descendant endpoint arrival, remove the
> dead code.
> 
> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
> Reviewed-by: Terry Bowman <terry.bowman@amd.com>

Terry, the reference patch I sent was based on 6.18-rc4. That means it
was missing this change:

   3f5b8f7f34f6 cxl/port: Remove devm_cxl_port_enumerate_dports()

This cxl_walk_context move, which was not part of my original patch,
also does not appear to be needed, so this patch can simply be dropped.
Re: [PATCH v14 18/34] cxl/port: Remove "enumerate dports" helpers
Posted by Dave Jiang 3 weeks, 4 days ago

On 1/14/26 11:20 AM, Terry Bowman wrote:
> From: Dan Williams <dan.j.williams@intel.com>
> 
> Now that cxl_switch_port_probe() no longer walks potential dports, because
> they are enumerated dynamically on descendant endpoint arrival, remove the
> dead code.
> 
> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
> Reviewed-by: Terry Bowman <terry.bowman@amd.com>

Missing your sign off tag


> 
> ---
> 
> Changes in v13 -> v14:
> - New patch
> ---
>  drivers/cxl/core/pci.c | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/cxl/core/pci.c b/drivers/cxl/core/pci.c
> index b838c59d7a3c..0305a421504e 100644
> --- a/drivers/cxl/core/pci.c
> +++ b/drivers/cxl/core/pci.c
> @@ -71,6 +71,14 @@ struct cxl_dport *__devm_cxl_add_dport_by_dev(struct cxl_port *port,
>  }
>  EXPORT_SYMBOL_NS_GPL(__devm_cxl_add_dport_by_dev, "CXL");
>  
> +struct cxl_walk_context {
> +	struct pci_bus *bus;
> +	struct cxl_port *port;
> +	int type;
> +	int error;
> +	int count;
> +};
> +
>  static int cxl_dvsec_mem_range_valid(struct cxl_dev_state *cxlds, int id)
>  {
>  	struct pci_dev *pdev = to_pci_dev(cxlds->dev);
> @@ -820,14 +828,6 @@ int cxl_gpf_port_setup(struct cxl_dport *dport)
>  	return 0;
>  }
>  
> -struct cxl_walk_context {
> -	struct pci_bus *bus;
> -	struct cxl_port *port;
> -	int type;
> -	int error;
> -	int count;
> -};
> -
>  static int count_dports(struct pci_dev *pdev, void *data)
>  {
>  	struct cxl_walk_context *ctx = data;
Re: [PATCH v14 18/34] cxl/port: Remove "enumerate dports" helpers
Posted by Jonathan Cameron 3 weeks, 4 days ago
On Wed, 14 Jan 2026 12:20:39 -0600
Terry Bowman <terry.bowman@amd.com> wrote:

> From: Dan Williams <dan.j.williams@intel.com>
> 
> Now that cxl_switch_port_probe() no longer walks potential dports, because
> they are enumerated dynamically on descendant endpoint arrival, remove the
> dead code.
> 
> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
> Reviewed-by: Terry Bowman <terry.bowman@amd.com>

Patch description doesn't match patch. 

> 
> ---
> 
> Changes in v13 -> v14:
> - New patch
> ---
>  drivers/cxl/core/pci.c | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/cxl/core/pci.c b/drivers/cxl/core/pci.c
> index b838c59d7a3c..0305a421504e 100644
> --- a/drivers/cxl/core/pci.c
> +++ b/drivers/cxl/core/pci.c
> @@ -71,6 +71,14 @@ struct cxl_dport *__devm_cxl_add_dport_by_dev(struct cxl_port *port,
>  }
>  EXPORT_SYMBOL_NS_GPL(__devm_cxl_add_dport_by_dev, "CXL");
>  
> +struct cxl_walk_context {
> +	struct pci_bus *bus;
> +	struct cxl_port *port;
> +	int type;
> +	int error;
> +	int count;
> +};
> +
>  static int cxl_dvsec_mem_range_valid(struct cxl_dev_state *cxlds, int id)
>  {
>  	struct pci_dev *pdev = to_pci_dev(cxlds->dev);
> @@ -820,14 +828,6 @@ int cxl_gpf_port_setup(struct cxl_dport *dport)
>  	return 0;
>  }
>  
> -struct cxl_walk_context {
> -	struct pci_bus *bus;
> -	struct cxl_port *port;
> -	int type;
> -	int error;
> -	int count;
> -};
> -
>  static int count_dports(struct pci_dev *pdev, void *data)
>  {
>  	struct cxl_walk_context *ctx = data;
Re: [PATCH v14 18/34] cxl/port: Remove "enumerate dports" helpers
Posted by dan.j.williams@intel.com 3 weeks, 2 days ago
Jonathan Cameron wrote:
> On Wed, 14 Jan 2026 12:20:39 -0600
> Terry Bowman <terry.bowman@amd.com> wrote:
> 
> > From: Dan Williams <dan.j.williams@intel.com>
> > 
> > Now that cxl_switch_port_probe() no longer walks potential dports, because
> > they are enumerated dynamically on descendant endpoint arrival, remove the
> > dead code.
> > 
> > Signed-off-by: Dan Williams <dan.j.williams@intel.com>
> > Reviewed-by: Terry Bowman <terry.bowman@amd.com>
> 
> Patch description doesn't match patch. 

Yeah, something got frobbed from the reference patch:

https://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl.git/commit/?id=ac97e6edd792
Re: [PATCH v14 18/34] cxl/port: Remove "enumerate dports" helpers
Posted by Dave Jiang 3 weeks, 4 days ago

On 1/14/26 12:50 PM, Jonathan Cameron wrote:
> On Wed, 14 Jan 2026 12:20:39 -0600
> Terry Bowman <terry.bowman@amd.com> wrote:
> 
>> From: Dan Williams <dan.j.williams@intel.com>
>>
>> Now that cxl_switch_port_probe() no longer walks potential dports, because
>> they are enumerated dynamically on descendant endpoint arrival, remove the
>> dead code.
>>
>> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
>> Reviewed-by: Terry Bowman <terry.bowman@amd.com>
> 
> Patch description doesn't match patch. 

Looks like it's the clean up of this commit that's upstream.
Fixes: 3f5b8f7f34f6 ("cxl/port: Remove devm_cxl_port_enumerate_dports()")

> 
>>
>> ---
>>
>> Changes in v13 -> v14:
>> - New patch
>> ---
>>  drivers/cxl/core/pci.c | 16 ++++++++--------
>>  1 file changed, 8 insertions(+), 8 deletions(-)
>>
>> diff --git a/drivers/cxl/core/pci.c b/drivers/cxl/core/pci.c
>> index b838c59d7a3c..0305a421504e 100644
>> --- a/drivers/cxl/core/pci.c
>> +++ b/drivers/cxl/core/pci.c
>> @@ -71,6 +71,14 @@ struct cxl_dport *__devm_cxl_add_dport_by_dev(struct cxl_port *port,
>>  }
>>  EXPORT_SYMBOL_NS_GPL(__devm_cxl_add_dport_by_dev, "CXL");
>>  
>> +struct cxl_walk_context {
>> +	struct pci_bus *bus;
>> +	struct cxl_port *port;
>> +	int type;
>> +	int error;
>> +	int count;
>> +};
>> +
>>  static int cxl_dvsec_mem_range_valid(struct cxl_dev_state *cxlds, int id)
>>  {
>>  	struct pci_dev *pdev = to_pci_dev(cxlds->dev);
>> @@ -820,14 +828,6 @@ int cxl_gpf_port_setup(struct cxl_dport *dport)
>>  	return 0;
>>  }
>>  
>> -struct cxl_walk_context {
>> -	struct pci_bus *bus;
>> -	struct cxl_port *port;
>> -	int type;
>> -	int error;
>> -	int count;
>> -};
>> -
>>  static int count_dports(struct pci_dev *pdev, void *data)
>>  {
>>  	struct cxl_walk_context *ctx = data;
>