lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 24 Jan 2013 12:48:36 +0200
From:	Andy Shevchenko <andy.shevchenko@...il.com>
To:	Viresh Kumar <viresh.kumar@...aro.org>
Cc:	Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
	Vinod Koul <vinod.koul@...el.com>,
	linux-kernel@...r.kernel.org, spear-devel <spear-devel@...t.st.com>
Subject: Re: [PATCH v3 4/4] dw_dmac: return proper residue value

On Thu, Jan 24, 2013 at 12:45 PM, Viresh Kumar <viresh.kumar@...aro.org> wrote:
> On Thu, Jan 24, 2013 at 4:04 PM, Andy Shevchenko
> <andriy.shevchenko@...ux.intel.com> wrote:
>
> I don't see residue - len from interrupt handler. It isn't required?

Where exactly?

>> @@ -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.

Yes, I agreed with that. Okay, I will move lock inside this 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.kumar@...aro.org>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/



-- 
With Best Regards,
Andy Shevchenko
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ