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

From: Vinod Koul
Date: Mon Aug 22 2016 - 12:52:49 EST


On Mon, Aug 22, 2016 at 09:27:04AM -0400, Sinan Kaya wrote:
> >>>>> You didn't answer my question!
> >>>>>
> >>>>> On error you said you flush, so who does that?
> >>>>
> >>>> This is done by the driver in interrupt context when an error
> >>>> interrupt is received. All transactions are posted and hw is reset.
> >>>
> >>> Hmmm, waht about the txn which are pending? DO you clear them..?
> >>>
> >>
> >> Yes, I clear both pending and active transactions.
> >
> > Okay, in that case your can consider below:
> >
> > 1. dmaengine asserts error interrupt
> > 2. Driver receives and mark's the txn as error
> > 3. Driver completes the txn and intimates the client. No further
> > submissions. Drop the locks before calling callback, as subsequent
> > processing by client maybe in callback thread.
> > 4. Client invokes status and you can return error
> > 5. On error, client calls terminate_all. You can reset channel, free all
> > descriptors in the active, pending and completed lists
> > 6. Client prepares new txn and so on..
>
>
> Just to be clear, you are telling me not to accept any new transactions until
> terminate_all is called, right?

You may return error for those cases, but my guess is that since you are
interrupt driven, the error propagation in callback and query will be
faster.

--
~Vinod