]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
atlantic: Fix issue in the pm resume flow.
authorSudarsana Reddy Kalluru <skalluru@marvell.com>
Thu, 23 Sep 2021 10:16:05 +0000 (03:16 -0700)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 5 Nov 2021 09:20:17 +0000 (10:20 +0100)
BugLink: https://bugs.launchpad.net/bugs/1949640
[ Upstream commit 4d88c339c423eefe2fd48215016cb0c75fcb4c4d ]

After fixing hibernation resume flow, another usecase was found which
should be explicitly handled - resume when device is in "down" state.
Invoke aq_nic_init jointly with aq_nic_start only if ndev was already
up during suspend/hibernate. We still need to perform nic_deinit() if
caller requests for it, to handle the freeze/resume scenarios.

Fixes: 57f780f1c433 ("atlantic: Fix driver resume flow.")
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c

index f26d0373561914034e0ce3ad96d474719ec1f240..5b996330f228b2f8cde2107f21b71c100ceda7b1 100644 (file)
@@ -419,13 +419,13 @@ static int atl_resume_common(struct device *dev, bool deep)
        if (deep) {
                /* Reinitialize Nic/Vecs objects */
                aq_nic_deinit(nic, !nic->aq_hw->aq_nic_cfg->wol);
+       }
 
+       if (netif_running(nic->ndev)) {
                ret = aq_nic_init(nic);
                if (ret)
                        goto err_exit;
-       }
 
-       if (netif_running(nic->ndev)) {
                ret = aq_nic_start(nic);
                if (ret)
                        goto err_exit;