dmaengine: idma64: set maximum allowed segment size for DMA
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tue, 17 Nov 2015 11:37:08 +0000 (13:37 +0200)
committerVinod Koul <vinod.koul@intel.com>
Sat, 5 Dec 2015 08:24:28 +0000 (13:54 +0530)
This tells, for example, IOMMU what the maximum size of a segment
the DMA controller can send.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/idma64.c
drivers/dma/idma64.h

index 6bba0907c263fc695445991dc4f6b1a035de9879..97802be315883971b93d8001e4876f69c042bf10 100644 (file)
@@ -588,6 +588,8 @@ static int idma64_probe(struct idma64_chip *chip)
 
        idma64->dma.dev = chip->dev;
 
+       dma_set_max_seg_size(idma64->dma.dev, IDMA64C_CTLH_BLOCK_TS_MASK);
+
        ret = dma_async_device_register(&idma64->dma);
        if (ret)
                return ret;
index f6aeff0af8a52ea4a65a67d0eaada1b05ac88edd..8423f13ed0da751ddbbf958719a0e1a406e4bd38 100644 (file)
@@ -54,7 +54,8 @@
 #define IDMA64C_CTLL_LLP_S_EN          (1 << 28)       /* src block chain */
 
 /* Bitfields in CTL_HI */
-#define IDMA64C_CTLH_BLOCK_TS(x)       ((x) & ((1 << 17) - 1))
+#define IDMA64C_CTLH_BLOCK_TS_MASK     ((1 << 17) - 1)
+#define IDMA64C_CTLH_BLOCK_TS(x)       ((x) & IDMA64C_CTLH_BLOCK_TS_MASK)
 #define IDMA64C_CTLH_DONE              (1 << 17)
 
 /* Bitfields in CFG_LO */