All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: enetc: Use pci_release_region() to release some resources
@ 2022-05-27  9:25 Christophe JAILLET
  2022-05-27 17:51 ` Claudiu Manoil
  2022-05-28 19:30 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Christophe JAILLET @ 2022-05-27  9:25 UTC (permalink / raw)
  To: Claudiu Manoil, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Andrew Lunn
  Cc: linux-kernel, kernel-janitors, Christophe JAILLET, netdev

Some resources are allocated using pci_request_region().
It is more straightforward to release them with pci_release_region().

Fixes: 231ece36f50d ("enetc: Add mdio bus driver for the PCIe MDIO endpoint")

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
This patch is speculative, mainly based on the inconsistency between some
function's names.
Using pci_request_mem_regions() would also have things look consistent.

Review with care.
---
 drivers/net/ethernet/freescale/enetc/enetc_pci_mdio.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/freescale/enetc/enetc_pci_mdio.c b/drivers/net/ethernet/freescale/enetc/enetc_pci_mdio.c
index 15f37c5b8dc1..dafb26f81f95 100644
--- a/drivers/net/ethernet/freescale/enetc/enetc_pci_mdio.c
+++ b/drivers/net/ethernet/freescale/enetc/enetc_pci_mdio.c
@@ -69,7 +69,7 @@ static int enetc_pci_mdio_probe(struct pci_dev *pdev,
 	return 0;
 
 err_mdiobus_reg:
-	pci_release_mem_regions(pdev);
+	pci_release_region(pdev, 0);
 err_pci_mem_reg:
 	pci_disable_device(pdev);
 err_pci_enable:
@@ -88,7 +88,7 @@ static void enetc_pci_mdio_remove(struct pci_dev *pdev)
 	mdiobus_unregister(bus);
 	mdio_priv = bus->priv;
 	iounmap(mdio_priv->hw->port);
-	pci_release_mem_regions(pdev);
+	pci_release_region(pdev, 0);
 	pci_disable_device(pdev);
 }
 
-- 
2.34.1


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

* RE: [PATCH] net: enetc: Use pci_release_region() to release some resources
  2022-05-27  9:25 [PATCH] net: enetc: Use pci_release_region() to release some resources Christophe JAILLET
@ 2022-05-27 17:51 ` Claudiu Manoil
  2022-05-28 19:30 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Claudiu Manoil @ 2022-05-27 17:51 UTC (permalink / raw)
  To: Christophe JAILLET, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Andrew Lunn
  Cc: linux-kernel, kernel-janitors, netdev

> -----Original Message-----
> From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> Sent: Friday, May 27, 2022 12:26 PM
[...]
> Subject: [PATCH] net: enetc: Use pci_release_region() to release some
> resources
> 
> Some resources are allocated using pci_request_region().
> It is more straightforward to release them with pci_release_region().
> 
> Fixes: 231ece36f50d ("enetc: Add mdio bus driver for the PCIe MDIO
> endpoint")
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> This patch is speculative, mainly based on the inconsistency between some
> function's names.
> Using pci_request_mem_regions() would also have things look consistent.
> 
> Review with care.
> ---

Since the external MDIO registers are located in BAR 0 of the PCIe endpoint device,
the driver requests specifically the BAR 0 mem region and should release the same
region. So the fix is valid. Thanks.

Reviewed-by: Claudiu Manoil <claudiu.manoil@nxp.com>

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

* Re: [PATCH] net: enetc: Use pci_release_region() to release some resources
  2022-05-27  9:25 [PATCH] net: enetc: Use pci_release_region() to release some resources Christophe JAILLET
  2022-05-27 17:51 ` Claudiu Manoil
@ 2022-05-28 19:30 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-05-28 19:30 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: claudiu.manoil, davem, edumazet, kuba, pabeni, andrew,
	linux-kernel, kernel-janitors, netdev

Hello:

This patch was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:

On Fri, 27 May 2022 11:25:47 +0200 you wrote:
> Some resources are allocated using pci_request_region().
> It is more straightforward to release them with pci_release_region().
> 
> Fixes: 231ece36f50d ("enetc: Add mdio bus driver for the PCIe MDIO endpoint")
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> 
> [...]

Here is the summary with links:
  - net: enetc: Use pci_release_region() to release some resources
    https://git.kernel.org/netdev/net/c/18eeb4dea65c

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2022-05-28 19:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-27  9:25 [PATCH] net: enetc: Use pci_release_region() to release some resources Christophe JAILLET
2022-05-27 17:51 ` Claudiu Manoil
2022-05-28 19:30 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.