spi: spi-geni-qcom: Don't keep a local state variable
authorDouglas Anderson <dianders@chromium.org>
Thu, 18 Jun 2020 15:06:26 +0000 (08:06 -0700)
committerMark Brown <broonie@kernel.org>
Fri, 19 Jun 2020 12:25:20 +0000 (13:25 +0100)
commit7ba9bdcb91f694b0eaf486a825afd9c2d99532b7
tree1acb49ff510124195cd586ce71fde4f1ae98a4bf
parent902481a78ee4173926dc59f060526dee21aeb7a8
spi: spi-geni-qcom: Don't keep a local state variable

The variable "cur_mcmd" kept track of our current state (idle, xfer,
cs, cancel).  We don't really need it, so get rid of it.  Instead:
* Use separate condition variables for "chip select done", "cancel
  done", and "abort done".  This is important so that if a "done"
  comes through (perhaps some previous interrupt finally came through)
  it can't confuse the cancel/abort function.
* Use the "done" interrupt only for when a chip select or transfer is
  done and we can tell the difference by looking at whether "cur_xfer"
  is NULL.

This is mostly a no-op change.  However, it is possible it could fix
an issue where a super delayed interrupt for a cancel command could
have confused our waiting for an abort command.

Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Link: https://lore.kernel.org/r/20200618080459.v4.5.Ib1e6855405fc9c99916ab7c7dee84d73a8bf3d68@changeid
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-geni-qcom.c