Skip to content

Commit

Permalink
net: bcmgenet: Add a shutdown callback
Browse files Browse the repository at this point in the history
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 <f.fainelli@gmail.com>
Acked-by: Doug Berger <opendmb@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Florian Fainelli authored and David S. Miller committed Oct 16, 2019
1 parent 554032c commit d9f45ab
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/net/ethernet/broadcom/genet/bcmgenet.c
Original file line number Diff line number Diff line change
Expand Up @@ -3596,6 +3596,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)
{
Expand Down Expand Up @@ -3714,6 +3719,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,
Expand Down

0 comments on commit d9f45ab

Please sign in to comment.