Lines Matching refs:ioat_chan

127 		  struct ioatdma_chan *ioat_chan, int idx);
412 struct ioatdma_chan *ioat_chan; in ioat_dma_setup_interrupts() local
441 ioat_chan = ioat_chan_by_index(ioat_dma, i); in ioat_dma_setup_interrupts()
444 "ioat-msix", ioat_chan); in ioat_dma_setup_interrupts()
448 ioat_chan = ioat_chan_by_index(ioat_dma, j); in ioat_dma_setup_interrupts()
449 devm_free_irq(dev, msix->vector, ioat_chan); in ioat_dma_setup_interrupts()
591 struct ioatdma_chan *ioat_chan; in ioat_enumerate_channels() local
612 ioat_chan = devm_kzalloc(dev, sizeof(*ioat_chan), GFP_KERNEL); in ioat_enumerate_channels()
613 if (!ioat_chan) in ioat_enumerate_channels()
616 ioat_init_channel(ioat_dma, ioat_chan, i); in ioat_enumerate_channels()
617 ioat_chan->xfercap_log = xfercap_log; in ioat_enumerate_channels()
618 spin_lock_init(&ioat_chan->prep_lock); in ioat_enumerate_channels()
619 if (ioat_reset_hw(ioat_chan)) { in ioat_enumerate_channels()
634 struct ioatdma_chan *ioat_chan = to_ioat_chan(c); in ioat_free_chan_resources() local
635 struct ioatdma_device *ioat_dma = ioat_chan->ioat_dma; in ioat_free_chan_resources()
637 const int total_descs = 1 << ioat_chan->alloc_order; in ioat_free_chan_resources()
644 if (!ioat_chan->ring) in ioat_free_chan_resources()
647 ioat_stop(ioat_chan); in ioat_free_chan_resources()
648 ioat_reset_hw(ioat_chan); in ioat_free_chan_resources()
650 spin_lock_bh(&ioat_chan->cleanup_lock); in ioat_free_chan_resources()
651 spin_lock_bh(&ioat_chan->prep_lock); in ioat_free_chan_resources()
652 descs = ioat_ring_space(ioat_chan); in ioat_free_chan_resources()
653 dev_dbg(to_dev(ioat_chan), "freeing %d idle descriptors\n", descs); in ioat_free_chan_resources()
655 desc = ioat_get_ring_ent(ioat_chan, ioat_chan->head + i); in ioat_free_chan_resources()
660 dev_err(to_dev(ioat_chan), "Freeing %d in use descriptors!\n", in ioat_free_chan_resources()
664 desc = ioat_get_ring_ent(ioat_chan, ioat_chan->tail + i); in ioat_free_chan_resources()
665 dump_desc_dbg(ioat_chan, desc); in ioat_free_chan_resources()
669 kfree(ioat_chan->ring); in ioat_free_chan_resources()
670 ioat_chan->ring = NULL; in ioat_free_chan_resources()
671 ioat_chan->alloc_order = 0; in ioat_free_chan_resources()
672 pci_pool_free(ioat_dma->completion_pool, ioat_chan->completion, in ioat_free_chan_resources()
673 ioat_chan->completion_dma); in ioat_free_chan_resources()
674 spin_unlock_bh(&ioat_chan->prep_lock); in ioat_free_chan_resources()
675 spin_unlock_bh(&ioat_chan->cleanup_lock); in ioat_free_chan_resources()
677 ioat_chan->last_completion = 0; in ioat_free_chan_resources()
678 ioat_chan->completion_dma = 0; in ioat_free_chan_resources()
679 ioat_chan->dmacount = 0; in ioat_free_chan_resources()
687 struct ioatdma_chan *ioat_chan = to_ioat_chan(c); in ioat_alloc_chan_resources() local
695 if (ioat_chan->ring) in ioat_alloc_chan_resources()
696 return 1 << ioat_chan->alloc_order; in ioat_alloc_chan_resources()
699 writew(IOAT_CHANCTRL_RUN, ioat_chan->reg_base + IOAT_CHANCTRL_OFFSET); in ioat_alloc_chan_resources()
703 ioat_chan->completion = in ioat_alloc_chan_resources()
704 pci_pool_alloc(ioat_chan->ioat_dma->completion_pool, in ioat_alloc_chan_resources()
705 GFP_KERNEL, &ioat_chan->completion_dma); in ioat_alloc_chan_resources()
706 if (!ioat_chan->completion) in ioat_alloc_chan_resources()
709 memset(ioat_chan->completion, 0, sizeof(*ioat_chan->completion)); in ioat_alloc_chan_resources()
710 writel(((u64)ioat_chan->completion_dma) & 0x00000000FFFFFFFF, in ioat_alloc_chan_resources()
711 ioat_chan->reg_base + IOAT_CHANCMP_OFFSET_LOW); in ioat_alloc_chan_resources()
712 writel(((u64)ioat_chan->completion_dma) >> 32, in ioat_alloc_chan_resources()
713 ioat_chan->reg_base + IOAT_CHANCMP_OFFSET_HIGH); in ioat_alloc_chan_resources()
720 spin_lock_bh(&ioat_chan->cleanup_lock); in ioat_alloc_chan_resources()
721 spin_lock_bh(&ioat_chan->prep_lock); in ioat_alloc_chan_resources()
722 ioat_chan->ring = ring; in ioat_alloc_chan_resources()
723 ioat_chan->head = 0; in ioat_alloc_chan_resources()
724 ioat_chan->issued = 0; in ioat_alloc_chan_resources()
725 ioat_chan->tail = 0; in ioat_alloc_chan_resources()
726 ioat_chan->alloc_order = order; in ioat_alloc_chan_resources()
727 set_bit(IOAT_RUN, &ioat_chan->state); in ioat_alloc_chan_resources()
728 spin_unlock_bh(&ioat_chan->prep_lock); in ioat_alloc_chan_resources()
729 spin_unlock_bh(&ioat_chan->cleanup_lock); in ioat_alloc_chan_resources()
731 ioat_start_null_desc(ioat_chan); in ioat_alloc_chan_resources()
736 status = ioat_chansts(ioat_chan); in ioat_alloc_chan_resources()
740 return 1 << ioat_chan->alloc_order; in ioat_alloc_chan_resources()
742 chanerr = readl(ioat_chan->reg_base + IOAT_CHANERR_OFFSET); in ioat_alloc_chan_resources()
744 dev_WARN(to_dev(ioat_chan), in ioat_alloc_chan_resources()
753 struct ioatdma_chan *ioat_chan, int idx) in ioat_init_channel() argument
756 struct dma_chan *c = &ioat_chan->dma_chan; in ioat_init_channel()
759 ioat_chan->ioat_dma = ioat_dma; in ioat_init_channel()
760 ioat_chan->reg_base = ioat_dma->reg_base + (0x80 * (idx + 1)); in ioat_init_channel()
761 spin_lock_init(&ioat_chan->cleanup_lock); in ioat_init_channel()
762 ioat_chan->dma_chan.device = dma; in ioat_init_channel()
763 dma_cookie_init(&ioat_chan->dma_chan); in ioat_init_channel()
764 list_add_tail(&ioat_chan->dma_chan.device_node, &dma->channels); in ioat_init_channel()
765 ioat_dma->idx[idx] = ioat_chan; in ioat_init_channel()
766 init_timer(&ioat_chan->timer); in ioat_init_channel()
767 ioat_chan->timer.function = ioat_timer_event; in ioat_init_channel()
768 ioat_chan->timer.data = data; in ioat_init_channel()
769 tasklet_init(&ioat_chan->cleanup_task, ioat_cleanup_event, data); in ioat_init_channel()
1057 struct ioatdma_chan *ioat_chan; in ioat_intr_quirk() local
1068 ioat_chan = to_ioat_chan(c); in ioat_intr_quirk()
1069 errmask = readl(ioat_chan->reg_base + in ioat_intr_quirk()
1073 writel(errmask, ioat_chan->reg_base + in ioat_intr_quirk()
1085 struct ioatdma_chan *ioat_chan; in ioat3_dma_probe() local
1173 ioat_chan = to_ioat_chan(c); in ioat3_dma_probe()
1175 ioat_chan->reg_base + IOAT_DCACTRL_OFFSET); in ioat3_dma_probe()
1193 struct ioatdma_chan *ioat_chan; in ioat_shutdown() local
1200 ioat_chan = ioat_dma->idx[i]; in ioat_shutdown()
1201 if (!ioat_chan) in ioat_shutdown()
1204 spin_lock_bh(&ioat_chan->prep_lock); in ioat_shutdown()
1205 set_bit(IOAT_CHAN_DOWN, &ioat_chan->state); in ioat_shutdown()
1206 del_timer_sync(&ioat_chan->timer); in ioat_shutdown()
1207 spin_unlock_bh(&ioat_chan->prep_lock); in ioat_shutdown()
1209 ioat_reset_hw(ioat_chan); in ioat_shutdown()
1217 struct ioatdma_chan *ioat_chan; in ioat_resume() local
1222 ioat_chan = ioat_dma->idx[i]; in ioat_resume()
1223 if (!ioat_chan) in ioat_resume()
1226 spin_lock_bh(&ioat_chan->prep_lock); in ioat_resume()
1227 clear_bit(IOAT_CHAN_DOWN, &ioat_chan->state); in ioat_resume()
1228 spin_unlock_bh(&ioat_chan->prep_lock); in ioat_resume()
1230 chanerr = readl(ioat_chan->reg_base + IOAT_CHANERR_OFFSET); in ioat_resume()
1231 writel(chanerr, ioat_chan->reg_base + IOAT_CHANERR_OFFSET); in ioat_resume()