Commit aa626da
iavf: Detach device during reset task
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 <[email protected]>
Cc: Patryk Piotrowski <[email protected]>
Cc: SlawomirX Laba <[email protected]>
Tested-by: Vitaly Grinberg <[email protected]>
Signed-off-by: Ivan Vecera <[email protected]>
Tested-by: Konrad Jankowski <[email protected]>
Signed-off-by: Tony Nguyen <[email protected]>1 parent fb8396a commit aa626da
1 file changed
+11
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2877 | 2877 | | |
2878 | 2878 | | |
2879 | 2879 | | |
| 2880 | + | |
| 2881 | + | |
| 2882 | + | |
| 2883 | + | |
| 2884 | + | |
2880 | 2885 | | |
2881 | 2886 | | |
2882 | 2887 | | |
2883 | 2888 | | |
2884 | 2889 | | |
2885 | 2890 | | |
2886 | 2891 | | |
2887 | | - | |
| 2892 | + | |
2888 | 2893 | | |
2889 | 2894 | | |
2890 | 2895 | | |
| |||
2954 | 2959 | | |
2955 | 2960 | | |
2956 | 2961 | | |
2957 | | - | |
2958 | 2962 | | |
2959 | 2963 | | |
2960 | 2964 | | |
| |||
3084 | 3088 | | |
3085 | 3089 | | |
3086 | 3090 | | |
3087 | | - | |
| 3091 | + | |
3088 | 3092 | | |
3089 | 3093 | | |
3090 | 3094 | | |
| |||
3095 | 3099 | | |
3096 | 3100 | | |
3097 | 3101 | | |
| 3102 | + | |
| 3103 | + | |
| 3104 | + | |
| 3105 | + | |
3098 | 3106 | | |
3099 | 3107 | | |
3100 | 3108 | | |
| |||
0 commit comments