[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200615040557.2011-6-mark.tomlinson@alliedtelesis.co.nz>
Date: Mon, 15 Jun 2020 16:05:57 +1200
From: Mark Tomlinson <mark.tomlinson@...iedtelesis.co.nz>
To: broonie@...nel.org, kdasu.kdev@...il.com
Cc: linux-kernel@...r.kernel.org, linux-spi@...r.kernel.org,
Mark Tomlinson <mark.tomlinson@...iedtelesis.co.nz>
Subject: [PATCH 5/5] spi: bcm-qspi: Improve interrupt handling
Acknowledge interrupts correctly and add support for fifo-full
interrupt, distinguishing it from the done interrupt.
Reviewed-by: Callum Sinclair <callum.sinclair@...iedtelesis.co.nz>
Reviewed-by: Chris Packham <chris.packham@...iedtelesis.co.nz>
Signed-off-by: Mark Tomlinson <mark.tomlinson@...iedtelesis.co.nz>
---
drivers/spi/spi-bcm-qspi.c | 11 ++++++-----
drivers/spi/spi-bcm-qspi.h | 5 ++++-
2 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/drivers/spi/spi-bcm-qspi.c b/drivers/spi/spi-bcm-qspi.c
index 0cc51bcda300..3753eff8a154 100644
--- a/drivers/spi/spi-bcm-qspi.c
+++ b/drivers/spi/spi-bcm-qspi.c
@@ -1123,6 +1123,8 @@ static irqreturn_t bcm_qspi_bspi_lr_l2_isr(int irq, void *dev_id)
if (qspi->bspi_rf_op_len == 0) {
qspi->bspi_rf_op = NULL;
if (qspi->soc_intc) {
+ /* Ack BSPI done interrupt */
+ soc_intc->bcm_qspi_int_ack(soc_intc, BSPI_DONE);
/* disable soc BSPI interrupt */
soc_intc->bcm_qspi_int_set(soc_intc, BSPI_DONE,
false);
@@ -1134,11 +1136,10 @@ static irqreturn_t bcm_qspi_bspi_lr_l2_isr(int irq, void *dev_id)
bcm_qspi_bspi_lr_clear(qspi);
else
bcm_qspi_bspi_flush_prefetch_buffers(qspi);
- }
-
- if (qspi->soc_intc)
- /* clear soc BSPI interrupt */
- soc_intc->bcm_qspi_int_ack(soc_intc, BSPI_DONE);
+ } else if (qspi->soc_intc)
+ /* Ack FIFO full interrupt */
+ soc_intc->bcm_qspi_int_ack(soc_intc,
+ BSPI_FIFO_FULL);
}
status &= INTR_BSPI_LR_SESSION_DONE_MASK;
diff --git a/drivers/spi/spi-bcm-qspi.h b/drivers/spi/spi-bcm-qspi.h
index 01aec6460108..b68e275bc721 100644
--- a/drivers/spi/spi-bcm-qspi.h
+++ b/drivers/spi/spi-bcm-qspi.h
@@ -48,7 +48,8 @@ enum {
MSPI_DONE = 0x1,
BSPI_DONE = 0x2,
BSPI_ERR = 0x4,
- MSPI_BSPI_DONE = 0x7
+ MSPI_BSPI_DONE = 0x7,
+ BSPI_FIFO_FULL = 0x8
};
struct bcm_qspi_soc_intc {
@@ -84,6 +85,8 @@ static inline u32 get_qspi_mask(int type)
return INTR_MSPI_DONE_MASK;
case BSPI_DONE:
return BSPI_LR_INTERRUPTS_ALL;
+ case BSPI_FIFO_FULL:
+ return INTR_BSPI_LR_FULLNESS_REACHED_MASK;
case MSPI_BSPI_DONE:
return QSPI_INTERRUPTS_ALL;
case BSPI_ERR:
--
2.27.0
Powered by blists - more mailing lists