linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/1] Fix shared IRQ behavior in spi-fsl-dspi
@ 2019-08-22 21:24 Vladimir Oltean
  2019-08-22 21:24 ` [PATCH 1/1] spi: spi-fsl-dspi: Exit the ISR with IRQ_NONE when it's not ours Vladimir Oltean
  2019-08-23 10:56 ` [PATCH 0/1] Fix shared IRQ behavior in spi-fsl-dspi Mark Brown
  0 siblings, 2 replies; 5+ messages in thread
From: Vladimir Oltean @ 2019-08-22 21:24 UTC (permalink / raw)
  To: broonie; +Cc: linux-spi, linux-kernel, Vladimir Oltean

This patch is taken out of the "Poll mode for NXP DSPI driver" series
and respun against the "for-4.20" branch.
$(git describe --tags 13aed2392741) shows:
v4.20-rc1-18-g13aed2392741

Vladimir Oltean (1):
  spi: spi-fsl-dspi: Exit the ISR with IRQ_NONE when it's not ours

 drivers/spi/spi-fsl-dspi.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

-- 
2.17.1

^ permalink raw reply	[flat|nested] 5+ messages in thread
* [PATCH v2 2/5] spi: spi-fsl-dspi: Exit the ISR with IRQ_NONE when it's not ours
@ 2019-08-22 21:15 Vladimir Oltean
  2019-08-23 11:02 ` Applied "spi: spi-fsl-dspi: Exit the ISR with IRQ_NONE when it's not ours" to the spi tree Mark Brown
  0 siblings, 1 reply; 5+ messages in thread
From: Vladimir Oltean @ 2019-08-22 21:15 UTC (permalink / raw)
  To: broonie; +Cc: linux-spi, linux-kernel, devicetree, netdev, Vladimir Oltean

The DSPI interrupt can be shared between two controllers at least on the
LX2160A. In that case, the driver for one controller might misbehave and
consume the other's interrupt. Fix this by actually checking if any of
the bits in the status register have been asserted.

Fixes: 13aed2392741 ("spi: spi-fsl-dspi: use IRQF_SHARED mode to request IRQ")
Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
---
 drivers/spi/spi-fsl-dspi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-fsl-dspi.c b/drivers/spi/spi-fsl-dspi.c
index c90db7db4121..6ef2279a3699 100644
--- a/drivers/spi/spi-fsl-dspi.c
+++ b/drivers/spi/spi-fsl-dspi.c
@@ -659,7 +659,7 @@ static irqreturn_t dspi_interrupt(int irq, void *dev_id)
 	regmap_write(dspi->regmap, SPI_SR, spi_sr);
 
 	if (!(spi_sr & (SPI_SR_EOQF | SPI_SR_TCFQF)))
-		return IRQ_HANDLED;
+		return IRQ_NONE;
 
 	/* Get transfer counter (in number of SPI transfers). It was
 	 * reset to 0 when transfer(s) were started.
-- 
2.17.1

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

end of thread, other threads:[~2019-08-23 11:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-22 21:24 [PATCH 0/1] Fix shared IRQ behavior in spi-fsl-dspi Vladimir Oltean
2019-08-22 21:24 ` [PATCH 1/1] spi: spi-fsl-dspi: Exit the ISR with IRQ_NONE when it's not ours Vladimir Oltean
2019-08-23 10:46   ` Applied "spi: spi-fsl-dspi: Exit the ISR with IRQ_NONE when it's not ours" to the spi tree Mark Brown
2019-08-23 10:56 ` [PATCH 0/1] Fix shared IRQ behavior in spi-fsl-dspi Mark Brown
  -- strict thread matches above, loose matches on Subject: below --
2019-08-22 21:15 [PATCH v2 2/5] spi: spi-fsl-dspi: Exit the ISR with IRQ_NONE when it's not ours Vladimir Oltean
2019-08-23 11:02 ` Applied "spi: spi-fsl-dspi: Exit the ISR with IRQ_NONE when it's not ours" to the spi tree 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).