From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH] spi: mvebu: only read from bus when data is needed
Date: Thu, 8 Dec 2016 10:39:22 +0100 [thread overview]
Message-ID: <20161208093922.23194-1-u.kleine-koenig@pengutronix.de> (raw)
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
next reply other threads:[~2016-12-08 9:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-08 9:39 Uwe Kleine-König [this message]
2016-12-08 9:49 ` Uwe Kleine-König
2016-12-12 5:16 ` Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161208093922.23194-1-u.kleine-koenig@pengutronix.de \
--to=u.kleine-koenig@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox