linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org>
To: Hiep Cao Minh <cm-hiep-HEF513clHfp3+QwDJ9on6Q@public.gmane.org>
Cc: DongCV <cv-dong-HEF513clHfp3+QwDJ9on6Q@public.gmane.org>,
	"Mark Brown" <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	"Geert Uytterhoeven"
	<geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>,
	linux-spi <linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"Kuninori Morimoto"
	<kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>,
	"Yoshihiro Shimoda"
	<yoshihiro.shimoda.uh-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>,
	"Ryusuke Sakato"
	<ryusuke.sakato.bx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>,
	Linux-Renesas
	<linux-renesas-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Dung:人ソ <nv-dung-HEF513clHfp3+QwDJ9on6Q@public.gmane.org>,
	稲吉 <h-inayoshi-HEF513clHfp3+QwDJ9on6Q@public.gmane.org>
Subject: Re: [PATCH] spi: rspi: fix the bug related to mount/remount jffs2
Date: Mon, 13 Feb 2017 09:07:54 +0100	[thread overview]
Message-ID: <CAMuHMdU4v=KszacVQ5GX-JVoov0TdfH=+fkpyC505eUWTGpEqg@mail.gmail.com> (raw)
In-Reply-To: <58A15724.1060901-HEF513clHfp3+QwDJ9on6Q@public.gmane.org>

Hi Hiep,

On Mon, Feb 13, 2017 at 7:50 AM, Hiep Cao Minh <cm-hiep-HEF513clHfp3+QwDJ9on6Q@public.gmane.org> wrote:
> Sorry to bother you!

No, thank you for finally make me see my wrong reasoning!

>> qspi_transfer_in() does:
>>
>>          while (n > 0) {
>>                  len = qspi_set_receive_trigger(rspi, n);
>>                  // len will be <= n
>
> I agree. This is len = min value of n and 32.
>>
>>                  if (len == QSPI_BUFFER_SIZE) {
>>                          // receive blocks of len bytes
>
> Yes, This is len == 32 bytes
>>
>>                          ...
>>                  } else {
>>                          // receive n (not len) bytes
>
> This is always n == len ( This case, len or n is always < 32)
> Because this is the last n bytes should be received.

Right.
Doh, I must have missed that if "len < n", the first branch is always taken.

>>                          ret = rspi_pio_transfer(rspi, NULL, rx, n);

It would have been clearer to use "len" here instead of "n".

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
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

  parent reply	other threads:[~2017-02-13  8:07 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-06  1:02 [PATCH] spi: rspi: fix the bug related to mount/remount jffs2 DongCV
2017-02-06 11:02 ` Geert Uytterhoeven
2017-02-07 10:25   ` DongCV
     [not found]     ` <ed0b8422-8ab1-7d8d-318f-343e6e2de17d-HEF513clHfp3+QwDJ9on6Q@public.gmane.org>
2017-02-08  8:58       ` Geert Uytterhoeven
2017-02-13  6:50         ` Hiep Cao Minh
     [not found]           ` <58A15724.1060901-HEF513clHfp3+QwDJ9on6Q@public.gmane.org>
2017-02-13  8:07             ` Geert Uytterhoeven [this message]
2017-02-15  0:26               ` Hiep Cao Minh
2017-02-06 12:46 ` Mark Brown
2017-02-13  8:26   ` Geert Uytterhoeven
2017-02-16 19:05 ` Applied "spi: rspi: Fixes bogus received byte in qspi_transfer_in()" to the spi tree Mark Brown
  -- strict thread matches above, loose matches on Subject: below --
2017-01-27  8:12 [PATCH] spi: rspi: fix the bug related to mount/remount jffs2 DongCV
     [not found] ` <74ea1835-3ce3-612c-ece5-52c8dba0ca87-HEF513clHfp3+QwDJ9on6Q@public.gmane.org>
2017-01-27  9:00   ` Geert Uytterhoeven
     [not found]     ` <CAMuHMdVZOOLGziGm4YdHn_bRB_JOzWEeQ=Ogr8TiB47KTza7OA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-01-27  9:02       ` Geert Uytterhoeven
2017-02-01  7:08       ` DongCV

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='CAMuHMdU4v=KszacVQ5GX-JVoov0TdfH=+fkpyC505eUWTGpEqg@mail.gmail.com' \
    --to=geert-td1emuhucqxl1znqvxdv9g@public.gmane.org \
    --cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=cm-hiep-HEF513clHfp3+QwDJ9on6Q@public.gmane.org \
    --cc=cv-dong-HEF513clHfp3+QwDJ9on6Q@public.gmane.org \
    --cc=geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org \
    --cc=h-inayoshi-HEF513clHfp3+QwDJ9on6Q@public.gmane.org \
    --cc=kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org \
    --cc=linux-renesas-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=nv-dung-HEF513clHfp3+QwDJ9on6Q@public.gmane.org \
    --cc=ryusuke.sakato.bx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org \
    --cc=yoshihiro.shimoda.uh-zM6kxYcvzFBBDgjK7y7TUQ@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).