Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1456948

Re: [PATCH] dmaengine: qcom_hidma: release the descriptor before the callback

From Lars-Peter Clausen <lars@metafoo.de>
Newsgroups linux.kernel
Subject Re: [PATCH] dmaengine: qcom_hidma: release the descriptor before the callback
Date 2016-08-05 10:40 +0200
Message-ID <s2IPD-561-3@gated-at.bofh.it> (permalink)
References (7 earlier) <s2sUx-2Lw-17@gated-at.bofh.it> <s2sUx-2Lw-15@gated-at.bofh.it> <s2tnA-3cA-39@gated-at.bofh.it> <s2txg-3gC-13@gated-at.bofh.it> <s2GXv-3Uf-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 08/05/2016 08:32 AM, Robert Jarzmik wrote:
> Lars-Peter Clausen <lars@metafoo.de> writes:
> 
>> On 08/04/2016 06:08 PM, Sinan Kaya wrote:
>> [...]
>>> The other way is I can feed this information to what Dave just introduced
>>> as part of the callback mechanism and not touch this.
>>
>> Use the callback mechanism. It is a lot easier to implement correctly than
>> the tx_status() mechanism.
>>
>>> The main discussion here is that 
>>>
>>> "tx_status does not indicate whether the final transaction is successful or
>>> not" whether the driver has the capability to determine error or not.
>>
>> tx_status() is supposed to be able to indicate whether a transfer failed or
>> not. But in my opinion this feature is broken by design and implementing it
>> correctly is very difficult without creating memory leaks. Which is probably
>> why so few drivers actually implement it.
> 
> I think you can implement the error reporting by remembering the "last" cookie
> where an error occurred such as in :
>  - e093bf60ca49 ("dmaengine: pxa: handle bus errors")
>    => see the part of the commit beginning with "As dma_cookie_status() ..."
> 
> The point about error reporting was already discussed  with Vinod in here:
>    https://lkml.org/lkml/2016/4/13/471
>    => Vinod and I were seeing the reporting can be improved

But that allows you only to report the error for the last descriptor that
failed. If two or more have failed any but the last will return DMA_COMPLETE
instead of DMA_ERROR. In your case that sort of works because you completely
stop execution after a descriptor failed. But as you noted in the commit
message this will report misleading status values for the descriptors after
the descriptor that failed.

I believe we need to invest some effort to come up with clear semantics on
what is the expected behavior when transferring a descriptor fails.
Potentially allowing clients to choose the desired behavior, e.g. either
abort all descriptors on error or continue with the next one.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH] dmaengine: qcom_hidma: release the descriptor before the  callback Vinod Koul <vinod.koul@intel.com> - 2016-08-04 14:50 +0200
  Re: [PATCH] dmaengine: qcom_hidma: release the descriptor before the  callback Sinan Kaya <okaya@codeaurora.org> - 2016-08-04 16:20 +0200
    Re: [PATCH] dmaengine: qcom_hidma: release the descriptor before the  callback Russell King - ARM Linux <linux@armlinux.org.uk> - 2016-08-04 16:50 +0200
      Re: [PATCH] dmaengine: qcom_hidma: release the descriptor before the  callback Russell King - ARM Linux <linux@armlinux.org.uk> - 2016-08-04 17:40 +0200
        Re: [PATCH] dmaengine: qcom_hidma: release the descriptor before the  callback Sinan Kaya <okaya@codeaurora.org> - 2016-08-04 18:10 +0200
          Re: [PATCH] dmaengine: qcom_hidma: release the descriptor before the  callback Lars-Peter Clausen <lars@metafoo.de> - 2016-08-04 18:20 +0200
            Re: [PATCH] dmaengine: qcom_hidma: release the descriptor before the callback Robert Jarzmik <robert.jarzmik@free.fr> - 2016-08-05 08:40 +0200
              Re: [PATCH] dmaengine: qcom_hidma: release the descriptor before the  callback Lars-Peter Clausen <lars@metafoo.de> - 2016-08-05 10:40 +0200
                Re: [PATCH] dmaengine: qcom_hidma: release the descriptor before the  callback Sinan Kaya <okaya@codeaurora.org> - 2016-08-05 17:20 +0200
        Re: [PATCH] dmaengine: qcom_hidma: release the descriptor before the  callback Lars-Peter Clausen <lars@metafoo.de> - 2016-08-04 18:10 +0200
          Re: [PATCH] dmaengine: qcom_hidma: release the descriptor before the  callback Vinod Koul <vinod.koul@intel.com> - 2016-08-08 11:10 +0200
            Re: [PATCH] dmaengine: qcom_hidma: release the descriptor before the  callback Lars-Peter Clausen <lars@metafoo.de> - 2016-08-08 14:30 +0200
              Re: [PATCH] dmaengine: qcom_hidma: release the descriptor before the  callback Vinod Koul <vinod.koul@intel.com> - 2016-08-10 20:50 +0200
      Re: [PATCH] dmaengine: qcom_hidma: release the descriptor before the  callback Sinan Kaya <okaya@codeaurora.org> - 2016-08-04 17:40 +0200
        Re: [PATCH] dmaengine: qcom_hidma: release the descriptor before the  callback Vinod Koul <vinod.koul@intel.com> - 2016-08-08 11:00 +0200
          Re: [PATCH] dmaengine: qcom_hidma: release the descriptor before the  callback Sinan Kaya <okaya@codeaurora.org> - 2016-08-08 16:50 +0200
            Re: [PATCH] dmaengine: qcom_hidma: release the descriptor before the  callback Vinod Koul <vinod.koul@intel.com> - 2016-08-10 21:00 +0200
              Re: [PATCH] dmaengine: qcom_hidma: release the descriptor before the  callback Sinan Kaya <okaya@codeaurora.org> - 2016-08-10 22:50 +0200
    Re: [PATCH] dmaengine: qcom_hidma: release the descriptor before the  callback Vinod Koul <vinod.koul@intel.com> - 2016-08-08 10:50 +0200
      Re: [PATCH] dmaengine: qcom_hidma: release the descriptor before the  callback okaya@codeaurora.org - 2016-08-08 14:20 +0200

csiph-web