• Biao Huang's avatar
    net: stmmac: fix pm runtime issue in stmmac_dvr_remove() · 0d9a1591
    Biao Huang authored
    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: 64495203 ("net: stmmac: properly handle with runtime pm in stmmac_dvr_remove()")
    Signed-off-by: default avatarBiao Huang <biao.huang@mediatek.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    0d9a1591
stmmac_main.c 199 KB