The ice driver calls pci_enable_device_mem() on resume without having called pci_disable_device() on suspend. This leads to an imbalance of the enable_cnt tracked by the PCI core: Every time the adapter is resumed, the enable_cnt keeps growing. If the adapter is resumed at least once and the driver is then unbound, the device isn't disabled since the enable_cnt hasn't reached zero (and never again will). Moreover the call to pci_enable_device_mem() has no effect because the enable_cnt was already incremented in ice_probe() through the call to pcim_enable_device(). The subsequent pci_enable_device_mem() thus bails out after invoking pci_update_current_state(). But current_state was already updated by the PCI core: pci_pm_resume_noirq() pci_pm_default_resume_early() pci_pm_power_up_and_verify_state() pci_update_current_state() In summary, the call to pci_enable_device_mem() is both harmful and superfluous, so remove it. The intended purpose of the call may have been to set the Memory Space Enable bit in the Command register again on resume, but that is already achieved by the preceding call to pci_restore_state(). Fixes: 769c500dcc1e ("ice: Add advanced power mgmt for WoL") Signed-off-by: Lukas Wunner Cc: stable@vger.kernel.org # v5.9+ --- drivers/net/ethernet/intel/ice/ice_main.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c index 10a473a50710..3be4347223ef 100644 --- a/drivers/net/ethernet/intel/ice/ice_main.c +++ b/drivers/net/ethernet/intel/ice/ice_main.c @@ -5643,12 +5643,6 @@ static int ice_resume(struct device *dev) if (!pci_device_is_present(pdev)) return -ENODEV; - ret = pci_enable_device_mem(pdev); - if (ret) { - dev_err(dev, "Cannot enable device after suspend\n"); - return ret; - } - pf = pci_get_drvdata(pdev); hw = &pf->hw; -- 2.47.2