netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 net] qede: fix firmware halt over suspend and resume
@ 2023-08-16 15:07 Manish Chopra
  2023-08-16 20:08 ` John Meneghini
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Manish Chopra @ 2023-08-16 15:07 UTC (permalink / raw)
  To: kuba
  Cc: netdev, aelior, palok, njavali, skashyap, jmeneghi, yuval.mintz,
	skalluru, pabeni, edumazet, horms, David Miller

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: 2950219d87b0 ("qede: Add basic network device support")
Cc: David Miller <davem@davemloft.net>
Signed-off-by: Manish Chopra <manishc@marvell.com>
Signed-off-by: Alok Prasad <palok@marvell.com>
---
V1->V2:
* Replace SIMPLE_DEV_PM_OPS with DEFINE_SIMPLE_DEV_PM_OPS

V2->V3:
* Removed unnecessary device NULL check in qede_suspend()
* Updated the commit description to reflect that without
  this fix firmware can't be recovered over suspend/resume
---
 drivers/net/ethernet/qlogic/qede/qede_main.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/net/ethernet/qlogic/qede/qede_main.c b/drivers/net/ethernet/qlogic/qede/qede_main.c
index d57e52a97f85..c7911a13e8f5 100644
--- a/drivers/net/ethernet/qlogic/qede/qede_main.c
+++ b/drivers/net/ethernet/qlogic/qede/qede_main.c
@@ -177,6 +177,15 @@ static int qede_sriov_configure(struct pci_dev *pdev, int num_vfs_param)
 }
 #endif
 
+static int __maybe_unused qede_suspend(struct device *dev)
+{
+	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 +200,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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v3 net] qede: fix firmware halt over suspend and resume
  2023-08-16 15:07 [PATCH v3 net] qede: fix firmware halt over suspend and resume Manish Chopra
@ 2023-08-16 20:08 ` John Meneghini
  2023-08-17  7:11 ` Simon Horman
  2023-08-17 19:00 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: John Meneghini @ 2023-08-16 20:08 UTC (permalink / raw)
  To: Manish Chopra, kuba
  Cc: netdev, aelior, palok, njavali, skashyap, yuval.mintz, skalluru,
	pabeni, edumazet, horms, David Miller

Looks good.

Reviewed-by: John Meneghini <jmeneghi@redhat.com>

On 8/16/23 11:07, 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.
> 
> 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: 2950219d87b0 ("qede: Add basic network device support")
> Cc: David Miller <davem@davemloft.net>
> Signed-off-by: Manish Chopra <manishc@marvell.com>
> Signed-off-by: Alok Prasad <palok@marvell.com>
> ---
> V1->V2:
> * Replace SIMPLE_DEV_PM_OPS with DEFINE_SIMPLE_DEV_PM_OPS
> 
> V2->V3:
> * Removed unnecessary device NULL check in qede_suspend()
> * Updated the commit description to reflect that without
>    this fix firmware can't be recovered over suspend/resume
> ---
>   drivers/net/ethernet/qlogic/qede/qede_main.c | 10 ++++++++++
>   1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/net/ethernet/qlogic/qede/qede_main.c b/drivers/net/ethernet/qlogic/qede/qede_main.c
> index d57e52a97f85..c7911a13e8f5 100644
> --- a/drivers/net/ethernet/qlogic/qede/qede_main.c
> +++ b/drivers/net/ethernet/qlogic/qede/qede_main.c
> @@ -177,6 +177,15 @@ static int qede_sriov_configure(struct pci_dev *pdev, int num_vfs_param)
>   }
>   #endif
>   
> +static int __maybe_unused qede_suspend(struct device *dev)
> +{
> +	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 +200,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 = {


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v3 net] qede: fix firmware halt over suspend and resume
  2023-08-16 15:07 [PATCH v3 net] qede: fix firmware halt over suspend and resume Manish Chopra
  2023-08-16 20:08 ` John Meneghini
@ 2023-08-17  7:11 ` Simon Horman
  2023-08-17 19:00 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Simon Horman @ 2023-08-17  7:11 UTC (permalink / raw)
  To: Manish Chopra
  Cc: kuba, netdev, aelior, palok, njavali, skashyap, jmeneghi,
	yuval.mintz, skalluru, pabeni, edumazet, horms, David Miller

On Wed, Aug 16, 2023 at 08:37:11PM +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.
> 
> 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: 2950219d87b0 ("qede: Add basic network device support")
> Cc: David Miller <davem@davemloft.net>
> Signed-off-by: Manish Chopra <manishc@marvell.com>
> Signed-off-by: Alok Prasad <palok@marvell.com>

Reviewed-by: Simon Horman <horms@kernel.org>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v3 net] qede: fix firmware halt over suspend and resume
  2023-08-16 15:07 [PATCH v3 net] qede: fix firmware halt over suspend and resume Manish Chopra
  2023-08-16 20:08 ` John Meneghini
  2023-08-17  7:11 ` Simon Horman
@ 2023-08-17 19:00 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-08-17 19:00 UTC (permalink / raw)
  To: Manish Chopra
  Cc: kuba, netdev, aelior, palok, njavali, skashyap, jmeneghi,
	yuval.mintz, skalluru, pabeni, edumazet, horms, davem

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Wed, 16 Aug 2023 20:37:11 +0530 you 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.
> 
> [...]

Here is the summary with links:
  - [v3,net] qede: fix firmware halt over suspend and resume
    https://git.kernel.org/netdev/net/c/2eb9625a3a32

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-08-17 19:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-16 15:07 [PATCH v3 net] qede: fix firmware halt over suspend and resume Manish Chopra
2023-08-16 20:08 ` John Meneghini
2023-08-17  7:11 ` Simon Horman
2023-08-17 19:00 ` patchwork-bot+netdevbpf

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).