提交 4ef738f6 编写于 作者: C Chia-Lin Kao (AceLan) 提交者: Zheng Zengkai

net: atlantic: remove deep parameter on suspend/resume functions

stable inclusion
from stable-v5.10.132
commit 38e081ee06cb5892d1bb9a4565518485d435bbd1
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5YS3T

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=38e081ee06cb5892d1bb9a4565518485d435bbd1

--------------------------------

[ Upstream commit 0f332507 ]

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 1809c30b ("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: 1809c30b ("net: atlantic: always deep reset on pm op, fixing up my null deref regression")
Signed-off-by: NChia-Lin Kao (AceLan) <acelan.kao@canonical.com>
Link: https://lore.kernel.org/r/20220713111224.1535938-1-acelan.kao@canonical.comSigned-off-by: NPaolo Abeni <pabeni@redhat.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
上级 59b833c3
...@@ -385,7 +385,7 @@ static void aq_pci_shutdown(struct pci_dev *pdev) ...@@ -385,7 +385,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)); struct aq_nic_s *nic = pci_get_drvdata(to_pci_dev(dev));
...@@ -398,17 +398,15 @@ static int aq_suspend_common(struct device *dev, bool deep) ...@@ -398,17 +398,15 @@ static int aq_suspend_common(struct device *dev, bool deep)
if (netif_running(nic->ndev)) if (netif_running(nic->ndev))
aq_nic_stop(nic); aq_nic_stop(nic);
if (deep) { aq_nic_deinit(nic, !nic->aq_hw->aq_nic_cfg->wol);
aq_nic_deinit(nic, !nic->aq_hw->aq_nic_cfg->wol); aq_nic_set_power(nic);
aq_nic_set_power(nic);
}
rtnl_unlock(); rtnl_unlock();
return 0; 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 pci_dev *pdev = to_pci_dev(dev);
struct aq_nic_s *nic; struct aq_nic_s *nic;
...@@ -421,10 +419,8 @@ static int atl_resume_common(struct device *dev, bool deep) ...@@ -421,10 +419,8 @@ static int atl_resume_common(struct device *dev, bool deep)
pci_set_power_state(pdev, PCI_D0); pci_set_power_state(pdev, PCI_D0);
pci_restore_state(pdev); pci_restore_state(pdev);
if (deep) { /* Reinitialize Nic/Vecs objects */
/* Reinitialize Nic/Vecs objects */ aq_nic_deinit(nic, !nic->aq_hw->aq_nic_cfg->wol);
aq_nic_deinit(nic, !nic->aq_hw->aq_nic_cfg->wol);
}
if (netif_running(nic->ndev)) { if (netif_running(nic->ndev)) {
ret = aq_nic_init(nic); ret = aq_nic_init(nic);
...@@ -450,22 +446,22 @@ static int atl_resume_common(struct device *dev, bool deep) ...@@ -450,22 +446,22 @@ static int atl_resume_common(struct device *dev, bool deep)
static int aq_pm_freeze(struct device *dev) 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) 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) 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) 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 = { static const struct dev_pm_ops aq_pm_ops = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册