Skip to content

Commit 2eb9625

Browse files
manishc88kuba-moo
authored andcommitted
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. Without this fix device/firmware does not recover unless system is power cycled. Fixes: 2950219 ("qede: Add basic network device support") Signed-off-by: Manish Chopra <manishc@marvell.com> Signed-off-by: Alok Prasad <palok@marvell.com> Reviewed-by: John Meneghini <jmeneghi@redhat.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://lore.kernel.org/r/20230816150711.59035-1-manishc@marvell.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent b616be6 commit 2eb9625

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

drivers/net/ethernet/qlogic/qede/qede_main.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,15 @@ static int qede_sriov_configure(struct pci_dev *pdev, int num_vfs_param)
176176
}
177177
#endif
178178

179+
static int __maybe_unused qede_suspend(struct device *dev)
180+
{
181+
dev_info(dev, "Device does not support suspend operation\n");
182+
183+
return -EOPNOTSUPP;
184+
}
185+
186+
static DEFINE_SIMPLE_DEV_PM_OPS(qede_pm_ops, qede_suspend, NULL);
187+
179188
static const struct pci_error_handlers qede_err_handler = {
180189
.error_detected = qede_io_error_detected,
181190
};
@@ -190,6 +199,7 @@ static struct pci_driver qede_pci_driver = {
190199
.sriov_configure = qede_sriov_configure,
191200
#endif
192201
.err_handler = &qede_err_handler,
202+
.driver.pm = &qede_pm_ops,
193203
};
194204

195205
static struct qed_eth_cb_ops qede_ll_ops = {

0 commit comments

Comments
 (0)