Commit 50bd33f
net: enetc: fix the deadlock of enetc_mdio_lock
After applying the workaround for err050089, the LS1028A platform
experiences RCU stalls on RT kernel. This issue is caused by the
recursive acquisition of the read lock enetc_mdio_lock. Here list some
of the call stacks identified under the enetc_poll path that may lead to
a deadlock:
enetc_poll
-> enetc_lock_mdio
-> enetc_clean_rx_ring OR napi_complete_done
-> napi_gro_receive
-> enetc_start_xmit
-> enetc_lock_mdio
-> enetc_map_tx_buffs
-> enetc_unlock_mdio
-> enetc_unlock_mdio
After enetc_poll acquires the read lock, a higher-priority writer attempts
to acquire the lock, causing preemption. The writer detects that a
read lock is already held and is scheduled out. However, readers under
enetc_poll cannot acquire the read lock again because a writer is already
waiting, leading to a thread hang.
Currently, the deadlock is avoided by adjusting enetc_lock_mdio to prevent
recursive lock acquisition.
Fixes: 6d36ecd ("net: enetc: take the MDIO lock only once per NAPI poll cycle")
Signed-off-by: Jianpeng Chang <jianpeng.chang.cn@windriver.com>
Acked-by: Wei Fang <wei.fang@nxp.com>
Link: https://patch.msgid.link/20251015021427.180757-1-jianpeng.chang.cn@windriver.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>1 parent 7f86445 commit 50bd33f
1 file changed
Lines changed: 21 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1595 | 1595 | | |
1596 | 1596 | | |
1597 | 1597 | | |
| 1598 | + | |
| 1599 | + | |
1598 | 1600 | | |
1599 | 1601 | | |
1600 | 1602 | | |
| |||
1630 | 1632 | | |
1631 | 1633 | | |
1632 | 1634 | | |
| 1635 | + | |
1633 | 1636 | | |
| 1637 | + | |
1634 | 1638 | | |
1635 | 1639 | | |
1636 | 1640 | | |
1637 | 1641 | | |
1638 | 1642 | | |
1639 | 1643 | | |
1640 | 1644 | | |
| 1645 | + | |
| 1646 | + | |
1641 | 1647 | | |
1642 | 1648 | | |
1643 | 1649 | | |
| |||
1947 | 1953 | | |
1948 | 1954 | | |
1949 | 1955 | | |
| 1956 | + | |
| 1957 | + | |
1950 | 1958 | | |
1951 | 1959 | | |
1952 | 1960 | | |
| |||
2010 | 2018 | | |
2011 | 2019 | | |
2012 | 2020 | | |
| 2021 | + | |
2013 | 2022 | | |
| 2023 | + | |
2014 | 2024 | | |
2015 | 2025 | | |
2016 | 2026 | | |
| |||
2045 | 2055 | | |
2046 | 2056 | | |
2047 | 2057 | | |
| 2058 | + | |
2048 | 2059 | | |
| 2060 | + | |
2049 | 2061 | | |
2050 | 2062 | | |
2051 | 2063 | | |
| |||
2065 | 2077 | | |
2066 | 2078 | | |
2067 | 2079 | | |
2068 | | - | |
| 2080 | + | |
| 2081 | + | |
2069 | 2082 | | |
| 2083 | + | |
| 2084 | + | |
2070 | 2085 | | |
2071 | 2086 | | |
2072 | 2087 | | |
| |||
2075 | 2090 | | |
2076 | 2091 | | |
2077 | 2092 | | |
| 2093 | + | |
| 2094 | + | |
2078 | 2095 | | |
2079 | 2096 | | |
2080 | 2097 | | |
| |||
2093 | 2110 | | |
2094 | 2111 | | |
2095 | 2112 | | |
| 2113 | + | |
2096 | 2114 | | |
2097 | 2115 | | |
2098 | 2116 | | |
| |||
2104 | 2122 | | |
2105 | 2123 | | |
2106 | 2124 | | |
2107 | | - | |
2108 | | - | |
| 2125 | + | |
2109 | 2126 | | |
2110 | | - | |
2111 | 2127 | | |
2112 | 2128 | | |
2113 | 2129 | | |
| |||
2116 | 2132 | | |
2117 | 2133 | | |
2118 | 2134 | | |
| 2135 | + | |
2119 | 2136 | | |
2120 | 2137 | | |
2121 | 2138 | | |
| |||
0 commit comments