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

* Re: [PATCH] spi: mvebu: only read from bus when data is needed
  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
  0 siblings, 1 reply; 3+ messages in thread
From: Uwe Kleine-König @ 2016-12-08  9:49 UTC (permalink / raw)
  To: barebox

On Thu, Dec 08, 2016 at 10:39:22AM +0100, Uwe Kleine-König wrote:
> This optimization reduced the time to transfer 40 MB at 50 Hz from
This should be MHz ------------------------------------------^^

Best regards
Uwe
> 214 seconds to 203 seconds.

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

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

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

* Re: [PATCH] spi: mvebu: only read from bus when data is needed
  2016-12-08  9:49 ` Uwe Kleine-König
@ 2016-12-12  5:16   ` Sascha Hauer
  0 siblings, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2016-12-12  5:16 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: barebox

On Thu, Dec 08, 2016 at 10:49:55AM +0100, Uwe Kleine-König wrote:
> On Thu, Dec 08, 2016 at 10:39:22AM +0100, Uwe Kleine-König wrote:
> > This optimization reduced the time to transfer 40 MB at 50 Hz from
> This should be MHz ------------------------------------------^^

Fixed while applying

Sascha

> 
> Best regards
> Uwe
> > 214 seconds to 203 seconds.
> 
> -- 
> Pengutronix e.K.                           | Uwe Kleine-König            |
> Industrial Linux Solutions                 | http://www.pengutronix.de/  |
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
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