From: Boris Brezillon <boris.brezillon@bootlin.com>
To: Joakim Tjernlund <Joakim.Tjernlund@infinera.com>
Cc: "stable@vger.kernel.org" <stable@vger.kernel.org>,
"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>
Subject: Re: [PATCH v2 3/4] mtd: cfi_cmdset_0002: Avoid point less unlocking/locking
Date: Wed, 20 Jun 2018 13:54:49 +0200 [thread overview]
Message-ID: <20180620135449.14f9919c@bbrezillon> (raw)
In-Reply-To: <d8e1537549e42dfc873c1fac876e2a898f11efd0.camel@infinera.com>
On Wed, 20 Jun 2018 11:10:23 +0000
Joakim Tjernlund <Joakim.Tjernlund@infinera.com> wrote:
> On Wed, 2018-06-20 at 11:14 +0200, Boris Brezillon wrote:
> > CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
> >
> >
> > On Wed, 6 Jun 2018 12:13:29 +0200
> > Joakim Tjernlund <joakim.tjernlund@infinera.com> wrote:
> >
> > > cfi_ppb_unlock() walks all flash chips when unlocking sectors.
> > > testing lock status on each chip which causes relocking of already
> > > locked sectors. Test against offset to aviod this aliasing.
> >
> > ^ avoid
> >
> > As I said before, I think the current code is doing worse than just
> > relocking already locked sectors. As soon as you cross a chip boundary,
> > addr is set back to 0, and the (addr < offs || adr >= (ofs + len)) might
> > be true while it shouldn't be (absolute offset still in the unlock
> > range), which means you'll lock sectors that the caller expect to be
> > unlocked.
>
> I don't see how, the code asks for its current lock status and will reapply
> those that are locked again.
After reading the commit message a second time I think I
misunderstood it. I thought you were implying that the re-locking
operation was harmless and the only reason for fixing the test was to
avoid useless lock operations, but that's not what you wrote.
Sorry for the noise.
next prev parent reply other threads:[~2018-06-20 11:55 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-05 14:07 [PATCH 1/2] mtd: cfi_cmdset_0002: fix SEGV unlocking multiple chips Joakim Tjernlund
2018-06-05 14:07 ` [PATCH 2/2] mtd: cfi_cmdset_0002: Avoid point less unlocking/locking Joakim Tjernlund
2018-06-05 15:14 ` Boris Brezillon
2018-06-05 16:57 ` Joakim Tjernlund
2018-06-06 10:15 ` Joakim Tjernlund
2018-06-19 17:23 ` Joakim Tjernlund
2018-06-05 15:02 ` [PATCH 1/2] mtd: cfi_cmdset_0002: fix SEGV unlocking multiple chips Boris Brezillon
2018-06-05 15:26 ` Boris Brezillon
2018-06-05 15:33 ` Joakim Tjernlund
2018-06-06 10:13 ` [PATCH v2 1/4] mtd: cfi_cmdset_0002: Use right chip in do_ppb_xxlock() Joakim Tjernlund
2018-06-06 10:13 ` [PATCH v2 2/4] mtd: cfi_cmdset_0002: fix SEGV unlocking multiple chips Joakim Tjernlund
2018-06-20 9:06 ` Boris Brezillon
2018-06-06 10:13 ` [PATCH v2 3/4] mtd: cfi_cmdset_0002: Avoid point less unlocking/locking Joakim Tjernlund
2018-06-20 9:14 ` Boris Brezillon
2018-06-20 11:10 ` Joakim Tjernlund
2018-06-20 11:54 ` Boris Brezillon [this message]
2018-06-06 10:13 ` [PATCH v2 4/4] mtd: cfi_cmdset_0002: Avoid walking all chips when unlocking Joakim Tjernlund
2018-06-20 9:25 ` Boris Brezillon
2018-06-20 11:10 ` Joakim Tjernlund
2018-06-20 12:19 ` Boris Brezillon
2018-06-20 15:07 ` Joakim Tjernlund
2018-06-20 9:03 ` [PATCH v2 1/4] mtd: cfi_cmdset_0002: Use right chip in do_ppb_xxlock() Boris Brezillon
2018-06-20 11:10 ` Joakim Tjernlund
2018-06-22 11:35 ` Boris Brezillon
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=20180620135449.14f9919c@bbrezillon \
--to=boris.brezillon@bootlin.com \
--cc=Joakim.Tjernlund@infinera.com \
--cc=linux-mtd@lists.infradead.org \
--cc=stable@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;
as well as URLs for NNTP newsgroup(s).