]> git.baikalelectronics.ru Git - kernel.git/commit
spi: dw: Disable all IRQs when controller is unused
authorBaikal Electronics <support@baikalelectronics.ru>
Sun, 20 Sep 2020 11:28:50 +0000 (14:28 +0300)
committerMark Brown <broonie@kernel.org>
Tue, 29 Sep 2020 16:22:23 +0000 (17:22 +0100)
commit69cd2c6f0637670e2180e6b821a22e718bb9dcc6
treec72a680a1cab166adebc43e23037e59f82a829db
parent03d5569faffc0ae393d41b4d58d9e14b5329a8fc
spi: dw: Disable all IRQs when controller is unused

It's a good practice to disable all IRQs if a device is fully unused. In
our case it is supposed to be done before requesting the IRQ and after the
last byte of an SPI transfer is received. In the former case it's required
to prevent the IRQ handler invocation before the driver data is fully
initialized (which may happen if the IRQs status has been left uncleared
before the device is probed). So we just moved the spi_hw_init() method
invocation to the earlier stage before requesting the IRQ. In the later
case there is just no point in having any of the IRQs enabled between SPI
transfers and when there is no SPI message currently being processed.

Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
Link: https://lore.kernel.org/r/20200920112914.26501-7-Sergey.Semin@baikalelectronics.ru
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-dw-core.c