1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/net/ethernet/intel/i40e
Steven Rostedt (Google) 292a089d78 treewide: Convert del_timer*() to timer_shutdown*()
Due to several bugs caused by timers being re-armed after they are
shutdown and just before they are freed, a new state of timers was added
called "shutdown".  After a timer is set to this state, then it can no
longer be re-armed.

The following script was run to find all the trivial locations where
del_timer() or del_timer_sync() is called in the same function that the
object holding the timer is freed.  It also ignores any locations where
the timer->function is modified between the del_timer*() and the free(),
as that is not considered a "trivial" case.

This was created by using a coccinelle script and the following
commands:

    $ cat timer.cocci
    @@
    expression ptr, slab;
    identifier timer, rfield;
    @@
    (
    -       del_timer(&ptr->timer);
    +       timer_shutdown(&ptr->timer);
    |
    -       del_timer_sync(&ptr->timer);
    +       timer_shutdown_sync(&ptr->timer);
    )
      ... when strict
          when != ptr->timer
    (
            kfree_rcu(ptr, rfield);
    |
            kmem_cache_free(slab, ptr);
    |
            kfree(ptr);
    )

    $ spatch timer.cocci . > /tmp/t.patch
    $ patch -p1 < /tmp/t.patch

Link: https://lore.kernel.org/lkml/20221123201306.823305113@linutronix.de/
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Acked-by: Pavel Machek <pavel@ucw.cz> [ LED ]
Acked-by: Kalle Valo <kvalo@kernel.org> [ wireless ]
Acked-by: Paolo Abeni <pabeni@redhat.com> [ networking ]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2022-12-25 13:38:09 -08:00
..
i40e.h i40e: Store the irq number in i40e_q_vector 2022-11-02 09:05:55 -07:00
i40e_adminq.c i40e: Add new versions of send ASQ command functions 2022-02-03 13:13:50 -08:00
i40e_adminq.h intel-ethernet: clean up W=1 warnings in kdoc 2020-09-25 16:28:59 -07:00
i40e_adminq_cmd.h i40e: allow toggling loopback mode via ndo_set_features callback 2022-12-12 15:24:47 -08:00
i40e_alloc.h
i40e_client.c i40e: Fix kernel crash during module removal 2022-09-02 11:15:36 -07:00
i40e_common.c i40e: allow toggling loopback mode via ndo_set_features callback 2022-12-12 15:24:47 -08:00
i40e_dcb.c intel: clean up mismatched header comments 2021-03-23 11:34:02 -07:00
i40e_dcb.h i40e: Add hardware configuration for software based DCB 2021-02-10 14:28:39 -08:00
i40e_dcb_nl.c intel: clean up mismatched header comments 2021-03-23 11:34:02 -07:00
i40e_ddp.c intel: clean up mismatched header comments 2021-03-23 11:34:02 -07:00
i40e_debugfs.c i40e: Add tx_stopped stat 2022-04-12 11:07:05 -07:00
i40e_devids.h i40e: Add basic support for I710 devices 2022-09-06 12:49:00 -07:00
i40e_diag.c
i40e_diag.h
i40e_ethtool.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-12-08 18:19:59 -08:00
i40e_hmc.c
i40e_hmc.h i40e: remove unused defines 2020-06-25 22:25:13 -07:00
i40e_lan_hmc.c intel: clean up mismatched header comments 2021-03-23 11:34:02 -07:00
i40e_lan_hmc.h
i40e_main.c treewide: Convert del_timer*() to timer_shutdown*() 2022-12-25 13:38:09 -08:00
i40e_nvm.c i40e: little endian only valid checksums 2022-03-17 07:40:46 -07:00
i40e_osdep.h i40e: remove unused defines 2020-06-25 22:25:13 -07:00
i40e_prototype.h i40e: allow toggling loopback mode via ndo_set_features callback 2022-12-12 15:24:47 -08:00
i40e_ptp.c ptp: introduce helpers to adjust by scaled parts per million 2022-10-31 11:14:16 +00:00
i40e_register.h i40e: Fix dropped jumbo frames statistics 2022-06-30 13:09:00 -07:00
i40e_status.h i40e: Remove non-inclusive language 2022-01-07 09:04:21 -08:00
i40e_trace.h i40e: Add i40e_napi_poll tracepoint 2022-11-02 09:26:17 -07:00
i40e_txrx.c i40e: Add i40e_napi_poll tracepoint 2022-11-02 09:26:17 -07:00
i40e_txrx.h i40e: Fix DMA mappings leak 2022-10-14 08:24:31 +01:00
i40e_txrx_common.h i40e, xsk: Terminate Rx side of NAPI when XSK Rx queue gets full 2022-04-15 21:10:41 +02:00
i40e_type.h i40e: Fix ethtool rx-flow-hash setting for X722 2022-10-25 16:18:31 -07:00
i40e_virtchnl_pf.c i40e: Fix for VF MAC address 0 2022-12-05 08:30:51 -08:00
i40e_virtchnl_pf.h i40e: Fix VF hang when reset is triggered on another VF 2022-10-25 16:18:31 -07:00
i40e_xsk.c i40e: Fix DMA mappings leak 2022-10-14 08:24:31 +01:00
i40e_xsk.h i40e: Fix DMA mappings leak 2022-10-14 08:24:31 +01:00
Makefile