aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma/ioat_dma.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/dma/ioat_dma.c')
-rw-r--r--drivers/dma/ioat_dma.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/dma/ioat_dma.c b/drivers/dma/ioat_dma.c
index b0438c4f0c30..ecd743f7cc61 100644
--- a/drivers/dma/ioat_dma.c
+++ b/drivers/dma/ioat_dma.c
@@ -525,7 +525,7 @@ static dma_cookie_t ioat1_tx_submit(struct dma_async_tx_descriptor *tx)
525 } 525 }
526 526
527 hw->ctl = IOAT_DMA_DESCRIPTOR_CTL_CP_STS; 527 hw->ctl = IOAT_DMA_DESCRIPTOR_CTL_CP_STS;
528 if (new->async_tx.callback) { 528 if (first->async_tx.callback) {
529 hw->ctl |= IOAT_DMA_DESCRIPTOR_CTL_INT_GN; 529 hw->ctl |= IOAT_DMA_DESCRIPTOR_CTL_INT_GN;
530 if (first != new) { 530 if (first != new) {
531 /* move callback into to last desc */ 531 /* move callback into to last desc */
@@ -617,7 +617,7 @@ static dma_cookie_t ioat2_tx_submit(struct dma_async_tx_descriptor *tx)
617 } 617 }
618 618
619 hw->ctl |= IOAT_DMA_DESCRIPTOR_CTL_CP_STS; 619 hw->ctl |= IOAT_DMA_DESCRIPTOR_CTL_CP_STS;
620 if (new->async_tx.callback) { 620 if (first->async_tx.callback) {
621 hw->ctl |= IOAT_DMA_DESCRIPTOR_CTL_INT_GN; 621 hw->ctl |= IOAT_DMA_DESCRIPTOR_CTL_INT_GN;
622 if (first != new) { 622 if (first != new) {
623 /* move callback into to last desc */ 623 /* move callback into to last desc */
@@ -807,6 +807,12 @@ static void ioat_dma_free_chan_resources(struct dma_chan *chan)
807 struct ioat_desc_sw *desc, *_desc; 807 struct ioat_desc_sw *desc, *_desc;
808 int in_use_descs = 0; 808 int in_use_descs = 0;
809 809
810 /* Before freeing channel resources first check
811 * if they have been previously allocated for this channel.
812 */
813 if (ioat_chan->desccount == 0)
814 return;
815
810 tasklet_disable(&ioat_chan->cleanup_task); 816 tasklet_disable(&ioat_chan->cleanup_task);
811 ioat_dma_memcpy_cleanup(ioat_chan); 817 ioat_dma_memcpy_cleanup(ioat_chan);
812 818
@@ -869,6 +875,7 @@ static void ioat_dma_free_chan_resources(struct dma_chan *chan)
869 ioat_chan->last_completion = ioat_chan->completion_addr = 0; 875 ioat_chan->last_completion = ioat_chan->completion_addr = 0;
870 ioat_chan->pending = 0; 876 ioat_chan->pending = 0;
871 ioat_chan->dmacount = 0; 877 ioat_chan->dmacount = 0;
878 ioat_chan->desccount = 0;
872 ioat_chan->watchdog_completion = 0; 879 ioat_chan->watchdog_completion = 0;
873 ioat_chan->last_compl_desc_addr_hw = 0; 880 ioat_chan->last_compl_desc_addr_hw = 0;
874 ioat_chan->watchdog_tcp_cookie = 881 ioat_chan->watchdog_tcp_cookie =