* [PATCH net-next] net: hibmcge: support pci_driver.shutdown()
@ 2025-10-14 13:40 Jijie Shao
2025-10-17 22:50 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Jijie Shao @ 2025-10-14 13:40 UTC (permalink / raw)
To: davem, edumazet, kuba, pabeni, andrew+netdev, horms
Cc: shenjian15, liuyonglong, chenhao418, lantao5, huangdonghua3,
yangshuaisong, jonathan.cameron, salil.mehta, netdev,
linux-kernel, shaojijie
support pci_driver.shutdown() for hibmcge driver.
Signed-off-by: Jijie Shao <shaojijie@huawei.com>
---
.../net/ethernet/hisilicon/hibmcge/hbg_main.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/drivers/net/ethernet/hisilicon/hibmcge/hbg_main.c b/drivers/net/ethernet/hisilicon/hibmcge/hbg_main.c
index 0b92a2e5e986..068da2fd1fea 100644
--- a/drivers/net/ethernet/hisilicon/hibmcge/hbg_main.c
+++ b/drivers/net/ethernet/hisilicon/hibmcge/hbg_main.c
@@ -472,6 +472,22 @@ static int hbg_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
return 0;
}
+static void hbg_shutdown(struct pci_dev *pdev)
+{
+ struct net_device *netdev = pci_get_drvdata(pdev);
+
+ rtnl_lock();
+ if (netif_running(netdev))
+ dev_close(netdev);
+ rtnl_unlock();
+
+ pci_disable_device(pdev);
+ pci_set_drvdata(pdev, NULL);
+
+ if (system_state == SYSTEM_POWER_OFF)
+ pci_set_power_state(pdev, PCI_D3hot);
+}
+
static const struct pci_device_id hbg_pci_tbl[] = {
{PCI_VDEVICE(HUAWEI, 0x3730), 0},
{ }
@@ -482,6 +498,7 @@ static struct pci_driver hbg_driver = {
.name = "hibmcge",
.id_table = hbg_pci_tbl,
.probe = hbg_probe,
+ .shutdown = hbg_shutdown,
};
static int __init hbg_module_init(void)
--
2.33.0
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH net-next] net: hibmcge: support pci_driver.shutdown()
2025-10-14 13:40 [PATCH net-next] net: hibmcge: support pci_driver.shutdown() Jijie Shao
@ 2025-10-17 22:50 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-10-17 22:50 UTC (permalink / raw)
To: Jijie Shao
Cc: davem, edumazet, kuba, pabeni, andrew+netdev, horms, shenjian15,
liuyonglong, chenhao418, lantao5, huangdonghua3, yangshuaisong,
jonathan.cameron, salil.mehta, netdev, linux-kernel
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Tue, 14 Oct 2025 21:40:18 +0800 you wrote:
> support pci_driver.shutdown() for hibmcge driver.
>
> Signed-off-by: Jijie Shao <shaojijie@huawei.com>
> ---
> .../net/ethernet/hisilicon/hibmcge/hbg_main.c | 17 +++++++++++++++++
> 1 file changed, 17 insertions(+)
Here is the summary with links:
- [net-next] net: hibmcge: support pci_driver.shutdown()
https://git.kernel.org/netdev/net-next/c/0746da01767e
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] 2+ messages in thread
end of thread, other threads:[~2025-10-17 22:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-14 13:40 [PATCH net-next] net: hibmcge: support pci_driver.shutdown() Jijie Shao
2025-10-17 22:50 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox