OSDN Git Service

IB/hfi1: Protect context array set/clear with spinlock
authorMichael J. Ruhl <michael.j.ruhl@intel.com>
Fri, 4 Aug 2017 20:52:38 +0000 (13:52 -0700)
committerDoug Ledford <dledford@redhat.com>
Tue, 22 Aug 2017 18:22:36 +0000 (14:22 -0400)
commitf2a3bc00a03c2cc9caa40c8867de973fd4e48c6a
tree509797e5304e6d1e3a5165036582b5e0a6ae2a28
parent64a296f579303322ebec9edae09cf87240b1ad78
IB/hfi1: Protect context array set/clear with spinlock

The rcd array can be accessed from user context or during interrupts.
Protecting this with a mutex isn't a good idea because the mutex should
not be used from an IRQ.

Protect the allocation and freeing of rcd array elements with a
spinlock.

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/chip.c
drivers/infiniband/hw/hfi1/file_ops.c
drivers/infiniband/hw/hfi1/hfi.h
drivers/infiniband/hw/hfi1/init.c
drivers/infiniband/hw/hfi1/vnic_main.c