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

2016-07-31 Thread Timur Tabi
Timur Tabi wrote: It looks to me like 'callback' and 'param' are never actually used. Never mind. I really shouldn't review code before my morning coffee. -- Sent by an employee of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Foru

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

2016-07-31 Thread Timur Tabi
Sinan Kaya wrote: + list_for_each_entry_safe(mdesc, next, &list, node) { enum dma_status llstat; + dma_async_tx_callback callback; + void *param; desc = &mdesc->desc; @@ -132,18 +135,19 @@ static void hidma_process_completed(stru

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

2016-07-31 Thread Sinan Kaya
There is a race condition between data transfer callback and descriptor free code. The callback routine may decide to clear the resources even though the descriptor has not yet been freed. Instead of calling the callback first and then releasing the memory, this code is changing the order to retur