Skip to content

Commit

Permalink
dmaengine: bcm-sba-raid: serialize dma_cookie_complete() using reqs_lock
Browse files Browse the repository at this point in the history
As-per documentation in driver/dma/dmaengine.h, the
dma_cookie_complete() API should be called with lock
held.

This patch ensures that Broadcom SBA RAID driver calls
the dma_cookie_complete() API with reqs_lock held.

Signed-off-by: Anup Patel <[email protected]>
Reviewed-by: Ray Jui <[email protected]>
Reviewed-by: Scott Branden <[email protected]>
Signed-off-by: Vinod Koul <[email protected]>
  • Loading branch information
anupbrcm authored and Vinod Koul committed Oct 23, 2017
1 parent 2bd6bf0 commit 5d74aa7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/dma/bcm-sba-raid.c
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,9 @@ static void sba_process_received_request(struct sba_device *sba,

WARN_ON(tx->cookie < 0);
if (tx->cookie > 0) {
spin_lock_irqsave(&sba->reqs_lock, flags);
dma_cookie_complete(tx);
spin_unlock_irqrestore(&sba->reqs_lock, flags);
dmaengine_desc_get_callback_invoke(tx, NULL);
dma_descriptor_unmap(tx);
tx->callback = NULL;
Expand Down

0 comments on commit 5d74aa7

Please sign in to comment.