未验证 提交 c7de8500 编写于 作者: M Martin Sperl 提交者: Mark Brown

spi: bcm2835aux: remove dangerous uncontrolled read of fifo

This read of the fifo is a potential candidate for a race condition
as the spi transfer is not necessarily finished and so can lead to
an early read of the fifo that still misses data.

So it has been removed.

Fixes: 1ea29b39 ("spi: bcm2835aux: add bcm2835 auxiliary spi device...")
Suggested-by: NHubert Denkmair <h.denkmair@intence.de>
Signed-off-by: NMartin Sperl <kernel@martin.sperl.org>
Acked-by: NStefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: NMark Brown <broonie@kernel.org>
上级 7188a6f0
......@@ -194,13 +194,6 @@ static void bcm2835aux_spi_transfer_helper(struct bcm2835aux_spi *bs)
BCM2835_AUX_SPI_STAT_TX_FULL))) {
bcm2835aux_wr_fifo(bs);
}
/* and check if we have reached "done" */
while (bs->rx_len &&
(!(bcm2835aux_rd(bs, BCM2835_AUX_SPI_STAT) &
BCM2835_AUX_SPI_STAT_BUSY))) {
bcm2835aux_rd_fifo(bs);
}
}
static irqreturn_t bcm2835aux_spi_interrupt(int irq, void *dev_id)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册