On Fri, 26 Oct 2018 01:32:10 +0900 Tokunori Ikegami <ikegami@xxxxxxxxxxxxxxxxxxxx> wrote: > It is enough to use chip_good() only so chip_ready() is not necessary. I'd like a short explanation saying why chip_good() is enough: chip_good() is doing the same check chip_ready() is doing plus an extra check to make sure we end up with the data we wrote. > For this change the order to check timeout is also needed to chagne. ^change. And I don't think changing the order is a hard requirement, it's just better to avoid the case where the data update happens just after the timeout has expired. To sum-up, I'm okay with the diff, I'd just like the commit message to be adjusted. > > Signed-off-by: Tokunori Ikegami <ikegami@xxxxxxxxxxxxxxxxxxxx> > Cc: Fabio Bettoni <fbettoni@xxxxxxxxx> > Co: Hauke Mehrtens <hauke@xxxxxxxxxx> > Co: Koen Vandeputte <koen.vandeputte@xxxxxxxxxxxx> > Cc: Chris Packham <chris.packham@xxxxxxxxxxxxxxxxxxx> > Cc: Joakim Tjernlund <Joakim.Tjernlund@xxxxxxxxxxxx> > Cc: Boris Brezillon <boris.brezillon@xxxxxxxxxxxxxxxxxx> > Cc: linux-mtd@xxxxxxxxxxxxxxxxxxx > --- > Changes since v2: > - None. > > Changes since v1: > - None. > > drivers/mtd/chips/cfi_cmdset_0002.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c > index 251c9e1675bd..c2e51768a02c 100644 > --- a/drivers/mtd/chips/cfi_cmdset_0002.c > +++ b/drivers/mtd/chips/cfi_cmdset_0002.c > @@ -1882,14 +1882,14 @@ static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip, > continue; > } > > - if (time_after(jiffies, timeo) && !chip_ready(map, adr)) > - break; > - > if (chip_good(map, adr, datum)) { > xip_enable(map, chip, adr); > goto op_done; > } > > + if (time_after(jiffies, timeo)) > + break; > + > /* Latency issues. Drop the lock, wait a while and retry */ > UDELAY(map, chip, adr, 1); > } ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/