net: bcmgenet: Add a shutdown callback
Subsystems (3)
PATCH 1/1 net: bcmgenet: Add a shutdown callback
Make sure that we completely quiesce the network device, including its DMA to avoid having it continue to receive packets while there is no software alive to service those.
--- drivers/net/ethernet/broadcom/genet/bcmgenet.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/net/ethernet/broadcom/genet/bcmgenet.c +6 -0
@@ -3597,6 +3597,11 @@ static int bcmgenet_remove(struct platform_device *pdev)return 0 ; } +static void bcmgenet_shutdown (struct platform_device *pdev) +{ +bcmgenet_remove (pdev); +} +#ifdef CONFIG_PM_SLEEP static int bcmgenet_resume (struct device *d) {
@@ -3715,6 +3720,7 @@ static SIMPLE_DEV_PM_OPS(bcmgenet_pm_ops, bcmgenet_suspend, bcmgenet_resume);static struct platform_driver bcmgenet_driver = { .probe = bcmgenet_probe, .remove = bcmgenet_remove, + .shutdown = bcmgenet_shutdown, .driver = { .name ="bcmgenet" , .of_match_table = bcmgenet_match,
Signature · 1 line
2.17.1
Quoted 27 lines · Florian Fainelli
Make sure that we completely quiesce the network device, including its DMA to avoid having it continue to receive packets while there is no software alive to service those.
Signed-off-by Florian Fainelli <[email protected]>--- drivers/net/ethernet/broadcom/genet/bcmgenet.c | 6 ++++++ 1 file changed, 6 insertions(+)drivers/net/ethernet/broadcom/genet/bcmgenet.c +5
-0@@ -3597,6 +3597,11 @@ static int bcmgenet_remove(struct platform_device *pdev)return 0 ; } +static void bcmgenet_shutdown (struct platform_device *pdev) +{ +bcmgenet_remove (pdev); +} +#ifdef CONFIG_PM_SLEEP static int bcmgenet_resume (struct device *d) {
drivers/net/ethernet/broadcom/genet/bcmgenet.c static SIMPLE_DEV_PM_OPS(bcmgenet_pm_ops, bcmgenet_suspend, bcmgenet_resume); · line 3726
Quoted 7 lines
drivers/net/ethernet/broadcom/genet/bcmgenet.c +1
-0@@ -3715,6 +3720,7 @@ static SIMPLE_DEV_PM_OPS(bcmgenet_pm_ops, bcmgenet_suspend, bcmgenet_resume);static struct platform_driver bcmgenet_driver = { .probe = bcmgenet_probe, .remove = bcmgenet_remove, + .shutdown = bcmgenet_shutdown, .driver = { .name ="bcmgenet" , .of_match_table = bcmgenet_match,
From: Florian Fainelli <[email protected]>
Date: Tue, 15 Oct 2019 10:36:24 -0700
Quoted 5 lines
Make sure that we completely quiesce the network device, including its DMA to avoid having it continue to receive packets while there is no software alive to service those.
Signed-off-by Florian Fainelli <[email protected]>
Applied.