linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Mark Brown <broonie@kernel.org>
Cc: DongCV <cv-dong@jinso.co.jp>,
	"Geert Uytterhoeven" <geert+renesas@glider.be>,
	linux-spi <linux-spi@vger.kernel.org>,
	"Kuninori Morimoto" <kuninori.morimoto.gx@renesas.com>,
	"Yoshihiro Shimoda" <yoshihiro.shimoda.uh@renesas.com>,
	"Ryusuke Sakato" <ryusuke.sakato.bx@renesas.com>,
	Linux-Renesas <linux-renesas-soc@vger.kernel.org>,
	Dung:人ソ <nv-dung@jinso.co.jp>, 稲吉 <h-inayoshi@jinso.co.jp>,
	"Cao Minh Hiep" <cm-hiep@jinso.co.jp>
Subject: Re: [PATCH] spi: rspi: fix the bug related to mount/remount jffs2
Date: Mon, 13 Feb 2017 09:26:12 +0100	[thread overview]
Message-ID: <CAMuHMdW58idbkvxSAY5L7TK72Va-Rbs=oN44CyUosjP7ajsiGQ@mail.gmail.com> (raw)
In-Reply-To: <20170206124639.eoxom7dxspippjmg@sirena.org.uk>

On Mon, Feb 6, 2017 at 1:46 PM, Mark Brown <broonie@kernel.org> wrote:
> On Mon, Feb 06, 2017 at 10:02:13AM +0900, DongCV wrote:
>> From: Dong <cv-dong@jinso.co.jp>
>>
>> This patch fixes the output warning logs and data loss when
>> performing mount/umount then remount the device with jffs2 format.
>
> This is not a good changelog since it does not describe what the problem
> with the driver is or how the change fixes it - it just says that there
> is a problem.
>
>> This is the warning logs when performing mount/umount then remount the device with jffs2 format:
>> "root@linaro-naro:~# mount -t jffs2 /dev/mtdblock2 /mnt/media
>> [ 3839.928013] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x03b40000: 0x1900 instead
>> [ 3839.956515] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x03b40004: 0x000c instead
>
> Please think hard before including long log messages in upstream
> reports, they often contain almost no useful information relative to
> their size so often obscure the relevant content in your message.  Some
> subset is usually much better (eg, "produces lots of errors like X"
> here).

May I suggest the following:

    spi: rspi: Fix bogus received byte in qspi_transfer_in()

    When there are less than QSPI_BUFFER_SIZE remaining bytes to be received,
    qspi_transfer_in() writes one bogus byte in the receive buffer, possibly
    leading to a buffer overflow.

    This can be reproduced by mounting, unmounting, and remounting a
    jffs2-formatted device, causing lots of warnings like:

        jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found
at 0x03b40000: 0x1900 instead

    Remove the bogus write to fix this.

It's also a good idea to add a Fixes tag:

    Fixes: 3be09bec42a800d4 ("spi: rspi: supports 32bytes buffer for
DUAL and QUAD")

(the code was moved afterwards, but both the origin and the move were
 integrated in v4.10-rc1).

Finally:

    Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.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

  reply	other threads:[~2017-02-13  8:26 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
2017-02-15  0:26               ` Hiep Cao Minh
2017-02-06 12:46 ` Mark Brown
2017-02-13  8:26   ` Geert Uytterhoeven [this message]
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='CAMuHMdW58idbkvxSAY5L7TK72Va-Rbs=oN44CyUosjP7ajsiGQ@mail.gmail.com' \
    --to=geert@linux-m68k.org \
    --cc=broonie@kernel.org \
    --cc=cm-hiep@jinso.co.jp \
    --cc=cv-dong@jinso.co.jp \
    --cc=geert+renesas@glider.be \
    --cc=h-inayoshi@jinso.co.jp \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=nv-dung@jinso.co.jp \
    --cc=ryusuke.sakato.bx@renesas.com \
    --cc=yoshihiro.shimoda.uh@renesas.com \
    /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).