Skip to content

Commit

Permalink
ioat3: fix pq completion versus channel deallocation race
Browse files Browse the repository at this point in the history
The completion of a pq operation is notified with a null descriptor
appended to the end of the chain.  This descriptor needs to be visible
to dma clients otherwise the client is precluded from ensuring all
operations are quiesced before freeing channel resources, i.e. due to
descriptor polling it may get the completion notification ahead of the
interrupt delivered by the null descriptor.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
  • Loading branch information
Dan Williams committed Nov 20, 2009
1 parent 7b3cc2b commit 49954c1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/dma/ioat/dma_v3.c
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ __ioat3_prep_xor_lock(struct dma_chan *c, enum sum_check_flags *result,
dump_desc_dbg(ioat, compl_desc);

/* we leave the channel locked to ensure in order submission */
return &desc->txd;
return &compl_desc->txd;
}

static struct dma_async_tx_descriptor *
Expand Down Expand Up @@ -730,7 +730,7 @@ __ioat3_prep_pq_lock(struct dma_chan *c, enum sum_check_flags *result,
dump_desc_dbg(ioat, compl_desc);

/* we leave the channel locked to ensure in order submission */
return &desc->txd;
return &compl_desc->txd;
}

static struct dma_async_tx_descriptor *
Expand Down

0 comments on commit 49954c1

Please sign in to comment.