linux/drivers/infiniband
Tadeusz Struk 584d9577ff IB/hfi1: Fix locking scheme for affinity settings
Existing locking scheme in affinity.c file using the
&node_affinity.lock spinlock is not very elegant.
We acquire the lock to get hfi1_affinity_node entry,
unlock, and then use the entry without the lock held.
With more functions being added, which access and
modify the entries, this can lead to race conditions.
This patch makes this locking scheme more consistent.
It changes the spinlock to mutex. Since all the code
is executed in a user process context there is no need
for a spinlock. This also allows to keep the lock
not only while we look up for the node affinity entry,
but over the whole section where the entry is being used.

Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Sebastian Sanchez <sebastian.sanchez@intel.com>
Reviewed-by: Jianxin Xiong <jianxin.xiong@intel.com>
Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
2016-10-02 08:42:08 -04:00
..
core IB/core: Fix use after free in send_leave function 2016-09-02 14:06:27 -04:00
hw IB/hfi1: Fix locking scheme for affinity settings 2016-10-02 08:42:08 -04:00
sw IB/rdmavt, IB/qib, IB/hfi1: Use new QP put get routines 2016-09-16 14:35:27 -04:00
ulp IB/ipoib: Don't allow MC joins during light MC flush 2016-09-16 14:14:08 -04:00
Kconfig Soft RoCE driver 2016-08-04 11:13:12 -04:00
Makefile IB/rdmavt: Create module framework and handle driver registration 2016-03-10 20:37:04 -05:00