public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jiada Wang <jiada_wang@mentor.com>
To: Mark Brown <broonie@kernel.org>
Cc: <linux-spi@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<fixed-term.Oleksij.Rempel@de.bosch.com>
Subject: Re: [PATCH 1/2] spi: imx: dynamic burst length adjust for PIO mode
Date: Mon, 1 May 2017 03:15:49 -0700	[thread overview]
Message-ID: <59070AD5.7030405@mentor.com> (raw)
In-Reply-To: <20170214182019.s3o5uphsfz4bxlkq@sirena.org.uk>

Hello Mark

Sorry, somehow I missed your following comment

On 02/14/2017 10:20 AM, Mark Brown wrote:
> On Wed, Feb 08, 2017 at 03:20:27PM +0900, Jiada Wang wrote:
>
> This looks basically fine, a couple of fairly minor things here:
>
>> +	for (i = 0; i<  transfer->len / 4; i++) {
>> +		u8 temp;
>> +
>> +		temp = *(buf + i * 4);
>> +		*(buf + i * 4) = *(buf + i * 4 + 3);
>> +		*(buf + i * 4 + 3) = temp;
> Should this be using one of the cpu_to_ functions?  It's a bit unclear
> what the goal is here and if it'll work if the kernel is big endian
> (which people do do with i.MX systems IIRC).
indeed, with big endian kernel, this function won't work
I will replace the algo here with cpu_to_* in next version

Thanks,
Jiada

>> +	if (spi_imx->bpw_w == 1)
>> +		spi_imx_buf_rx_u8(spi_imx);
>> +	else if (spi_imx->bpw_w == 2)
>> +		spi_imx_buf_rx_u16(spi_imx);
> switch statement please.
>
>> +	if (spi_imx->dynamic_burst) {
>> +		spi_imx->count_index =
>> +				spi_imx->count>  MX51_ECSPI_CTRL_MAX_BURST ?
>> +				spi_imx->count % MX51_ECSPI_CTRL_MAX_BURST :
>> +				spi_imx->count % sizeof(u32);
> Just write a normal if statement please, it's easier to read.

  reply	other threads:[~2017-05-01 10:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-08  6:20 [PATCH linux-next v1 0/2] improve imx spi performance Jiada Wang
2017-02-08  6:20 ` [PATCH 1/2] spi: imx: dynamic burst length adjust for PIO mode Jiada Wang
2017-02-14 18:20   ` Mark Brown
2017-05-01 10:15     ` Jiada Wang [this message]
2017-02-08  6:20 ` [PATCH 2/2] spi: imx: dynamic burst length adjust for DMA mode Jiada Wang
2017-02-08  8:46   ` kbuild test robot
2017-02-08 10:59   ` kbuild test robot

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=59070AD5.7030405@mentor.com \
    --to=jiada_wang@mentor.com \
    --cc=broonie@kernel.org \
    --cc=fixed-term.Oleksij.Rempel@de.bosch.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.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