blob: 185aa747f06edd37837cdcd387aaba80319672d2 [file] [log] [blame]
From 0059fe0fbd9ba35400b3e07045e6c5a8f13bddb9 Mon Sep 17 00:00:00 2001
From: "xiangyang.yan" <xiangyang.yan@amlogic.com>
Date: Tue, 7 Feb 2023 11:31:18 +0800
Subject: [PATCH 90/95] eth: add shutdown function [1/1]
PD#SWPL-110094
Problem:
eth interface has not closed during shutdown
Solution:
add shutdown function
Verify:
T963D4-AY309#custom verify
Change-Id: I235bac19eb7771b9a92eaa143986bdf47d19bbcd
Signed-off-by: xiangyang.yan <xiangyang.yan@amlogic.com>
---
.../net/ethernet/stmicro/stmmac/dwmac-meson8b.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c
index cc5c61fdd98f..ae7135f07ec2 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c
@@ -583,6 +583,19 @@ static int meson8b_dwmac_probe(struct platform_device *pdev)
return ret;
}
+static void meson8b_dwmac_shutdown(struct platform_device *pdev)
+{
+ struct net_device *ndev = platform_get_drvdata(pdev);
+ struct stmmac_priv *priv = netdev_priv(ndev);
+ struct meson8b_dwmac *dwmac = get_stmmac_bsp_priv(&pdev->dev);
+ int ret;
+
+ pr_info("aml_eth_shutdown\n");
+ ret = stmmac_suspend(priv->device);
+ if (dwmac->data->suspend)
+ ret = dwmac->data->suspend(dwmac);
+}
+
#if IS_ENABLED(CONFIG_AMLOGIC_ETH_PRIVE)
#ifdef CONFIG_PM_SLEEP
static int dwmac_suspend(struct meson8b_dwmac *dwmac)
@@ -755,6 +768,7 @@ static struct platform_driver meson8b_dwmac_driver = {
#else
.remove = stmmac_pltfr_remove,
#endif
+ .shutdown = meson8b_dwmac_shutdown,
.driver = {
.name = "meson8b-dwmac",
#if IS_ENABLED(CONFIG_AMLOGIC_ETH_PRIVE)
--
2.25.1