提交 011710e2 编写于 作者: S Sifan Naeem 提交者: Mark Brown

spi: img-spfi: check for timeout error before proceeding

Calling spfi_wait_all_done is not required if the transfer has timed
out before all data is transferred.

spfi_wait_all_done polls for Alldone interrupt which is triggered to
mark the transfer as complete and to indicate it is now safe to issue
a new transfer.

Fixes: 8c2c8c03 ("spi: img-spfi: Control CS lines with GPIO")
Signed-off-by: NSifan Naeem <sifan.naeem@imgtec.com>
Reviewed-by: NAndrew Bresticker <abrestic@chromium.org>
Signed-off-by: NMark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
上级 bc0195aa
...@@ -266,15 +266,15 @@ static int img_spfi_start_pio(struct spi_master *master, ...@@ -266,15 +266,15 @@ static int img_spfi_start_pio(struct spi_master *master,
cpu_relax(); cpu_relax();
} }
ret = spfi_wait_all_done(spfi);
if (ret < 0)
return ret;
if (rx_bytes > 0 || tx_bytes > 0) { if (rx_bytes > 0 || tx_bytes > 0) {
dev_err(spfi->dev, "PIO transfer timed out\n"); dev_err(spfi->dev, "PIO transfer timed out\n");
return -ETIMEDOUT; return -ETIMEDOUT;
} }
ret = spfi_wait_all_done(spfi);
if (ret < 0)
return ret;
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册