mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] spi: mvebu: only read from bus when data is needed
@ 2016-12-08  9:39 Uwe Kleine-König
  2016-12-08  9:49 ` Uwe Kleine-König
  0 siblings, 1 reply; 3+ messages in thread
From: Uwe Kleine-König @ 2016-12-08  9:39 UTC (permalink / raw)
  To: barebox

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@pengutronix.de>
---
 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@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-12-12  5:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-08  9:39 [PATCH] spi: mvebu: only read from bus when data is needed Uwe Kleine-König
2016-12-08  9:49 ` Uwe Kleine-König
2016-12-12  5:16   ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox