spi: mvebu: only read from bus when data is needed
This optimization reduced the time to transfer 40 MB at 50 MHz from 214 seconds to 203 seconds. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
45791cc9db
commit
dcb880cb85
|
@ -278,12 +278,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;
|
||||
|
|
Loading…
Reference in New Issue