Re: [PATCH v2 2/4] spi: spi-geni-qcom: Fail new xfers if xfer/cancel/abort pending

From: Stephen Boyd
Date: Thu Dec 17 2020 - 21:54:31 EST


Quoting Doug Anderson (2020-12-17 13:45:18)
>
> On Wed, Dec 16, 2020 at 8:21 PM Stephen Boyd <swboyd@xxxxxxxxxxxx> wrote:
> >
> > if (M_CMD_CANCEL_EN || M_CMD_ABORT_EN) /* but not the other irqs like CMD_DONE or refill fifos */
> > writel(M_CMD_CANCEL_EN | M_CMD_ABORT_EN, se->base + SE_GENI_M_IRQ_CLEAR);
> >
> > This would let us limp along and try to send another transfer in the
> > case that we timed out but the transfer went through by servicing our
> > own interrupt.
>
> A few problems:
>
> 1. The cancel and abort are commands and they generate a "done"
> interrupt along with their "cancel" and/or "abort". Clearing the
> cancel/abort without the done will leave things in a much more
> confused state.

Ah I didn't know that the DONE bit was set even for cancel/abort, but
that makes sense given that it's a sequencer and everything that goes
into the sequencer eventually gets "DONE". I agree if the DONE bit
hanging around that really confuses stuff, so best to ignore it and
figure out why interrupt latencies are leading to this problem.