diff mbox series

stmmac: intel: Fix an error handling path in intel_eth_pci_probe()

Message ID 1ac9b6787b0db83b0095711882c55c77c8ea8da0.1654462241.git.christophe.jaillet@wanadoo.fr (mailing list archive)
State New, archived
Headers show
Series stmmac: intel: Fix an error handling path in intel_eth_pci_probe() | expand

Commit Message

Christophe JAILLET June 5, 2022, 8:50 p.m. UTC
When the managed API is used, there is no need to explicitly call
pci_free_irq_vectors().

This looks to be a left-over from the commit in the Fixes tag. Only the
.remove() function had been updated.

So remove this unused function call and update goto label accordingly.

Fixes: 8accc467758e ("stmmac: intel: use managed PCI function on probe and resume")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Wong Vee Khee June 6, 2022, 6:26 a.m. UTC | #1
On Sun, Jun 05, 2022 at 10:50:48PM +0200, Christophe JAILLET wrote:
> When the managed API is used, there is no need to explicitly call
> pci_free_irq_vectors().
> 
> This looks to be a left-over from the commit in the Fixes tag. Only the
> .remove() function had been updated.
> 
> So remove this unused function call and update goto label accordingly.
> 
> Fixes: 8accc467758e ("stmmac: intel: use managed PCI function on probe and resume")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
>  drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 

LGTM

Reviewed-by: Wong Vee Khee <vee.khee.wong@linux.intel.com>
Christophe JAILLET June 6, 2022, 8:42 p.m. UTC | #2
Le 06/06/2022 à 08:26, Wong Vee Khee a écrit :
> On Sun, Jun 05, 2022 at 10:50:48PM +0200, Christophe JAILLET wrote:
>> When the managed API is used, there is no need to explicitly call
>> pci_free_irq_vectors().
>>
>> This looks to be a left-over from the commit in the Fixes tag. Only the
>> .remove() function had been updated.
>>
>> So remove this unused function call and update goto label accordingly.
>>
>> Fixes: 8accc467758e ("stmmac: intel: use managed PCI function on probe and resume")
>> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
>> ---
>>   drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c | 4 +---
>>   1 file changed, 1 insertion(+), 3 deletions(-)
>>
> 
> LGTM
> 
> Reviewed-by: Wong Vee Khee <vee.khee.wong@linux.intel.com>
> 
> 

Hi,

I've looked at it again.

I still think that the patch is good, but pcim_release() has changed in 
5.18 since commit 3f35d2cf9fbc ("PCI/MSI: Decouple MSI[-X] disable from 
pcim_release()")

I guess that all the mechanic is in place so that everything is 
registered when needed, but I've not been able to figure it out in the 
case of dwmac-intel.c.

So, double check :).

CJ
Paolo Abeni June 7, 2022, 9:55 a.m. UTC | #3
On Mon, 2022-06-06 at 22:42 +0200, Christophe JAILLET wrote:
> Le 06/06/2022 à 08:26, Wong Vee Khee a écrit :
> > On Sun, Jun 05, 2022 at 10:50:48PM +0200, Christophe JAILLET wrote:
> > > When the managed API is used, there is no need to explicitly call
> > > pci_free_irq_vectors().
> > > 
> > > This looks to be a left-over from the commit in the Fixes tag. Only the
> > > .remove() function had been updated.
> > > 
> > > So remove this unused function call and update goto label accordingly.
> > > 
> > > Fixes: 8accc467758e ("stmmac: intel: use managed PCI function on probe and resume")
> > > Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> > > ---
> > >   drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c | 4 +---
> > >   1 file changed, 1 insertion(+), 3 deletions(-)
> > > 
> > 
> > LGTM
> > 
> > Reviewed-by: Wong Vee Khee <vee.khee.wong@linux.intel.com>
> > 
> > 
> 
> Hi,
> 
> I've looked at it again.
> 
> I still think that the patch is good, but pcim_release() has changed in 
> 5.18 since commit 3f35d2cf9fbc ("PCI/MSI: Decouple MSI[-X] disable from 
> pcim_release()")
> 
> I guess that all the mechanic is in place so that everything is 
> registered when needed, but I've not been able to figure it out in the 
> case of dwmac-intel.c.
> 
> So, double check :).

AFACIS:

stmmac_config_{single,multi}_msi -> pci_alloc_irq_vectors ->
pci_alloc_irq_vectors_affinity -> __pci_enable_msix_range ->
pcim_setup_msi_release

So LGTM, thanks!

Paolo
patchwork-bot+netdevbpf@kernel.org June 7, 2022, 10:10 a.m. UTC | #4
Hello:

This patch was applied to netdev/net.git (master)
by Paolo Abeni <pabeni@redhat.com>:

On Sun,  5 Jun 2022 22:50:48 +0200 you wrote:
> When the managed API is used, there is no need to explicitly call
> pci_free_irq_vectors().
> 
> This looks to be a left-over from the commit in the Fixes tag. Only the
> .remove() function had been updated.
> 
> So remove this unused function call and update goto label accordingly.
> 
> [...]

Here is the summary with links:
  - stmmac: intel: Fix an error handling path in intel_eth_pci_probe()
    https://git.kernel.org/netdev/net/c/5e74a4b3ec18

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c
index f9f80933e0c9..38fe77d1035e 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c
@@ -1072,13 +1072,11 @@  static int intel_eth_pci_probe(struct pci_dev *pdev,
 
 	ret = stmmac_dvr_probe(&pdev->dev, plat, &res);
 	if (ret) {
-		goto err_dvr_probe;
+		goto err_alloc_irq;
 	}
 
 	return 0;
 
-err_dvr_probe:
-	pci_free_irq_vectors(pdev);
 err_alloc_irq:
 	clk_disable_unprepare(plat->stmmac_clk);
 	clk_unregister_fixed_rate(plat->stmmac_clk);