From: "Samudrala, Sridhar" <sridhar.samudrala@intel.com>
To: David Christensen <drc@linux.vnet.ibm.com>, <manishc@marvell.com>,
<aelior@marvell.com>, <skalluru@marvell.com>
Cc: <netdev@vger.kernel.org>
Subject: Re: [PATCH] bnx2x: fix page fault following EEH recovery
Date: Thu, 8 Jun 2023 16:40:57 -0700 [thread overview]
Message-ID: <38c01d2d-7793-884f-177b-ebce71e6da36@intel.com> (raw)
In-Reply-To: <20230608200143.2410139-1-drc@linux.vnet.ibm.com>
On 6/8/2023 1:01 PM, David Christensen wrote:
> In the last step of the EEH recovery process, the EEH driver calls into
> bnx2x_io_resume() to re-initialize the NIC hardware via the function
> bnx2x_nic_load(). If an error occurs during bnx2x_nic_load(), OS and
> hardware resources are released and an error code is returned to the
> caller. When called from bnx2x_io_resume(), the return code is ignored
> and the network interface is brought up unconditionally. Later attempts
> to send a packet via this interface result in a page fault due to a null
> pointer reference.
>
> This patch checks the return code of bnx2x_nic_load(), prints an error
> message if necessary, and does not enable the interface.
>
> Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
Reviewed-by: Sridhar Samudrala <sridhar.samudrala@intel.com>
> ---
> drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
> index 637d162bbcfa..1e7a6f1d4223 100644
> --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
> +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
> @@ -14294,11 +14294,16 @@ static void bnx2x_io_resume(struct pci_dev *pdev)
> bp->fw_seq = SHMEM_RD(bp, func_mb[BP_FW_MB_IDX(bp)].drv_mb_header) &
> DRV_MSG_SEQ_NUMBER_MASK;
>
> - if (netif_running(dev))
> - bnx2x_nic_load(bp, LOAD_NORMAL);
> + if (netif_running(dev)) {
> + if (bnx2x_nic_load(bp, LOAD_NORMAL)) {
> + netdev_err(bp->dev, "Error during driver initialization, try unloading/reloading the driver\n");
> + goto done;
> + }
> + }
>
> netif_device_attach(dev);
>
> +done:
> rtnl_unlock();
> }
>
next prev parent reply other threads:[~2023-06-08 23:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-08 20:01 [PATCH] bnx2x: fix page fault following EEH recovery David Christensen
2023-06-08 23:40 ` Samudrala, Sridhar [this message]
2023-06-10 19:12 ` 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=38c01d2d-7793-884f-177b-ebce71e6da36@intel.com \
--to=sridhar.samudrala@intel.com \
--cc=aelior@marvell.com \
--cc=drc@linux.vnet.ibm.com \
--cc=manishc@marvell.com \
--cc=netdev@vger.kernel.org \
--cc=skalluru@marvell.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).