[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230804115111.84988-1-manishc@marvell.com>
Date: Fri, 4 Aug 2023 17:21:11 +0530
From: Manish Chopra <manishc@...vell.com>
To: <kuba@...nel.org>
CC: <netdev@...r.kernel.org>, <aelior@...vell.com>, <palok@...vell.com>,
<njavali@...vell.com>, <skashyap@...vell.com>, <jmeneghi@...hat.com>,
"David
Miller" <davem@...emloft.net>
Subject: [PATCH net] qede: fix firmware halt over suspend and resume
While performing certain power-off sequences, PCI drivers are
called to suspend and resume their underlying devices through
PCI PM (power management) interface. However this NIC hardware
does not support PCI PM suspend/resume operations so system wide
suspend/resume leads to bad MFW (management firmware) state which
causes various follow-up errors in driver when communicating with
the device/firmware afterwards.
To fix this driver implements PCI PM suspend handler to indicate
unsupported operation to the PCI subsystem explicitly, thus avoiding
system to go into suspended/standby mode.
Fixes: 2950219d87b0 ("qede: Add basic network device support")
Cc: David Miller <davem@...emloft.net>
Signed-off-by: Manish Chopra <manishc@...vell.com>
Signed-off-by: Alok Prasad <palok@...vell.com>
---
drivers/net/ethernet/qlogic/qede/qede_main.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/drivers/net/ethernet/qlogic/qede/qede_main.c b/drivers/net/ethernet/qlogic/qede/qede_main.c
index d57e52a97f85..35ef187e4825 100644
--- a/drivers/net/ethernet/qlogic/qede/qede_main.c
+++ b/drivers/net/ethernet/qlogic/qede/qede_main.c
@@ -177,6 +177,18 @@ static int qede_sriov_configure(struct pci_dev *pdev, int num_vfs_param)
}
#endif
+static int __maybe_unused qede_suspend(struct device *dev)
+{
+ if (!dev)
+ return -ENODEV;
+
+ dev_info(dev, "Device does not support suspend operation\n");
+
+ return -EOPNOTSUPP;
+}
+
+static SIMPLE_DEV_PM_OPS(qede_pm_ops, qede_suspend, NULL);
+
static const struct pci_error_handlers qede_err_handler = {
.error_detected = qede_io_error_detected,
};
@@ -191,6 +203,7 @@ static struct pci_driver qede_pci_driver = {
.sriov_configure = qede_sriov_configure,
#endif
.err_handler = &qede_err_handler,
+ .driver.pm = &qede_pm_ops,
};
static struct qed_eth_cb_ops qede_ll_ops = {
--
2.27.0
Powered by blists - more mailing lists