Commit c3efe89
iavf: Detach device during reset task
[ Upstream commit aa626da ]
iavf_reset_task() takes crit_lock at the beginning and holds
it during whole call. The function subsequently calls
iavf_init_interrupt_scheme() that grabs RTNL. Problem occurs
when userspace initiates during the reset task any ndo callback
that runs under RTNL like iavf_open() because some of that
functions tries to take crit_lock. This leads to classic A-B B-A
deadlock scenario.
To resolve this situation the device should be detached in
iavf_reset_task() prior taking crit_lock to avoid subsequent
ndos running under RTNL and reattach the device at the end.
Fixes: 62fe2a8 ("i40evf: add missing rtnl_lock() around i40evf_set_interrupt_capability")
Cc: Jacob Keller <jacob.e.keller@intel.com>
Cc: Patryk Piotrowski <patryk.piotrowski@intel.com>
Cc: SlawomirX Laba <slawomirx.laba@intel.com>
Tested-by: Vitaly Grinberg <vgrinber@redhat.com>
Signed-off-by: Ivan Vecera <ivecera@redhat.com>
Tested-by: Konrad Jankowski <konrad0.jankowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>1 parent 2ed9438 commit c3efe89
1 file changed
Lines changed: 11 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2222 | 2222 | | |
2223 | 2223 | | |
2224 | 2224 | | |
| 2225 | + | |
| 2226 | + | |
| 2227 | + | |
| 2228 | + | |
| 2229 | + | |
2225 | 2230 | | |
2226 | 2231 | | |
2227 | 2232 | | |
2228 | 2233 | | |
2229 | 2234 | | |
2230 | 2235 | | |
2231 | 2236 | | |
2232 | | - | |
| 2237 | + | |
2233 | 2238 | | |
2234 | 2239 | | |
2235 | 2240 | | |
| |||
2299 | 2304 | | |
2300 | 2305 | | |
2301 | 2306 | | |
2302 | | - | |
2303 | 2307 | | |
2304 | 2308 | | |
2305 | 2309 | | |
| |||
2412 | 2416 | | |
2413 | 2417 | | |
2414 | 2418 | | |
2415 | | - | |
| 2419 | + | |
2416 | 2420 | | |
2417 | 2421 | | |
2418 | 2422 | | |
| |||
2423 | 2427 | | |
2424 | 2428 | | |
2425 | 2429 | | |
| 2430 | + | |
| 2431 | + | |
| 2432 | + | |
| 2433 | + | |
2426 | 2434 | | |
2427 | 2435 | | |
2428 | 2436 | | |
| |||
0 commit comments