I told you, we can get rid of that routine :)

On Thu, Jan 24, 2013 at 4:04 PM, Andy Shevchenko
<andriy.shevche...@linux.intel.com> wrote:

I don't see residue - len from interrupt handler. It isn't required?

> @@ -1062,6 +1090,7 @@ dwc_tx_status(struct dma_chan *chan,
>               struct dma_tx_state *txstate)
>  {
>         struct dw_dma_chan      *dwc = to_dw_dma_chan(chan);
> +       unsigned long           flags;
>         enum dma_status         ret;
>
>         ret = dma_cookie_status(chan, cookie, txstate);
> @@ -1071,8 +1100,17 @@ dwc_tx_status(struct dma_chan *chan,
>                 ret = dma_cookie_status(chan, cookie, txstate);
>         }
>
> -       if (ret != DMA_SUCCESS)
> -               dma_set_residue(txstate, dwc_first_active(dwc)->len);
> +       spin_lock_irqsave(&dwc->lock, flags);
> +
> +       if (ret != DMA_SUCCESS) {
> +               u32 residue = dwc->residue;

If you agree with the explanation that i gave in last mail, you must drop lock
right here. and also take it in this if block.

> +               if (test_bit(DW_DMA_IS_SOFT_LLP, &dwc->flags) && residue)
> +                       residue -= dwc_get_sent(dwc);
> +               dma_set_residue(txstate, residue);
> +       }
> +
> +       spin_unlock_irqrestore(&dwc->lock, flags);

other than that:

Acked-by: Viresh Kumar <viresh.ku...@linaro.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to