aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYicong Yang <[email protected]>2021-04-12 19:58:27 +0800
committerMark Brown <[email protected]>2021-04-12 17:07:37 +0100
commit4c84e42d29afa3dce201a4db747db2a5ba404604 (patch)
tree14e01ee9644bf811a0e4a5687bb3faef1ecab01c
parent828b480977421e9fbe93ecbdc65689ec7cc1e834 (diff)
spi: hisi-sfc-v3xx: fix potential irq race condition
We mask the irq when the command completion is timeout. This won't stop the already running irq handler. Use sychronize_irq() after we mask the irq, to make sure there is no running handler. Acked-by: John Garry <[email protected]> Signed-off-by: Yicong Yang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
-rw-r--r--drivers/spi/spi-hisi-sfc-v3xx.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/spi/spi-hisi-sfc-v3xx.c b/drivers/spi/spi-hisi-sfc-v3xx.c
index 385eb7bba05a..0d9e10302b66 100644
--- a/drivers/spi/spi-hisi-sfc-v3xx.c
+++ b/drivers/spi/spi-hisi-sfc-v3xx.c
@@ -342,6 +342,7 @@ static int hisi_sfc_v3xx_generic_exec_op(struct hisi_sfc_v3xx_host *host,
ret = 0;
hisi_sfc_v3xx_disable_int(host);
+ synchronize_irq(host->irq);
host->completion = NULL;
} else {
ret = hisi_sfc_v3xx_wait_cmd_idle(host);