Skip to content

Commit

Permalink
spi: dw: Unmask IRQs after enabling the chip
Browse files Browse the repository at this point in the history
It's theoretically erroneous to enable IRQ before the chip is turned on.
If IRQ handler gets executed before the chip is enabled, then any data
written to the Tx FIFO will be just ignored.

I say "theoretically" because we haven't noticed any problem with that,
but let's fix it anyway just in case...

Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
Link: https://lore.kernel.org/r/20201007235511.4935-12-Sergey.Semin@baikalelectronics.ru
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Serge Semin authored and Mark Brown committed Oct 8, 2020
1 parent 82d0294 commit da8f589
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/spi/spi-dw-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -376,15 +376,15 @@ static int dw_spi_transfer_one(struct spi_controller *master,
spi_enable_chip(dws, 1);
return ret;
}
} else {
dw_spi_irq_setup(dws);
}

spi_enable_chip(dws, 1);

if (dws->dma_mapped)
return dws->dma_ops->dma_transfer(dws, transfer);

dw_spi_irq_setup(dws);

return 1;
}

Expand Down

0 comments on commit da8f589

Please sign in to comment.