From: Yicong Yang <yangyicong@hisilicon.com>
To: <broonie@kernel.org>, <linux-spi@vger.kernel.org>
Cc: <john.garry@huawei.com>, <prime.zeng@huawei.com>,
<yangyicong@hisilicon.com>, <linuxarm@huawei.com>
Subject: [PATCH v2 1/2] spi: hisi-sfc-v3xx: fix potential irq race condition
Date: Mon, 12 Apr 2021 19:58:27 +0800 [thread overview]
Message-ID: <1618228708-37949-2-git-send-email-yangyicong@hisilicon.com> (raw)
In-Reply-To: <1618228708-37949-1-git-send-email-yangyicong@hisilicon.com>
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 <john.garry@huawei.com>
Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>
---
drivers/spi/spi-hisi-sfc-v3xx.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/spi/spi-hisi-sfc-v3xx.c b/drivers/spi/spi-hisi-sfc-v3xx.c
index 385eb7b..0d9e103 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);
--
2.8.1
next prev parent reply other threads:[~2021-04-12 12:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-12 11:58 [PATCH v2 0/2] Minor updates for hisi-sfc-v3xx Yicong Yang
2021-04-12 11:58 ` Yicong Yang [this message]
2021-04-12 11:58 ` [PATCH v2 2/2] spi: hisi-sfc-v3xx: drop unnecessary ACPI_PTR and related ifendif protection Yicong Yang
2021-04-12 19:00 ` [PATCH v2 0/2] Minor updates for hisi-sfc-v3xx Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1618228708-37949-2-git-send-email-yangyicong@hisilicon.com \
--to=yangyicong@hisilicon.com \
--cc=broonie@kernel.org \
--cc=john.garry@huawei.com \
--cc=linux-spi@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=prime.zeng@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).