RE: [PATCH v3 02/11] mtd: cfi_cmdset_0002: Remove chip_ready() from do_write_buffer()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sorry for late to reply to the mail below. (The mail was unexpectedly moved from the inbox.)

> -----Original Message-----
> From: Boris Brezillon [mailto:boris.brezillon@xxxxxxxxxxx]
> Sent: Monday, November 05, 2018 10:03 PM
> To: IKEGAMI Tokunori
> Cc: boris.brezillon@xxxxxxxxxxxxxxxxxx; Fabio Bettoni; PACKHAM Chris;
> Joakim Tjernlund; linux-mtd@xxxxxxxxxxxxxxxxxxx
> Subject: Re: [PATCH v3 02/11] mtd: cfi_cmdset_0002: Remove chip_ready()
> from do_write_buffer()
> 
> 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.

I see so I will update as this.

> 
> > For this change the order to check timeout is also needed to chagne.
> 
> 
> 	^change.

Will fix this.

> 
> 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.

I will update as so.

> 
> To sum-up, I'm okay with the diff, I'd just like the commit message
> to be adjusted.

I see.

Regards,
Ikegami

> 
> >
> > 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/



[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux