Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1678754

Re: Applied "spi: imx: dynamic burst length adjust for PIO mode" to the spi tree

From Sascha Hauer <s.hauer@pengutronix.de>
Newsgroups linux.kernel
Subject Re: Applied "spi: imx: dynamic burst length adjust for PIO mode" to the spi tree
Date 2017-06-30 14:20 +0200
Message-ID <tY33Y-5nU-9@gated-at.bofh.it> (permalink)
References <tRPwK-5EB-13@gated-at.bofh.it> <tY2Ui-5iT-39@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi Mark,

On Fri, Jun 30, 2017 at 01:00:22PM +0100, Mark Brown wrote:
> The patch
> 
>    spi: imx: dynamic burst length adjust for PIO mode
> 
> has been applied to the spi tree at
> 
>    git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git 

Argh, I wasn't fast enough. I just ran spi-loopback-test.ko with this
patch and it doesn't work properly.

> +	if (spi_imx->count == spi_imx->remainder) {
> +		ctrl = readl(spi_imx->base + MX51_ECSPI_CTRL);
> +		ctrl &= ~MX51_ECSPI_CTRL_BL_MASK;
> +		if (spi_imx->count > MX51_ECSPI_CTRL_MAX_BURST) {
> +			spi_imx->remainder = spi_imx->count %
> +					     MX51_ECSPI_CTRL_MAX_BURST;
> +			val = MX51_ECSPI_CTRL_MAX_BURST;

This is wrong. MX51_ECSPI_CTRL_MAX_BURST contains the burst length in
bytes, but the register 'val' is written to takes the burst length in
bits - 1, so this should be:

			val = MX51_ECSPI_CTRL_MAX_BURST * 8 - 1;

instead.

Sascha

-- 
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 |

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Applied "spi: imx: dynamic burst length adjust for PIO mode" to the spi tree Mark Brown <broonie@kernel.org> - 2017-06-30 14:10 +0200
  Re: Applied "spi: imx: dynamic burst length adjust for PIO mode" to  the spi tree Sascha Hauer <s.hauer@pengutronix.de> - 2017-06-30 14:20 +0200
    Re: Applied "spi: imx: dynamic burst length adjust for PIO mode"  to the spi tree Jiada Wang <jiada_wang@mentor.com> - 2017-06-30 17:00 +0200

csiph-web