Commit 951842b0 authored by Dan Carpenter's avatar Dan Carpenter Committed by Doug Ledford

IB/hfi1: fix a locking bug

mutex_trylock() returns zero on failure, not EBUSY.
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 50b19729
......@@ -2710,7 +2710,7 @@ int acquire_lcb_access(struct hfi1_devdata *dd, int sleep_ok)
if (sleep_ok) {
mutex_lock(&ppd->hls_lock);
} else {
while (mutex_trylock(&ppd->hls_lock) == EBUSY)
while (!mutex_trylock(&ppd->hls_lock))
udelay(1);
}
......@@ -2758,7 +2758,7 @@ int release_lcb_access(struct hfi1_devdata *dd, int sleep_ok)
if (sleep_ok) {
mutex_lock(&dd->pport->hls_lock);
} else {
while (mutex_trylock(&dd->pport->hls_lock) == EBUSY)
while (!mutex_trylock(&dd->pport->hls_lock))
udelay(1);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment