Skip to content

Commit

Permalink
net: atlantic: remove deep parameter on suspend/resume functions
Browse files Browse the repository at this point in the history
Below commit claims that atlantic NIC requires to reset the device on pm
op, and had set the deep to true for all suspend/resume functions.
commit 1809c30 ("net: atlantic: always deep reset on pm op, fixing up my null deref regression")
So, we could remove deep parameter on suspend/resume functions without
any functional change.

Fixes: 1809c30 ("net: atlantic: always deep reset on pm op, fixing up my null deref regression")
Signed-off-by: Chia-Lin Kao (AceLan) <acelan.kao@canonical.com>
Link: https://lore.kernel.org/r/20220713111224.1535938-1-acelan.kao@canonical.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  • Loading branch information
Chia-Lin Kao (AceLan) authored and Paolo Abeni committed Jul 14, 2022
1 parent ada74c5 commit 0f33250
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ static void aq_pci_shutdown(struct pci_dev *pdev)
}
}

static int aq_suspend_common(struct device *dev, bool deep)
static int aq_suspend_common(struct device *dev)
{
struct aq_nic_s *nic = pci_get_drvdata(to_pci_dev(dev));

Expand All @@ -392,17 +392,15 @@ static int aq_suspend_common(struct device *dev, bool deep)
if (netif_running(nic->ndev))
aq_nic_stop(nic);

if (deep) {
aq_nic_deinit(nic, !nic->aq_hw->aq_nic_cfg->wol);
aq_nic_set_power(nic);
}
aq_nic_deinit(nic, !nic->aq_hw->aq_nic_cfg->wol);
aq_nic_set_power(nic);

rtnl_unlock();

return 0;
}

static int atl_resume_common(struct device *dev, bool deep)
static int atl_resume_common(struct device *dev)
{
struct pci_dev *pdev = to_pci_dev(dev);
struct aq_nic_s *nic;
Expand All @@ -415,10 +413,8 @@ static int atl_resume_common(struct device *dev, bool deep)
pci_set_power_state(pdev, PCI_D0);
pci_restore_state(pdev);

if (deep) {
/* Reinitialize Nic/Vecs objects */
aq_nic_deinit(nic, !nic->aq_hw->aq_nic_cfg->wol);
}
/* 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);
Expand All @@ -444,22 +440,22 @@ static int atl_resume_common(struct device *dev, bool deep)

static int aq_pm_freeze(struct device *dev)
{
return aq_suspend_common(dev, true);
return aq_suspend_common(dev);
}

static int aq_pm_suspend_poweroff(struct device *dev)
{
return aq_suspend_common(dev, true);
return aq_suspend_common(dev);
}

static int aq_pm_thaw(struct device *dev)
{
return atl_resume_common(dev, true);
return atl_resume_common(dev);
}

static int aq_pm_resume_restore(struct device *dev)
{
return atl_resume_common(dev, true);
return atl_resume_common(dev);
}

static const struct dev_pm_ops aq_pm_ops = {
Expand Down

0 comments on commit 0f33250

Please sign in to comment.