Commit 0c53cdb
net: mscc: ocelot: ocelot->ts_id_lock and ocelot_port->tx_skbs.lock are IRQ-safe
ocelot_get_txtstamp() is a threaded IRQ handler, requested explicitly as
such by both ocelot_ptp_rdy_irq_handler() and vsc9959_irq_handler().
As such, it runs with IRQs enabled, and not in hardirq context. Thus,
ocelot_port_add_txtstamp_skb() has no reason to turn off IRQs, it cannot
be preempted by ocelot_get_txtstamp(). For the same reason,
dev_kfree_skb_any_reason() will always evaluate as kfree_skb_reason() in
this calling context, so just simplify the dev_kfree_skb_any() call to
kfree_skb().
Also, ocelot_port_txtstamp_request() runs from NET_TX softirq context,
not with hardirqs enabled. Thus, ocelot_get_txtstamp() which shares the
ocelot_port->tx_skbs.lock lock with it, has no reason to disable hardirqs.
This is part of a larger rework of the TX timestamping procedure.
A logical subportion of the rework has been split into a separate
change.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Link: https://patch.msgid.link/20241205145519.1236778-4-vladimir.oltean@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>1 parent b6fba4b commit 0c53cdb
1 file changed
+6
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
607 | 607 | | |
608 | 608 | | |
609 | 609 | | |
610 | | - | |
611 | 610 | | |
612 | | - | |
| 611 | + | |
613 | 612 | | |
614 | 613 | | |
615 | 614 | | |
616 | | - | |
| 615 | + | |
617 | 616 | | |
618 | 617 | | |
619 | 618 | | |
| |||
630 | 629 | | |
631 | 630 | | |
632 | 631 | | |
633 | | - | |
| 632 | + | |
634 | 633 | | |
635 | 634 | | |
636 | 635 | | |
| |||
749 | 748 | | |
750 | 749 | | |
751 | 750 | | |
752 | | - | |
753 | 751 | | |
754 | 752 | | |
755 | 753 | | |
| |||
773 | 771 | | |
774 | 772 | | |
775 | 773 | | |
776 | | - | |
| 774 | + | |
777 | 775 | | |
778 | 776 | | |
779 | 777 | | |
| |||
783 | 781 | | |
784 | 782 | | |
785 | 783 | | |
786 | | - | |
| 784 | + | |
787 | 785 | | |
788 | 786 | | |
789 | 787 | | |
| |||
792 | 790 | | |
793 | 791 | | |
794 | 792 | | |
795 | | - | |
| 793 | + | |
796 | 794 | | |
797 | 795 | | |
798 | 796 | | |
| |||
0 commit comments