From: John Meneghini <jmeneghi@redhat.com>
To: Manish Chopra <manishc@marvell.com>, kuba@kernel.org
Cc: netdev@vger.kernel.org, aelior@marvell.com, palok@marvell.com,
njavali@marvell.com, skashyap@marvell.com,
yuval.mintz@qlogic.com, skalluru@marvell.com, pabeni@redhat.com,
edumazet@google.com, horms@kernel.org,
David Miller <davem@davemloft.net>
Subject: Re: [PATCH v3 net] qede: fix firmware halt over suspend and resume
Date: Wed, 16 Aug 2023 16:08:48 -0400 [thread overview]
Message-ID: <c90566f6-5c7b-f20c-b8fb-2347881b23b2@redhat.com> (raw)
In-Reply-To: <20230816150711.59035-1-manishc@marvell.com>
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 = {
next prev parent reply other threads:[~2023-08-16 20:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2023-08-17 7:11 ` Simon Horman
2023-08-17 19:00 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c90566f6-5c7b-f20c-b8fb-2347881b23b2@redhat.com \
--to=jmeneghi@redhat.com \
--cc=aelior@marvell.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=manishc@marvell.com \
--cc=netdev@vger.kernel.org \
--cc=njavali@marvell.com \
--cc=pabeni@redhat.com \
--cc=palok@marvell.com \
--cc=skalluru@marvell.com \
--cc=skashyap@marvell.com \
--cc=yuval.mintz@qlogic.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).