IB/hf1: User context locking is inconsistent
authorMichael J. Ruhl <michael.j.ruhl@intel.com>
Fri, 4 Aug 2017 20:52:44 +0000 (13:52 -0700)
committerDoug Ledford <dledford@redhat.com>
Tue, 22 Aug 2017 18:22:36 +0000 (14:22 -0400)
commitd295dbeb2a0c93364444e76b3bb30f587a823e0e
tree16d96a486459c807d28715872014ca2143290eff
parentf2a3bc00a03c2cc9caa40c8867de973fd4e48c6a
IB/hf1: User context locking is inconsistent

There is a mixture of mutex and spinlocks to protect receive context
(rcd/uctxt) information.  This is not used consistently.

Use the mutex to protect device receive context information only.
Use the spinlock to protect sub context information only.

Protect access to items in the rcd array with a spinlock and
reference count.

Remove spinlock around dd->rcd array cleanup.  Since interrupts are
disabled and cleaned up before this point, this lock is not useful.

Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Reviewed-by: Sebastian Sanchez <sebastian.sanchez@intel.com>
Signed-off-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/hfi1/aspm.h
drivers/infiniband/hw/hfi1/chip.c
drivers/infiniband/hw/hfi1/debugfs.c
drivers/infiniband/hw/hfi1/driver.c
drivers/infiniband/hw/hfi1/file_ops.c
drivers/infiniband/hw/hfi1/hfi.h
drivers/infiniband/hw/hfi1/init.c
drivers/infiniband/hw/hfi1/trace_rx.h
drivers/infiniband/hw/hfi1/vnic_main.c