atlantic: Fix driver resume flow.
authorSudarsana Reddy Kalluru <skalluru@marvell.com>
Fri, 27 Aug 2021 11:52:25 +0000 (04:52 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sun, 29 Aug 2021 09:47:35 +0000 (10:47 +0100)
Driver crashes when restoring from the Hibernate. In the resume flow,
driver need to clean up the older nic/vec objects and re-initialize them.

Fixes: 8aaa112a57c1d ("net: atlantic: refactoring pm logic")
Signed-off-by: Sudarsana Reddy Kalluru <skalluru@marvell.com>
Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c

index 5925384..f26d037 100644 (file)
@@ -417,6 +417,9 @@ static int atl_resume_common(struct device *dev, bool deep)
        pci_restore_state(pdev);
 
        if (deep) {
+               /* Reinitialize Nic/Vecs objects */
+               aq_nic_deinit(nic, !nic->aq_hw->aq_nic_cfg->wol);
+
                ret = aq_nic_init(nic);
                if (ret)
                        goto err_exit;