Re: [PATCH v4 5/5] spi: spi-geni-qcom: Don't keep a local state variable

From: Stephen Boyd
Date: Thu Jun 18 2020 - 14:05:28 EST


Quoting Douglas Anderson (2020-06-18 08:06:26)
> @@ -126,20 +120,23 @@ static void handle_fifo_timeout(struct spi_master *spi,
> struct geni_se *se = &mas->se;
>
> spin_lock_irq(&mas->lock);
> - reinit_completion(&mas->xfer_done);
> - mas->cur_mcmd = CMD_CANCEL;
> - geni_se_cancel_m_cmd(se);
> + reinit_completion(&mas->cancel_done);
> writel(0, se->base + SE_GENI_TX_WATERMARK_REG);
> + mas->cur_xfer = NULL;

BTW, is this necessary? It's subtlely placed here without a comment why.

> + mas->tx_rem_bytes = mas->rx_rem_bytes = 0;
> + geni_se_cancel_m_cmd(se);
> spin_unlock_irq(&mas->lock);
> - time_left = wait_for_completion_timeout(&mas->xfer_done, HZ);