From: Michal Schmidt <mschmidt@redhat.com>
To: netdev@vger.kernel.org
Cc: Veerasenareddy Burru <vburru@marvell.com>,
Sathesh Edara <sedara@marvell.com>,
"David S. Miller" <davem@davemloft.net>,
Abhijit Ayarekar <aayarekar@marvell.com>,
Satananda Burla <sburla@marvell.com>,
Vimlesh Kumar <vimleshk@marvell.com>
Subject: [PATCH net 2/4] octeon_ep: cancel tx_timeout_task later in remove sequence
Date: Thu, 10 Aug 2023 17:01:12 +0200 [thread overview]
Message-ID: <20230810150114.107765-3-mschmidt@redhat.com> (raw)
In-Reply-To: <20230810150114.107765-1-mschmidt@redhat.com>
tx_timeout_task is canceled too early when removing the driver. Nothing
prevents .ndo_tx_timeout from triggering and queuing the work again.
Better cancel it after the netdev is unregistered.
It's harmless for octep_tx_timeout_task to run in the window between the
unregistration and cancelation, because it checks netif_running.
Fixes: 862cd659a6fb ("octeon_ep: Add driver framework and device initialization")
Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
---
drivers/net/ethernet/marvell/octeon_ep/octep_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/marvell/octeon_ep/octep_main.c b/drivers/net/ethernet/marvell/octeon_ep/octep_main.c
index 43eb6e871351..d8066bff5f7b 100644
--- a/drivers/net/ethernet/marvell/octeon_ep/octep_main.c
+++ b/drivers/net/ethernet/marvell/octeon_ep/octep_main.c
@@ -1200,12 +1200,12 @@ static void octep_remove(struct pci_dev *pdev)
if (!oct)
return;
- cancel_work_sync(&oct->tx_timeout_task);
cancel_work_sync(&oct->ctrl_mbox_task);
netdev = oct->netdev;
if (netdev->reg_state == NETREG_REGISTERED)
unregister_netdev(netdev);
+ cancel_work_sync(&oct->tx_timeout_task);
oct->poll_non_ioq_intr = false;
cancel_delayed_work_sync(&oct->intr_poll_task);
octep_device_cleanup(oct);
--
2.41.0
next prev parent reply other threads:[~2023-08-10 15:02 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-10 15:01 [PATCH net 0/4] octeon_ep: fixes for error and remove paths Michal Schmidt
2023-08-10 15:01 ` [PATCH net 1/4] octeon_ep: fix timeout value for waiting on mbox response Michal Schmidt
2023-08-10 15:50 ` Simon Horman
2023-08-10 15:01 ` Michal Schmidt [this message]
2023-08-10 15:48 ` [PATCH net 2/4] octeon_ep: cancel tx_timeout_task later in remove sequence Simon Horman
2023-08-11 15:58 ` Michal Schmidt
2023-08-12 17:43 ` Simon Horman
2023-08-10 15:01 ` [PATCH net 3/4] octeon_ep: cancel ctrl_mbox_task after intr_poll_task Michal Schmidt
2023-08-10 15:01 ` [PATCH net 4/4] octeon_ep: cancel queued works in probe error path Michal Schmidt
2023-08-15 2:10 ` [PATCH net 0/4] octeon_ep: fixes for error and remove paths 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=20230810150114.107765-3-mschmidt@redhat.com \
--to=mschmidt@redhat.com \
--cc=aayarekar@marvell.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=sburla@marvell.com \
--cc=sedara@marvell.com \
--cc=vburru@marvell.com \
--cc=vimleshk@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).