summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/hfi1/pio.c
diff options
context:
space:
mode:
authorSebastian Sanchez <sebastian.sanchez@intel.com>2016-12-07 19:33:33 -0800
committerDoug Ledford <dledford@redhat.com>2016-12-11 15:29:42 -0500
commit9b86071c5ef7a8c0a0d6d541cb79df5a8b115d91 (patch)
treeed743f619a90e42ba28565fd8392b08a3904675d /drivers/infiniband/hw/hfi1/pio.c
parentb777f154a0c21e1187c1806ababf9c5ba3e49eea (diff)
downloadblackbird-obmc-linux-9b86071c5ef7a8c0a0d6d541cb79df5a8b115d91.tar.gz
blackbird-obmc-linux-9b86071c5ef7a8c0a0d6d541cb79df5a8b115d91.zip
IB/hfi1: Remove critical section gap in sc_buffer_alloc()
In sc_buffer_alloc(), the sc->alloc_lock is released before calling sc_release_update(), and it is reacquired after the function call. This causes CPU lock trading. Fix it by not dropping the lock before calling sc_release_update(). Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com> Signed-off-by: Sebastian Sanchez <sebastian.sanchez@intel.com> Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/hw/hfi1/pio.c')
-rw-r--r--drivers/infiniband/hw/hfi1/pio.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/hfi1/pio.c b/drivers/infiniband/hw/hfi1/pio.c
index 86a7f365b624..75c4dea84c4b 100644
--- a/drivers/infiniband/hw/hfi1/pio.c
+++ b/drivers/infiniband/hw/hfi1/pio.c
@@ -1419,9 +1419,7 @@ retry:
(sc->fill - sc->alloc_free);
if (blocks > avail) {
/* still no room, actively update */
- spin_unlock_irqrestore(&sc->alloc_lock, flags);
sc_release_update(sc);
- spin_lock_irqsave(&sc->alloc_lock, flags);
sc->alloc_free = ACCESS_ONCE(sc->free);
trycount++;
goto retry;
OpenPOWER on IntegriCloud