DMAENGINE: COH 901 318 lli sg offset fix
This makes the COH 901 318 respect the scatter offset field by using the sg_phys() rather than the sg_dma_address() so we get a pointer to the actual data we want to send rather than the beginning of the buffer. Also initialize the lli:s a bit more thoroughly. Signed-off-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
This commit is contained in:
parent
516fd4305e
commit
56a5d3cf21
|
@ -74,6 +74,8 @@ coh901318_lli_alloc(struct coh901318_pool *pool, unsigned int len)
|
||||||
|
|
||||||
lli = head;
|
lli = head;
|
||||||
lli->phy_this = phy;
|
lli->phy_this = phy;
|
||||||
|
lli->link_addr = 0x00000000;
|
||||||
|
lli->virt_link_addr = 0x00000000U;
|
||||||
|
|
||||||
for (i = 1; i < len; i++) {
|
for (i = 1; i < len; i++) {
|
||||||
lli_prev = lli;
|
lli_prev = lli;
|
||||||
|
@ -85,13 +87,13 @@ coh901318_lli_alloc(struct coh901318_pool *pool, unsigned int len)
|
||||||
|
|
||||||
DEBUGFS_POOL_COUNTER_ADD(pool, 1);
|
DEBUGFS_POOL_COUNTER_ADD(pool, 1);
|
||||||
lli->phy_this = phy;
|
lli->phy_this = phy;
|
||||||
|
lli->link_addr = 0x00000000;
|
||||||
|
lli->virt_link_addr = 0x00000000U;
|
||||||
|
|
||||||
lli_prev->link_addr = phy;
|
lli_prev->link_addr = phy;
|
||||||
lli_prev->virt_link_addr = lli;
|
lli_prev->virt_link_addr = lli;
|
||||||
}
|
}
|
||||||
|
|
||||||
lli->link_addr = 0x00000000U;
|
|
||||||
|
|
||||||
spin_unlock(&pool->lock);
|
spin_unlock(&pool->lock);
|
||||||
|
|
||||||
return head;
|
return head;
|
||||||
|
@ -268,10 +270,10 @@ coh901318_lli_fill_sg(struct coh901318_pool *pool,
|
||||||
|
|
||||||
if (dir == DMA_TO_DEVICE)
|
if (dir == DMA_TO_DEVICE)
|
||||||
/* increment source address */
|
/* increment source address */
|
||||||
src = sg_dma_address(sg);
|
src = sg_phys(sg);
|
||||||
else
|
else
|
||||||
/* increment destination address */
|
/* increment destination address */
|
||||||
dst = sg_dma_address(sg);
|
dst = sg_phys(sg);
|
||||||
|
|
||||||
bytes_to_transfer = sg_dma_len(sg);
|
bytes_to_transfer = sg_dma_len(sg);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue