* [PATCH] sfc/siena: fix driver suspend/resume methods
@ 2022-05-17 1:23 Peng Wu
2022-05-18 0:55 ` Jakub Kicinski
0 siblings, 1 reply; 2+ messages in thread
From: Peng Wu @ 2022-05-17 1:23 UTC (permalink / raw)
To: davem, edumazet, kuba, hkallweit1, bhelgaas
Cc: netdev, linux-kernel, liwei391, wupeng58
Fix the missing pci_disable_device() before return
from efx_pm_resume() in the error handling case.
Meanwhile, drivers should do this:
.resume()
pci_enable_device()
.suspend()
pci_disable_device()
Signed-off-by: Peng Wu <wupeng58@huawei.com>
---
drivers/net/ethernet/sfc/siena/efx.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/sfc/siena/efx.c b/drivers/net/ethernet/sfc/siena/efx.c
index 63d999e63960..4c0ab91914f2 100644
--- a/drivers/net/ethernet/sfc/siena/efx.c
+++ b/drivers/net/ethernet/sfc/siena/efx.c
@@ -1216,21 +1216,26 @@ static int efx_pm_resume(struct device *dev)
pci_set_master(efx->pci_dev);
rc = efx->type->reset(efx, RESET_TYPE_ALL);
if (rc)
- return rc;
+ goto out;
down_write(&efx->filter_sem);
rc = efx->type->init(efx);
up_write(&efx->filter_sem);
if (rc)
- return rc;
+ goto out;
rc = efx_pm_thaw(dev);
return rc;
+out:
+ pci_disable_device(pci_dev);
+ return rc;
}
static int efx_pm_suspend(struct device *dev)
{
+ struct pci_dev *pci_dev = to_pci_dev(dev);
int rc;
efx_pm_freeze(dev);
+ pci_disable_device(pci_dev);
rc = efx_pm_poweroff(dev);
if (rc)
efx_pm_resume(dev);
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] sfc/siena: fix driver suspend/resume methods
2022-05-17 1:23 [PATCH] sfc/siena: fix driver suspend/resume methods Peng Wu
@ 2022-05-18 0:55 ` Jakub Kicinski
0 siblings, 0 replies; 2+ messages in thread
From: Jakub Kicinski @ 2022-05-18 0:55 UTC (permalink / raw)
To: Peng Wu
Cc: davem, edumazet, hkallweit1, bhelgaas, netdev, linux-kernel,
liwei391
On Tue, 17 May 2022 01:23:34 +0000 Peng Wu wrote:
> Fix the missing pci_disable_device() before return
> from efx_pm_resume() in the error handling case.
>
> Meanwhile, drivers should do this:
> .resume()
> pci_enable_device()
> .suspend()
> pci_disable_device()
>
> Signed-off-by: Peng Wu <wupeng58@huawei.com>
Won't the remove function no disable the device, anyway?
If the patch is indeed needed please add a Fixes tag pointing to where
the buggy code was added and repost.
Also since this file is a copy of drivers/net/ethernet/sfc/efx.c
I'm not sure why you're only patching this instance but not the
original.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-05-18 0:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-17 1:23 [PATCH] sfc/siena: fix driver suspend/resume methods Peng Wu
2022-05-18 0:55 ` Jakub Kicinski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).