Commit da8f5890 authored by Serge Semin's avatar Serge Semin Committed by Mark Brown

spi: dw: Unmask IRQs after enabling the chip

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: default avatarSerge Semin <Sergey.Semin@baikalelectronics.ru>
Link: https://lore.kernel.org/r/20201007235511.4935-12-Sergey.Semin@baikalelectronics.ruSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 82d02944
......@@ -376,8 +376,6 @@ 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);
......@@ -385,6 +383,8 @@ static int dw_spi_transfer_one(struct spi_controller *master,
if (dws->dma_mapped)
return dws->dma_ops->dma_transfer(dws, transfer);
dw_spi_irq_setup(dws);
return 1;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment