diff mbox series

[net-next,v13,13/15] net: stmmac: dwmac-loongson: Drop pci_enable/disable_msi temporarily

Message ID 2c5e376641ac8e791245815aa9e81fbc163dfb5a.1716973237.git.siyanteng@loongson.cn (mailing list archive)
State Deferred
Delegated to: Netdev Maintainers
Headers show
Series stmmac: Add Loongson platform support | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 902 this patch: 902
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers warning 6 maintainers not CCed: linux-stm32@st-md-mailman.stormreply.com pabeni@redhat.com linux-arm-kernel@lists.infradead.org kuba@kernel.org edumazet@google.com mcoquelin.stm32@gmail.com
netdev/build_clang success Errors and warnings before: 906 this patch: 906
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 906 this patch: 906
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 27 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-05-30--06-00 (tests: 1042)

Commit Message

Yanteng Si May 29, 2024, 10:21 a.m. UTC
The LS2K2000 patch added later will alloc vectors, so let's
remove pci_enable/disable_msi temporarily to prepare for later
calls to pci_alloc_irq_vectors/pci_free_irq_vectors. This does
not affect the work of gmac devices, as they actually use intx.

Signed-off-by: Feiyang Chen <chenfeiyang@loongson.cn>
Signed-off-by: Yinggang Gu <guyinggang@loongson.cn>
Signed-off-by: Yanteng Si <siyanteng@loongson.cn>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

Comments

Serge Semin July 1, 2024, 1:17 a.m. UTC | #1
> [PATCH net-next v13 13/15] net: stmmac: dwmac-loongson: Drop pci_enable/disable_msi temporarily

You don't drop the methods call "temporarily" but forever. So fix
the subject like this please:
[PATCH net-next v13 13/15] net: stmmac: dwmac-loongson: Drop pci_enable_msi/disable_msi methods call

I understand that you meant that the MSI IRQs support will be
added later in framework of another commit and for the multi-channel
device case. But mentioning that in a way you did makes the commit log
more confusing than better explaining the change.

On Wed, May 29, 2024 at 06:21:08PM +0800, Yanteng Si wrote:
> The LS2K2000 patch added later will alloc vectors, so let's
> remove pci_enable/disable_msi temporarily to prepare for later
> calls to pci_alloc_irq_vectors/pci_free_irq_vectors. This does
> not affect the work of gmac devices, as they actually use intx.

As I mentioned in v12 AFAICS the MSI IRQs haven't been utilized on the
Loongseon GMAC devices so far since the IRQ numbers have been retrieved
directly from device DT-node. That's what you should have mentioned in
the log. Like this:
"The Loongson GMAC driver currently doesn't utilize the MSI IRQs, but
retrieves the IRQs specified in the device DT-node. Let's drop the
direct pci_enable_msi()/pci_disable_msi() calls then as redundant."

If what I said was correct and MSIs enable wasn't required for the
platform IRQs to work, then please use the log and move this patch to
being submitted between
[PATCH net-next v13 04/15] net: stmmac: dwmac-loongson: Drop duplicated hash-based filter size init
and
[PATCH net-next v13 05/15] net: stmmac: dwmac-loongson: Use PCI_DEVICE_DATA() macro for device identification

so the redundant pci_enable_msi()/pci_disable_msi() code wouldn't be
getting on a way of the subsequent preparation changes.

I'll get back to reviewing the rest of the patches tomorrow. That new
LS2K2000 + LS GMAC info made things much harder to comprehend than I
thought. But I think I finally managed to come up with what should be
done with the commit logs and the changes, to make it being taken into
account.

-Serge(y)

> 
> Signed-off-by: Feiyang Chen <chenfeiyang@loongson.cn>
> Signed-off-by: Yinggang Gu <guyinggang@loongson.cn>
> Signed-off-by: Yanteng Si <siyanteng@loongson.cn>
> ---
>  drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
> index fdd25ff33d02..45dcc35b7955 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
> @@ -167,7 +167,6 @@ static int loongson_dwmac_probe(struct pci_dev *pdev, const struct pci_device_id
>  		res.irq = pdev->irq;
>  	}
>  
> -	pci_enable_msi(pdev);
>  	memset(&res, 0, sizeof(res));
>  	res.addr = pcim_iomap_table(pdev)[0];
>  
> @@ -176,12 +175,10 @@ static int loongson_dwmac_probe(struct pci_dev *pdev, const struct pci_device_id
>  
>  	ret = stmmac_dvr_probe(&pdev->dev, plat, &res);
>  	if (ret)
> -		goto err_disable_msi;
> +		goto err_disable_device;
>  
>  	return ret;
>  
> -err_disable_msi:
> -	pci_disable_msi(pdev);
>  err_disable_device:
>  	pci_disable_device(pdev);
>  err_put_node:
> @@ -205,7 +202,6 @@ static void loongson_dwmac_remove(struct pci_dev *pdev)
>  		break;
>  	}
>  
> -	pci_disable_msi(pdev);
>  	pci_disable_device(pdev);
>  }
>  
> -- 
> 2.31.4
>
Yanteng Si July 4, 2024, 9:32 a.m. UTC | #2
在 2024/7/1 09:17, Serge Semin 写道:
>> [PATCH net-next v13 13/15] net: stmmac: dwmac-loongson: Drop pci_enable/disable_msi temporarily
> You don't drop the methods call "temporarily" but forever. So fix
> the subject like this please:
> [PATCH net-next v13 13/15] net: stmmac: dwmac-loongson: Drop pci_enable_msi/disable_msi methods call
>
> I understand that you meant that the MSI IRQs support will be
> added later in framework of another commit and for the multi-channel
> device case. But mentioning that in a way you did makes the commit log
> more confusing than better explaining the change.
>
> On Wed, May 29, 2024 at 06:21:08PM +0800, Yanteng Si wrote:
>> The LS2K2000 patch added later will alloc vectors, so let's
>> remove pci_enable/disable_msi temporarily to prepare for later
>> calls to pci_alloc_irq_vectors/pci_free_irq_vectors. This does
>> not affect the work of gmac devices, as they actually use intx.
> As I mentioned in v12 AFAICS the MSI IRQs haven't been utilized on the
> Loongseon GMAC devices so far since the IRQ numbers have been retrieved
> directly from device DT-node. That's what you should have mentioned in
> the log. Like this:
> "The Loongson GMAC driver currently doesn't utilize the MSI IRQs, but
> retrieves the IRQs specified in the device DT-node. Let's drop the
> direct pci_enable_msi()/pci_disable_msi() calls then as redundant."
>
> If what I said was correct and MSIs enable wasn't required for the
> platform IRQs to work, then please use the log and move this patch to
> being submitted between
> [PATCH net-next v13 04/15] net: stmmac: dwmac-loongson: Drop duplicated hash-based filter size init
> and
> [PATCH net-next v13 05/15] net: stmmac: dwmac-loongson: Use PCI_DEVICE_DATA() macro for device identification
>
> so the redundant pci_enable_msi()/pci_disable_msi() code wouldn't be
> getting on a way of the subsequent preparation changes.

Ok, Thanks!


Thanks,

Yanteng
diff mbox series

Patch

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
index fdd25ff33d02..45dcc35b7955 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
@@ -167,7 +167,6 @@  static int loongson_dwmac_probe(struct pci_dev *pdev, const struct pci_device_id
 		res.irq = pdev->irq;
 	}
 
-	pci_enable_msi(pdev);
 	memset(&res, 0, sizeof(res));
 	res.addr = pcim_iomap_table(pdev)[0];
 
@@ -176,12 +175,10 @@  static int loongson_dwmac_probe(struct pci_dev *pdev, const struct pci_device_id
 
 	ret = stmmac_dvr_probe(&pdev->dev, plat, &res);
 	if (ret)
-		goto err_disable_msi;
+		goto err_disable_device;
 
 	return ret;
 
-err_disable_msi:
-	pci_disable_msi(pdev);
 err_disable_device:
 	pci_disable_device(pdev);
 err_put_node:
@@ -205,7 +202,6 @@  static void loongson_dwmac_remove(struct pci_dev *pdev)
 		break;
 	}
 
-	pci_disable_msi(pdev);
 	pci_disable_device(pdev);
 }