[PATCH] spi: mvebu: only read from bus when data is needed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This optimization reduced the time to transfer 40 MB at 50 Hz from
214 seconds to 203 seconds.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx>
---
 drivers/spi/mvebu_spi.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/spi/mvebu_spi.c b/drivers/spi/mvebu_spi.c
index 58ac6057afe3..68838c0ce184 100644
--- a/drivers/spi/mvebu_spi.c
+++ b/drivers/spi/mvebu_spi.c
@@ -300,12 +300,12 @@ static int mvebu_spi_do_transfer(struct spi_device *spi,
 			return ret;
 		}
 
-		data = readl(priv->base + SPI_DATA_IN);
-
-		if (rxdata)
+		if (rxdata) {
+			data = readl(priv->base + SPI_DATA_IN);
 			*rxdata++ = (data & 0xff);
-		if (rxdata && priv->data16)
-			*rxdata++ = (data >> 8) & 0xff;
+			if (priv->data16)
+				*rxdata++ = (data >> 8) & 0xff;
+		}
 	}
 
 	return 0;
-- 
2.10.2


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox




[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux