]> git.baikalelectronics.ru Git - kernel.git/commit
net: stmmac: fix pm runtime issue in stmmac_dvr_remove()
authorBiao Huang <biao.huang@mediatek.com>
Thu, 14 Jul 2022 06:00:13 +0000 (14:00 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 15 Jul 2022 11:06:56 +0000 (12:06 +0100)
commit454b05d3f27de3f0e4b2a1abc1b1d7822221eb9d
tree948dd1fe6499018faca0cccfafa9652c257b82ef
parentb3fe7ba182060181348e487383953d9ff5c3182f
net: stmmac: fix pm runtime issue in stmmac_dvr_remove()

If netif is running when stmmac_dvr_remove is invoked,
the unregister_netdev will call ndo_stop(stmmac_release) and
vlan_kill_rx_filter(stmmac_vlan_rx_kill_vid).

Currently, stmmac_dvr_remove() will disable pm runtime before
unregister_netdev. When stmmac_vlan_rx_kill_vid is invoked,
pm_runtime_resume_and_get in it returns EACCESS error number,
and reports:

dwmac-mediatek 11021000.ethernet eth0: stmmac_dvr_remove: removing driver
dwmac-mediatek 11021000.ethernet eth0: FPE workqueue stop
dwmac-mediatek 11021000.ethernet eth0: failed to kill vid 0081/0

Move the pm_runtime_disable to the end of stmmac_dvr_remove
to fix this issue.

Fixes: 6ac6d03516e93 ("net: stmmac: properly handle with runtime pm in stmmac_dvr_remove()")
Signed-off-by: Biao Huang <biao.huang@mediatek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c