linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Minor updates for hisi-sfc-v3xx
@ 2021-04-12 11:58 Yicong Yang
  2021-04-12 11:58 ` [PATCH v2 1/2] spi: hisi-sfc-v3xx: fix potential irq race condition Yicong Yang
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Yicong Yang @ 2021-04-12 11:58 UTC (permalink / raw)
  To: broonie, linux-spi; +Cc: john.garry, prime.zeng, yangyicong, linuxarm

This series fix a potential interrupt race condition and
cleanup the ACPI protection for the driver.

Change since v1:
- reword the commit in patch #2
Link: https://lore.kernel.org/linux-spi/1617881505-51552-1-git-send-email-yangyicong@hisilicon.com/

Yicong Yang (2):
  spi: hisi-sfc-v3xx: fix potential irq race condition
  spi: hisi-sfc-v3xx: drop unnecessary ACPI_PTR and related ifendif
    protection

 drivers/spi/spi-hisi-sfc-v3xx.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

-- 
2.8.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2 1/2] spi: hisi-sfc-v3xx: fix potential irq race condition
  2021-04-12 11:58 [PATCH v2 0/2] Minor updates for hisi-sfc-v3xx Yicong Yang
@ 2021-04-12 11:58 ` Yicong Yang
  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
  2 siblings, 0 replies; 4+ messages in thread
From: Yicong Yang @ 2021-04-12 11:58 UTC (permalink / raw)
  To: broonie, linux-spi; +Cc: john.garry, prime.zeng, yangyicong, linuxarm

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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v2 2/2] spi: hisi-sfc-v3xx: drop unnecessary ACPI_PTR and related ifendif protection
  2021-04-12 11:58 [PATCH v2 0/2] Minor updates for hisi-sfc-v3xx Yicong Yang
  2021-04-12 11:58 ` [PATCH v2 1/2] spi: hisi-sfc-v3xx: fix potential irq race condition Yicong Yang
@ 2021-04-12 11:58 ` Yicong Yang
  2021-04-12 19:00 ` [PATCH v2 0/2] Minor updates for hisi-sfc-v3xx Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Yicong Yang @ 2021-04-12 11:58 UTC (permalink / raw)
  To: broonie, linux-spi; +Cc: john.garry, prime.zeng, yangyicong, linuxarm

We use ACPI_PTR() and related ifendif protection for the id table.
This is unnecessary as the struct acpi_device_id is defined in
mod_devicetable.h and doesn't rely on ACPI. The driver doesn't
use any ACPI apis, so it can be compiled in the ACPI=n case
with no warnings.

So remove the ACPI_PTR and related ifendif protection, also
replace the header acpi.h with mod_devicetable.h.

Acked-by: John Garry <john.garry@huawei.com>
Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>
---
 drivers/spi/spi-hisi-sfc-v3xx.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-hisi-sfc-v3xx.c b/drivers/spi/spi-hisi-sfc-v3xx.c
index 0d9e103..d3a23b1 100644
--- a/drivers/spi/spi-hisi-sfc-v3xx.c
+++ b/drivers/spi/spi-hisi-sfc-v3xx.c
@@ -5,13 +5,13 @@
 // Copyright (c) 2019 HiSilicon Technologies Co., Ltd.
 // Author: John Garry <john.garry@huawei.com>
 
-#include <linux/acpi.h>
 #include <linux/bitops.h>
 #include <linux/completion.h>
 #include <linux/dmi.h>
 #include <linux/interrupt.h>
 #include <linux/iopoll.h>
 #include <linux/module.h>
+#include <linux/mod_devicetable.h>
 #include <linux/platform_device.h>
 #include <linux/slab.h>
 #include <linux/spi/spi.h>
@@ -508,18 +508,16 @@ static int hisi_sfc_v3xx_probe(struct platform_device *pdev)
 	return ret;
 }
 
-#if IS_ENABLED(CONFIG_ACPI)
 static const struct acpi_device_id hisi_sfc_v3xx_acpi_ids[] = {
 	{"HISI0341", 0},
 	{}
 };
 MODULE_DEVICE_TABLE(acpi, hisi_sfc_v3xx_acpi_ids);
-#endif
 
 static struct platform_driver hisi_sfc_v3xx_spi_driver = {
 	.driver = {
 		.name	= "hisi-sfc-v3xx",
-		.acpi_match_table = ACPI_PTR(hisi_sfc_v3xx_acpi_ids),
+		.acpi_match_table = hisi_sfc_v3xx_acpi_ids,
 	},
 	.probe	= hisi_sfc_v3xx_probe,
 };
-- 
2.8.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 0/2] Minor updates for hisi-sfc-v3xx
  2021-04-12 11:58 [PATCH v2 0/2] Minor updates for hisi-sfc-v3xx Yicong Yang
  2021-04-12 11:58 ` [PATCH v2 1/2] spi: hisi-sfc-v3xx: fix potential irq race condition Yicong Yang
  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 ` Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2021-04-12 19:00 UTC (permalink / raw)
  To: linux-spi, Yicong Yang; +Cc: Mark Brown, linuxarm, john.garry, prime.zeng

On Mon, 12 Apr 2021 19:58:26 +0800, Yicong Yang wrote:
> This series fix a potential interrupt race condition and
> cleanup the ACPI protection for the driver.
> 
> Change since v1:
> - reword the commit in patch #2
> Link: https://lore.kernel.org/linux-spi/1617881505-51552-1-git-send-email-yangyicong@hisilicon.com/
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/2] spi: hisi-sfc-v3xx: fix potential irq race condition
      commit: 4c84e42d29afa3dce201a4db747db2a5ba404604
[2/2] spi: hisi-sfc-v3xx: drop unnecessary ACPI_PTR and related ifendif protection
      commit: 4a46f88681ca514f9cb33b39312d0ec4e2ec84da

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-04-12 19:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-12 11:58 [PATCH v2 0/2] Minor updates for hisi-sfc-v3xx Yicong Yang
2021-04-12 11:58 ` [PATCH v2 1/2] spi: hisi-sfc-v3xx: fix potential irq race condition Yicong Yang
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

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).