Home Home > GIT Browse > SLE15-AZURE
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-09-10 19:19:54 +0200
committerTakashi Iwai <tiwai@suse.de>2019-09-10 19:20:04 +0200
commitfe6f7032e01d667f3beaf50d3068d7c424c77644 (patch)
treeebabac3614743f04986ac59722024098c26dddf8
parent7dc1b1c579d1f1dd6615b5bfe51eb743745970df (diff)
spi: bcm2835aux: fix corruptions for longer spi transfers
(bsc#1051510). suse-commit: 652bcd32e78dae1c4463a839725006bc5e4ba85f
-rw-r--r--drivers/spi/spi-bcm2835aux.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/spi/spi-bcm2835aux.c b/drivers/spi/spi-bcm2835aux.c
index 7606225be15a..4b8bdc167938 100644
--- a/drivers/spi/spi-bcm2835aux.c
+++ b/drivers/spi/spi-bcm2835aux.c
@@ -180,12 +180,12 @@ static void bcm2835aux_spi_reset_hw(struct bcm2835aux_spi *bs)
static void bcm2835aux_spi_transfer_helper(struct bcm2835aux_spi *bs)
{
+ u32 stat = bcm2835aux_rd(bs, BCM2835_AUX_SPI_STAT);
+
/* check if we have data to read */
- while (bs->rx_len &&
- (!(bcm2835aux_rd(bs, BCM2835_AUX_SPI_STAT) &
- BCM2835_AUX_SPI_STAT_RX_EMPTY))) {
+ for (; bs->rx_len && (stat & BCM2835_AUX_SPI_STAT_RX_LVL);
+ stat = bcm2835aux_rd(bs, BCM2835_AUX_SPI_STAT))
bcm2835aux_rd_fifo(bs);
- }
/* check if we have data to write */
while (bs->tx_len &&