All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiada Wang <jiada_wang-nmGgyN9QBj3QT0dZR+AlfA@public.gmane.org>
To: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: <linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	<fixed-term.Oleksij.Rempel-V5te9oGctAVWk0Htik3J/w@public.gmane.org>
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-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>

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.

--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
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.

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

Thread overview: 10+ 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 ` Jiada Wang
2017-02-08  6:20 ` [PATCH 1/2] spi: imx: dynamic burst length adjust for PIO mode Jiada Wang
     [not found]   ` <20170208062028.22313-2-jiada_wang-nmGgyN9QBj3QT0dZR+AlfA@public.gmane.org>
2017-02-14 18:20     ` Mark Brown
2017-02-14 18:20       ` Mark Brown
     [not found]       ` <20170214182019.s3o5uphsfz4bxlkq-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2017-05-01 10:15         ` Jiada Wang [this message]
2017-05-01 10:15           ` Jiada Wang
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-nmggyn9qbj3qt0dzr+alfa@public.gmane.org \
    --cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=fixed-term.Oleksij.Rempel-V5te9oGctAVWk0Htik3J/w@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.