diff options
author | Dave Jiang <dave.jiang@intel.com> | 2019-02-22 18:00:05 +0100 |
---|---|---|
committer | Vinod Koul <vkoul@kernel.org> | 2019-02-25 07:48:38 +0100 |
commit | e0100d40906d5dbe6d09d31083c1a5aaccc947fa (patch) | |
tree | 5589211aa08cbc8d9c8987e3a8c5b1190c19fd32 /drivers/dma/ioat/dma.c | |
parent | dmaengine: ioatdma: disable DCA enabling on IOATDMA v3.4 (diff) | |
download | linux-e0100d40906d5dbe6d09d31083c1a5aaccc947fa.tar.xz linux-e0100d40906d5dbe6d09d31083c1a5aaccc947fa.zip |
dmaengine: ioatdma: add descriptor pre-fetch support for v3.4
Adding support for new feature on ioatdma 3.4 hardware that provides
descriptor pre-fetching in order to reduce small DMA latencies.
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/dma/ioat/dma.c')
-rw-r--r-- | drivers/dma/ioat/dma.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/dma/ioat/dma.c b/drivers/dma/ioat/dma.c index 23fb2fa04000..f373a139e0c3 100644 --- a/drivers/dma/ioat/dma.c +++ b/drivers/dma/ioat/dma.c @@ -372,6 +372,7 @@ struct ioat_ring_ent ** ioat_alloc_ring(struct dma_chan *c, int order, gfp_t flags) { struct ioatdma_chan *ioat_chan = to_ioat_chan(c); + struct ioatdma_device *ioat_dma = ioat_chan->ioat_dma; struct ioat_ring_ent **ring; int total_descs = 1 << order; int i, chunks; @@ -437,6 +438,17 @@ ioat_alloc_ring(struct dma_chan *c, int order, gfp_t flags) } ring[i]->hw->next = ring[0]->txd.phys; + /* setup descriptor pre-fetching for v3.4 */ + if (ioat_dma->cap & IOAT_CAP_DPS) { + u16 drsctl = IOAT_CHAN_DRSZ_2MB | IOAT_CHAN_DRS_EN; + + if (chunks == 1) + drsctl |= IOAT_CHAN_DRS_AUTOWRAP; + + writew(drsctl, ioat_chan->reg_base + IOAT_CHAN_DRSCTL_OFFSET); + + } + return ring; } |