aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma/ioat/dma_v2.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/dma/ioat/dma_v2.c')
-rw-r--r--drivers/dma/ioat/dma_v2.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/dma/ioat/dma_v2.c b/drivers/dma/ioat/dma_v2.c
index 5d3affe7e976..8d1058085eeb 100644
--- a/drivers/dma/ioat/dma_v2.c
+++ b/drivers/dma/ioat/dma_v2.c
@@ -190,8 +190,11 @@ static void ioat2_cleanup(struct ioat2_dma_chan *ioat)
190void ioat2_cleanup_event(unsigned long data) 190void ioat2_cleanup_event(unsigned long data)
191{ 191{
192 struct ioat2_dma_chan *ioat = to_ioat2_chan((void *) data); 192 struct ioat2_dma_chan *ioat = to_ioat2_chan((void *) data);
193 struct ioat_chan_common *chan = &ioat->base;
193 194
194 ioat2_cleanup(ioat); 195 ioat2_cleanup(ioat);
196 if (!test_bit(IOAT_RUN, &chan->state))
197 return;
195 writew(IOAT_CHANCTRL_RUN, ioat->base.reg_base + IOAT_CHANCTRL_OFFSET); 198 writew(IOAT_CHANCTRL_RUN, ioat->base.reg_base + IOAT_CHANCTRL_OFFSET);
196} 199}
197 200
@@ -553,10 +556,10 @@ int ioat2_alloc_chan_resources(struct dma_chan *c)
553 ioat->issued = 0; 556 ioat->issued = 0;
554 ioat->tail = 0; 557 ioat->tail = 0;
555 ioat->alloc_order = order; 558 ioat->alloc_order = order;
559 set_bit(IOAT_RUN, &chan->state);
556 spin_unlock_bh(&ioat->prep_lock); 560 spin_unlock_bh(&ioat->prep_lock);
557 spin_unlock_bh(&chan->cleanup_lock); 561 spin_unlock_bh(&chan->cleanup_lock);
558 562
559 tasklet_enable(&chan->cleanup_task);
560 ioat2_start_null_desc(ioat); 563 ioat2_start_null_desc(ioat);
561 564
562 /* check that we got off the ground */ 565 /* check that we got off the ground */
@@ -566,7 +569,6 @@ int ioat2_alloc_chan_resources(struct dma_chan *c)
566 } while (i++ < 20 && !is_ioat_active(status) && !is_ioat_idle(status)); 569 } while (i++ < 20 && !is_ioat_active(status) && !is_ioat_idle(status));
567 570
568 if (is_ioat_active(status) || is_ioat_idle(status)) { 571 if (is_ioat_active(status) || is_ioat_idle(status)) {
569 set_bit(IOAT_RUN, &chan->state);
570 return 1 << ioat->alloc_order; 572 return 1 << ioat->alloc_order;
571 } else { 573 } else {
572 u32 chanerr = readl(chan->reg_base + IOAT_CHANERR_OFFSET); 574 u32 chanerr = readl(chan->reg_base + IOAT_CHANERR_OFFSET);
@@ -809,11 +811,8 @@ void ioat2_free_chan_resources(struct dma_chan *c)
809 if (!ioat->ring) 811 if (!ioat->ring)
810 return; 812 return;
811 813
812 tasklet_disable(&chan->cleanup_task); 814 ioat_stop(chan);
813 del_timer_sync(&chan->timer);
814 device->cleanup_fn((unsigned long) c);
815 device->reset_hw(chan); 815 device->reset_hw(chan);
816 clear_bit(IOAT_RUN, &chan->state);
817 816
818 spin_lock_bh(&chan->cleanup_lock); 817 spin_lock_bh(&chan->cleanup_lock);
819 spin_lock_bh(&ioat->prep_lock); 818 spin_lock_bh(&ioat->prep_lock);