Skip to content

Commit b867eef

Browse files
cpackham-atlnzbroonie
authored andcommitted
spi: fsl-espi: Only process interrupts for expected events
The SPIE register contains counts for the TX FIFO so any time the irq handler was invoked we would attempt to process the RX/TX fifos. Use the SPIM value to mask the events so that we only process interrupts that were expected. This was a latent issue exposed by commit 3282a3d ("powerpc/64: Implement soft interrupt replay in C"). Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz> Link: https://lore.kernel.org/r/20200904002812.7300-1-chris.packham@alliedtelesis.co.nz Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 50851f5 commit b867eef

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

drivers/spi/spi-fsl-espi.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -564,13 +564,14 @@ static void fsl_espi_cpu_irq(struct fsl_espi *espi, u32 events)
564564
static irqreturn_t fsl_espi_irq(s32 irq, void *context_data)
565565
{
566566
struct fsl_espi *espi = context_data;
567-
u32 events;
567+
u32 events, mask;
568568

569569
spin_lock(&espi->lock);
570570

571571
/* Get interrupt events(tx/rx) */
572572
events = fsl_espi_read_reg(espi, ESPI_SPIE);
573-
if (!events) {
573+
mask = fsl_espi_read_reg(espi, ESPI_SPIM);
574+
if (!(events & mask)) {
574575
spin_unlock(&espi->lock);
575576
return IRQ_NONE;
576577
}

0 commit comments

Comments
 (0)