[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CADR9n4-iZqUuvBO7M+GCG=H0jks61Os+h8eG3fLOkwBk=CX8Ew@mail.gmail.com>
Date: Thu, 18 Aug 2016 15:23:51 -0700
From: Stephen Barber <smbarber@...omium.org>
To: Hsin-Yu Chao <hychao@...omium.org>
Cc: Dan Williams <dan.j.williams@...el.com>,
Vinod Koul <vinod.koul@...el.com>,
"open list:DMA GENERIC OFFLOAD ENGINE SUBSYSTEM"
<dmaengine@...r.kernel.org>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] dmaengine: pl330: get transfer count for BUSY descriptor
in list
On Thu, Aug 18, 2016 at 4:08 AM, Hsin-Yu Chao <hychao@...omium.org> wrote:
>
> A descrptor of status BUSY could stay in pending list with non-zero
> number of transferred count. In this case we should query the actual
> transfered count or the total residual will be wrong and cause
> unexpected hw_ptr move.
>
> Signed-off-by: Hsin-Yu Chao <hychao@...omium.org>
> ---
> drivers/dma/pl330.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
> index 4fc3ffb..39230d9 100644
> --- a/drivers/dma/pl330.c
> +++ b/drivers/dma/pl330.c
> @@ -2295,7 +2295,7 @@ pl330_tx_status(struct dma_chan *chan, dma_cookie_t cookie,
> list_for_each_entry(desc, &pch->work_list, node) {
> if (desc->status == DONE)
> transferred = desc->bytes_requested;
> - else if (running && desc == running)
> + else if ((running && desc == running) || (desc->status == BUSY))
This doesn't do quite what we want, pl330_get_current_xferred_count is
valid against the current running transfer only. In the case that
there's a BUSY desc in the work queue that hasn't been started yet, or
has already finished, we're going to get an invalid result since the
source address won't match what is in the desc.
> transferred =
> pl330_get_current_xferred_count(pch, desc);
> else
> --
> 2.6.6
>
Powered by blists - more mailing lists