diff options
| -rw-r--r-- | drivers/infiniband/hw/hfi1/sdma.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/hfi1/sdma.c b/drivers/infiniband/hw/hfi1/sdma.c index 70828de7436b..28b66bd70b74 100644 --- a/drivers/infiniband/hw/hfi1/sdma.c +++ b/drivers/infiniband/hw/hfi1/sdma.c | |||
| @@ -405,6 +405,7 @@ static void sdma_flush(struct sdma_engine *sde) | |||
| 405 | struct sdma_txreq *txp, *txp_next; | 405 | struct sdma_txreq *txp, *txp_next; |
| 406 | LIST_HEAD(flushlist); | 406 | LIST_HEAD(flushlist); |
| 407 | unsigned long flags; | 407 | unsigned long flags; |
| 408 | uint seq; | ||
| 408 | 409 | ||
| 409 | /* flush from head to tail */ | 410 | /* flush from head to tail */ |
| 410 | sdma_flush_descq(sde); | 411 | sdma_flush_descq(sde); |
| @@ -415,6 +416,22 @@ static void sdma_flush(struct sdma_engine *sde) | |||
| 415 | /* flush from flush list */ | 416 | /* flush from flush list */ |
| 416 | list_for_each_entry_safe(txp, txp_next, &flushlist, list) | 417 | list_for_each_entry_safe(txp, txp_next, &flushlist, list) |
| 417 | complete_tx(sde, txp, SDMA_TXREQ_S_ABORTED); | 418 | complete_tx(sde, txp, SDMA_TXREQ_S_ABORTED); |
| 419 | /* wakeup QPs orphaned on the dmawait list */ | ||
| 420 | do { | ||
| 421 | struct iowait *w, *nw; | ||
| 422 | |||
| 423 | seq = read_seqbegin(&sde->waitlock); | ||
| 424 | if (!list_empty(&sde->dmawait)) { | ||
| 425 | write_seqlock(&sde->waitlock); | ||
| 426 | list_for_each_entry_safe(w, nw, &sde->dmawait, list) { | ||
| 427 | if (w->wakeup) { | ||
| 428 | w->wakeup(w, SDMA_AVAIL_REASON); | ||
| 429 | list_del_init(&w->list); | ||
| 430 | } | ||
| 431 | } | ||
| 432 | write_sequnlock(&sde->waitlock); | ||
| 433 | } | ||
| 434 | } while (read_seqretry(&sde->waitlock, seq)); | ||
| 418 | } | 435 | } |
| 419 | 436 | ||
| 420 | /* | 437 | /* |
