qede: fix firmware halt over suspend and resume
Subsystems (3)
PATCH v2 1/1 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.
---V1->V2:
* Replace SIMPLE_DEV_PM_OPS with DEFINE_SIMPLE_DEV_PM_OPS
--- drivers/net/ethernet/qlogic/qede/qede_main.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
drivers/net/ethernet/qlogic/qede/qede_main.c +13 -0
@@ -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 DEFINE_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 = {
Signature · 1 line
2.27.0
Quoted 12 lines · Manish Chopra
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.
Quoted 7 lines
Fixes 2950219d87b0 ("qede: Add basic network device support")Cc David Miller <[email protected]>Signed-off-by Manish Chopra <[email protected]>Signed-off-by Alok Prasad <[email protected]>---
V1->V2:
* ReplaceSIMPLE_DEV_PM_OPSwithDEFINE_SIMPLE_DEV_PM_OPS
Thanks!
Jakub Kicinski
maintainerQuoted 7 lines · On Wed, 9 Aug 2023 19:13:39 +0530 Manish Chopra wrote:
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.
Does the FW end up recovering? That could still be preferable to rejecting suspend altogether. Reject is a big hammer, I'm a bit worried it will cause a regression in stable.
Quoted 20 lines
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 <[email protected]>Signed-off-by Manish Chopra <[email protected]>Signed-off-by Alok Prasad <[email protected]>---
V1->V2:
* ReplaceSIMPLE_DEV_PM_OPSwithDEFINE_SIMPLE_DEV_PM_OPS--- drivers/net/ethernet/qlogic/qede/qede_main.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)drivers/net/ethernet/qlogic/qede/qede_main.c +0
-0
drivers/net/ethernet/qlogic/qede/qede_main.c static int qede_sriov_configure(struct pci_dev *pdev, int num_vfs_param) · line 183
Quoted 7 lines
drivers/net/ethernet/qlogic/qede/qede_main.c +4
-0@@ -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 ;
Can dev really be NULL here? That wouldn't make sense, what's the driver supposed to do in such case?
Signature · 1 line
pw-bot: cr
Quoted 25 lines
-----Original Message-----
From: Jakub Kicinski <[email protected]>
Sent: Friday, August 11, 2023 6:17 AM
To: Manish Chopra <[email protected]>
Cc: [email protected]; Ariel Elior <[email protected]>; Alok Prasad <[email protected]>; Nilesh Javali <[email protected]>; Saurav Kashyap <[email protected]>; [email protected]; [email protected]; Sudarsana Reddy Kalluru <[email protected]>; [email protected]; [email protected]; [email protected]; David Miller <[email protected]>
Subject: [EXT] Re: [PATCH v2 net] qede: fix firmware halt over suspend and resumeExternal Email
----------------------------------------------------------------------
Quoted 7 lines · On Wed, 9 Aug 2023 19:13:39 +0530 Manish Chopra wrote:
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.
Quoted 3 lines
Does the FW end up recovering? That could still be preferable to rejecting suspend altogether. Reject is a big hammer, I'm a bit worried it will cause a regression in stable.
Yes, By adding the driver's suspend handler with explicit error returned to PCI subsystem prevents the system wide suspend and does not impact the device/FW at all. It keeps them operational as they were before.
Quoted 24 lines
Quoted 24 lines
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 <[email protected]>Signed-off-by Manish Chopra <[email protected]>Signed-off-by Alok Prasad <[email protected]>---
V1->V2:
* ReplaceSIMPLE_DEV_PM_OPSwithDEFINE_SIMPLE_DEV_PM_OPS--- drivers/net/ethernet/qlogic/qede/qede_main.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)drivers/net/ethernet/qlogic/qede/qede_main.c +0
-0@@ -177,6 +177,18 @@ static int qede_sriov_configure(struct pci_dev *pdev, int num_vfs_param) } #endif
Quoted 6 lines
drivers/net/ethernet/qlogic/qede/qede_main.c static int qede_sriov_configure(struct pci_dev *pdev, int num_vfs_param) · line 183
Quoted 3 lines
drivers/net/ethernet/qlogic/qede/qede_main.c +3
-0+static int __maybe_unused qede_suspend (struct device *dev) { +if (!dev) +return -ENODEV ;Can dev really be NULL here? That wouldn't make sense, what's the driver supposed to do in such case?
It's not supposed to be NULL here assuming caller must be validating it way before. I just put it for sanity. I will remove it.
Quoted 2 lines
--
pw-bot: cr
Jakub Kicinski
maintainerQuoted 7 lines · On Fri, 11 Aug 2023 09:31:15 +0000 Manish Chopra wrote:
Quoted 3 lines
Does the FW end up recovering? That could still be preferable to rejecting suspend altogether. Reject is a big hammer, I'm a bit worried it will cause a regression in stable.
Yes, By adding the driver's suspend handler with explicit error returned to PCI subsystem prevents the system wide suspend and does not impact the device/FW at all. It keeps them operational as they were before.
I'm asking about recovery without this patch, not with it. That should be evident from the text I'm replying under.
Quoted 18 lines
-----Original Message-----
From: Jakub Kicinski <[email protected]>
Sent: Saturday, August 12, 2023 3:15 AM
To: Manish Chopra <[email protected]>
Cc: [email protected]; Ariel Elior <[email protected]>; Alok Prasad <[email protected]>; Nilesh Javali <[email protected]>; Saurav Kashyap <[email protected]>; [email protected]; [email protected]; Sudarsana Reddy Kalluru <[email protected]>; [email protected]; [email protected]; [email protected]; David Miller <[email protected]>
Subject: Re: [EXT] Re: [PATCH v2 net] qede: fix firmware halt over suspend and resumeQuoted 4 lines · On Fri, 11 Aug 2023 09:31:15 +0000 Manish Chopra wrote:
Quoted 3 lines
Does the FW end up recovering? That could still be preferable to rejecting suspend altogether. Reject is a big hammer, I'm a bit worried it will cause a regression in stable.
Quoted 7 lines
Quoted 3 lines
Yes, By adding the driver's suspend handler with explicit error returned to PCI subsystem prevents the system wide suspend and does not impact the device/FW at all. It keeps them operational as they were
before.
I'm asking about recovery without this patch, not with it. That should be evident from the text I'm replying under.
Nope, It does not recover. We have to power cycle the system to recover.
Jakub Kicinski
maintainerQuoted 4 lines · On Mon, 14 Aug 2023 10:24:52 +0000 Manish Chopra wrote:
Quoted 2 lines
I'm asking about recovery without this patch, not with it. That should be evident from the text I'm replying under.
Nope, It does not recover. We have to power cycle the system to recover.
Alright, please state that in the commit message and drop the unnecessary NULL check for v2.