Thread (38 messages) 38 messages, 4 authors, 2011-08-04

[PATCH V2 18/20] dmaengine/amba-pl08x: Add support for sg len greater than one for slave transfers

From: viresh kumar <hidden>
Date: 2011-08-04 10:27:54
Also in: lkml

On 08/01/2011 03:07 PM, Viresh KUMAR wrote:
quoted hunk ↗ jump to hunk
@@ -563,6 +565,7 @@ static int pl08x_fill_llis_for_desc(struct pl08x_driver_data *pl08x,
        u32 cctl, early_bytes = 0;
        size_t max_bytes_per_lli, total_bytes = 0;
+       list_for_each_entry(dsg, &txd->dsg_list, node) {
+               cctl = txd->cctl;

-       /* We need to count this down to zero */
-       bd.remainder = txd->len;
+               bd.srcbus.addr = dsg->src_addr;
+               bd.dstbus.addr = dsg->dst_addr;
+               bd.remainder = dsg->len;
+               bd.srcbus.buswidth = bd.srcbus.maxwidth;
+               bd.dstbus.buswidth = bd.dstbus.maxwidth;
+               if (total_bytes != dsg->len) {
+                       dev_err(&pl08x->adev->dev,
+                               "%s size of encoded lli:s don't match total txd, transferred 0x%08zx from size 0x%08zx\n",
+                               __func__, total_bytes, dsg->len);
+                       return 0;
+               }
        }
Correction:

total_bytes must be reinitialized to zero inside list_for_each_entry loop.
As we are comparing it to dsg->len for every dsg.

Will fix this and send with V3.

-- 
viresh
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help