lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 7 Feb 2019 19:46:54 +0900
From:   Masahiro Yamada <yamada.masahiro@...ionext.com>
To:     Miquel Raynal <miquel.raynal@...tlin.com>
Cc:     linux-mtd <linux-mtd@...ts.infradead.org>,
        Boris Brezillon <boris.brezillon@...tlin.com>,
        Brian Norris <computersforpeace@...il.com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Marek Vasut <marek.vasut@...il.com>,
        Richard Weinberger <richard@....at>,
        David Woodhouse <dwmw2@...radead.org>,
        Boris Brezillon <bbrezillon@...nel.org>
Subject: Re: [PATCH] mtd: rawnand: call onfi_fill_data_interface() once again
 after nand_detect

On Thu, Feb 7, 2019 at 7:16 PM Miquel Raynal <miquel.raynal@...tlin.com> wrote:
>
> Hi Masahiro,
>
> Masahiro Yamada <yamada.masahiro@...ionext.com> wrote on Thu,  7 Feb
> 2019 18:57:56 +0900:
>
> > nand_scan_ident() calls onfi_fill_data_interface() at its entry
> > to set up the initial timing parameters.
> >
> > The timing parameters are needed not only for ->setup_data_interface(),
> > but also for giving the correct delay to NAND_OP_WAIT_RDY, for example.
> >
> > If the driver sets the NAND_KEEP_TIMINGS flag, or does not support
> > ->setup_data_interface() hook, those parameters will never updated.
>
>                                                             ^ be

Will fix (if v2 is welcome)


> >
> > Before nand_detect(), we never know whether the chip is ONFi or not.
> > So, onfi_fill_data_interface() has to assume the worst case, i.e.
> > non-ONFi.
>
> s/ONFi/ONFI/?

Will fix.

Looks like I was misunderstanding
maybe because the letter 'I' in the logo
(http://www.onfi.org/)
looks like a lowercase...




>
> >
> > After nand_detect(), if the chip turns out to be ONFi-compliant,
> > we can optimize tPROG_max, tBERS_max, etc.
> >
> > Call onfi_fill_data_interface() once again.
>
> Sorry but I don't get why this is needed as there is the same call at
> the top of this function. Can you be more specific on where/when the
> missing call produces a failure?


onfi_fill_data_interface() sets different values
for tPROG_max, tBER_max, tR_max, tCCS_min
depending on whether the chip is ONFI or not.

For the first call, onfi_fill_data_interface()
chooses the else-part since we never know
the chip specification at this point.

If we call onfi_fill_data_interface() once again
after nand_detect(), it may choose the if-part.


If a driver supports ->setup_data_interface(),
nand_init_data_interface() will set the optimal
timing parameters anyway.

But, if a driver does not support ->setup_data_interface(),
it will not happen since nand_has_setup_data_iface() returns false.





> >
> > Signed-off-by: Masahiro Yamada <yamada.masahiro@...ionext.com>
> > ---
> >
> >  drivers/mtd/nand/raw/nand_base.c | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c
> > index 9b3d7ff..35e543c 100644
> > --- a/drivers/mtd/nand/raw/nand_base.c
> > +++ b/drivers/mtd/nand/raw/nand_base.c
> > @@ -5040,6 +5040,9 @@ static int nand_scan_ident(struct nand_chip *chip, unsigned int maxchips,
> >
> >       nand_deselect_target(chip);
> >
> > +     /* If the chip turns out ONFi, we can optimize timing parameters. */
> > +     onfi_fill_data_interface(chip, NAND_SDR_IFACE, 0);
> > +
> >       /* Check for a chip array */
> >       for (i = 1; i < maxchips; i++) {
> >               u8 id[2];
>
>
> Thanks,
> Miquèl



-- 
Best Regards
Masahiro Yamada

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ