diff options
author | Eran Ben Elisha <eranbe@mellanox.com> | 2015-11-12 17:35:29 (GMT) |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-11-15 23:43:41 (GMT) |
commit | f5adbfee72282bb1f456d52b04adacd4fe6ac502 (patch) | |
tree | ef56854525a2b48771ccb32a81387ccb33931cf5 /samples/trace_events | |
parent | d4e28cbd24c8cb004960ddb8b22124953f6c220c (diff) | |
download | linux-f5adbfee72282bb1f456d52b04adacd4fe6ac502.tar.xz |
net/mlx4_core: Fix sleeping while holding spinlock at rem_slave_counters
When cleaning slave's counter resources, we hold a spinlock that
protects the slave's counters list. As part of the clean, we call
__mlx4_clear_if_stat which calls mlx4_alloc_cmd_mailbox which is a
sleepable function.
In order to fix this issue, hold the spinlock, and copy all counter
indices into a temporary array, and release the spinlock. Afterwards,
iterate over this array and free every counter. Repeat this scenario
until the original list is empty (a new counter might have been added
while releasing the counters from the temporary array).
Fixes: b72ca7e96acf ("net/mlx4_core: Reset counters data when freed")
Reported-by: Moni Shoua <monis@mellanox.com>
Tested-by: Moni Shoua <monis@mellanox.com>
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'samples/trace_events')
0 files changed, 0 insertions, 0 deletions