On Wed, 2018-06-20 at 11:25 +0200, Boris Brezillon wrote: > > > On Wed, 6 Jun 2018 12:13:30 +0200 > Joakim Tjernlund <joakim.tjernlund@xxxxxxxxxxxx> wrote: > > > cfi_ppb_unlock() walks all flash chips when unlocking sectors, > > avoid walking chips unaffected by the unlock operation. > > > > Fixes: 1648eaaa1575 ("mtd: cfi_cmdset_0002: Support Persistent Protection Bits (PPB) locking") > > Cc: stable@xxxxxxxxxxxxxxx > > That's clearly not a fix, just an optimization. You should drop the > Fixes and Cc-stable tags. It sure IS! The code never intended to do this and it is just bad luck that nothing bad happened and I sure don't want to walk all 4 chips we have, stealing CPU and keeping the flash busy just because I am using stable. Given I have moved on now and we disagree, I will not reword and resubmit any time soon. Feel free to do needed edits though. Jocke > > > Signed-off-by: Joakim Tjernlund <joakim.tjernlund@xxxxxxxxxxxx> > > --- > > v2 - Spilt into several patches > > > > drivers/mtd/chips/cfi_cmdset_0002.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c > > index b6273ce83de7..62cd4ee280b3 100644 > > --- a/drivers/mtd/chips/cfi_cmdset_0002.c > > +++ b/drivers/mtd/chips/cfi_cmdset_0002.c > > @@ -2686,6 +2686,8 @@ static int __maybe_unused cfi_ppb_unlock(struct mtd_info *mtd, loff_t ofs, > > i++; > > > > if (adr >> cfi->chipshift) { > > + if (offset >= (ofs + len)) > > + break; > > adr = 0; > > chipnum++; > > > >