From: Asmaa Mnebhi <asmaa@nvidia•com>
To: <davem@davemloft•net>, <edumazet@google•com>, <kuba@kernel•org>,
<pabeni@redhat•com>
Cc: Asmaa Mnebhi <asmaa@nvidia•com>, <netdev@vger•kernel.org>,
<cai.huoqing@linux•dev>, <brgl@bgdev•pl>,
<chenhao288@hisilicon•com>, <huangguangbin2@huawei•com>,
David Thompson <davthompson@nvidia•com>
Subject: [PATCH net-next v1 1/1] mlxbf_gige: Fix kernel panic at shutdown
Date: Fri, 2 Jun 2023 14:24:43 -0400 [thread overview]
Message-ID: <20230602182443.25514-1-asmaa@nvidia.com> (raw)
There is a race condition happening during shutdown due to pending napi transactions.
Since mlxbf_gige_poll is still running, it tries to access a NULL pointer and as a
result causes a kernel panic.
To fix this during shutdown, invoke mlxbf_gige_remove to disable and dequeue napi.
Fixes: f92e1869d74e ("Add Mellanox BlueField Gigabit Ethernet driver")
Signed-off-by: Asmaa Mnebhi <asmaa@nvidia•com>
---
drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c
index 694de9513b9f..7017f14595db 100644
--- a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c
+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c
@@ -485,10 +485,7 @@ static int mlxbf_gige_remove(struct platform_device *pdev)
static void mlxbf_gige_shutdown(struct platform_device *pdev)
{
- struct mlxbf_gige *priv = platform_get_drvdata(pdev);
-
- writeq(0, priv->base + MLXBF_GIGE_INT_EN);
- mlxbf_gige_clean_port(priv);
+ mlxbf_gige_remove(pdev);
}
static const struct acpi_device_id __maybe_unused mlxbf_gige_acpi_match[] = {
--
2.30.1
next reply other threads:[~2023-06-02 18:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-02 18:24 Asmaa Mnebhi [this message]
2023-06-05 23:15 ` [PATCH net-next v1 1/1] mlxbf_gige: Fix kernel panic at shutdown Jakub Kicinski
2023-06-06 12:25 ` Asmaa Mnebhi
2023-06-06 10:47 ` Paolo Abeni
2023-06-06 17:29 ` Jakub Kicinski
2023-06-07 13:54 ` Asmaa Mnebhi
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=20230602182443.25514-1-asmaa@nvidia.com \
--to=asmaa@nvidia$(echo .)com \
--cc=brgl@bgdev$(echo .)pl \
--cc=cai.huoqing@linux$(echo .)dev \
--cc=chenhao288@hisilicon$(echo .)com \
--cc=davem@davemloft$(echo .)net \
--cc=davthompson@nvidia$(echo .)com \
--cc=edumazet@google$(echo .)com \
--cc=huangguangbin2@huawei$(echo .)com \
--cc=kuba@kernel$(echo .)org \
--cc=netdev@vger$(echo .)kernel.org \
--cc=pabeni@redhat$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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