diff mbox series

[net,2/4] octeon_ep: cancel tx_timeout_task later in remove sequence

Message ID 20230810150114.107765-3-mschmidt@redhat.com (mailing list archive)
State Accepted
Commit 28458c80006bb4e993a09fc094094a8578cad292
Delegated to: Netdev Maintainers
Headers show
Series octeon_ep: fixes for error and remove paths | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net
netdev/fixes_present success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 9 this patch: 9
netdev/cc_maintainers warning 3 maintainers not CCed: kuba@kernel.org edumazet@google.com pabeni@redhat.com
netdev/build_clang success Errors and warnings before: 1351 this patch: 1351
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 1351 this patch: 1351
netdev/checkpatch warning WARNING: 'cancelation' may be misspelled - perhaps 'cancellation'?
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Michal Schmidt Aug. 10, 2023, 3:01 p.m. UTC
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(-)

Comments

Simon Horman Aug. 10, 2023, 3:48 p.m. UTC | #1
On Thu, Aug 10, 2023 at 05:01:12PM +0200, Michal Schmidt wrote:
> tx_timeout_task is canceled too early when removing the driver. Nothing

nit: canceled -> cancelled

     also elsewhere in this patchset

     ./checkpatch.pl --codespell is your friend here

...
Michal Schmidt Aug. 11, 2023, 3:58 p.m. UTC | #2
On Thu, Aug 10, 2023 at 5:48 PM Simon Horman <horms@kernel.org> wrote:
>
> On Thu, Aug 10, 2023 at 05:01:12PM +0200, Michal Schmidt wrote:
> > tx_timeout_task is canceled too early when removing the driver. Nothing
>
> nit: canceled -> cancelled
>
>      also elsewhere in this patchset
>
>      ./checkpatch.pl --codespell is your friend here
>
> ...

Hi Simon,
thank you for the review.

I think both spellings are valid.
https://www.grammarly.com/blog/canceled-vs-cancelled/

Do you want me to resend the patchset for this?

Michal
Simon Horman Aug. 12, 2023, 5:43 p.m. UTC | #3
On Fri, Aug 11, 2023 at 05:58:44PM +0200, Michal Schmidt wrote:
> On Thu, Aug 10, 2023 at 5:48 PM Simon Horman <horms@kernel.org> wrote:
> >
> > On Thu, Aug 10, 2023 at 05:01:12PM +0200, Michal Schmidt wrote:
> > > tx_timeout_task is canceled too early when removing the driver. Nothing
> >
> > nit: canceled -> cancelled
> >
> >      also elsewhere in this patchset
> >
> >      ./checkpatch.pl --codespell is your friend here
> >
> > ...
> 
> Hi Simon,
> thank you for the review.
> 
> I think both spellings are valid.
> https://www.grammarly.com/blog/canceled-vs-cancelled/

Thanks, I did not know that.

> Do you want me to resend the patchset for this?

No, not in light of your previous point.
diff mbox series

Patch

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