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] [day] [month] [year] [list]
Message-ID: <MN2PR08MB59517D405930FAEF5C09D766B81E0@MN2PR08MB5951.namprd08.prod.outlook.com>
Date:   Tue, 28 May 2019 15:46:10 +0000
From:   "Shivamurthy Shastri (sshivamurthy)" <sshivamurthy@...ron.com>
To:     Miquel Raynal <miquel.raynal@...tlin.com>
CC:     Boris Brezillon <bbrezillon@...nel.org>,
        "linux-mtd@...ts.infradead.org" <linux-mtd@...ts.infradead.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Richard Weinberger <richard@....at>,
        David Woodhouse <dwmw2@...radead.org>,
        Brian Norris <computersforpeace@...il.com>,
        Marek Vasut <marek.vasut@...il.com>,
        Frieder Schrempf <frieder.schrempf@...eet.de>
Subject: RE: [EXT] Re: [PATCH 3/4] mtd: spinand: Enabled support to detect
 parameter page

Hi Miquel,

> > >
> > > > Some of the SPI NAND devices has parameter page which is similar to
> ONFI
> > > > table.
> > > >
> > > > But, it may not be self sufficient to propagate all the required
> > > > parameters. Fixup function has been added in struct manufacturer to
> > > > accommodate this.
> > > >
> > > > Signed-off-by: Shivamurthy Shastri <sshivamurthy@...ron.com>
> > > > ---
> > > >  drivers/mtd/nand/spi/core.c | 113
> > > +++++++++++++++++++++++++++++++++++-
> > > >  include/linux/mtd/spinand.h |   5 ++
> > > >  2 files changed, 117 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c
> > > > index 985ad52cdaa7..40882a1d2bc1 100644
> > > > --- a/drivers/mtd/nand/spi/core.c
> > > > +++ b/drivers/mtd/nand/spi/core.c
> > > > @@ -574,6 +574,108 @@ static int spinand_lock_block(struct
> > > spinand_device *spinand, u8 lock)
> > > >  	return spinand_write_reg_op(spinand, REG_BLOCK_LOCK, lock);
> > > >  }
> > > >
> > > > +/**
> > > > + * spinand_read_param_page_op - Read parameter page operation
> > > > + * @spinand: the spinand device
> > > > + * @page: page number where parameter page tables can be found
> > > > + * @parameters: buffer used to store the parameter page
> > >
> > > Does not match the prototype
> >
> > I will fix this in next version.
> >
> > >
> > > > + * @len: length of the buffer
> > > > + *
> > > > + * Read parameter page
> > > > + *
> > > > + * Returns 0 on success, a negative error code otherwise.
> > > > + */
> > > > +static int spinand_parameter_page_read(struct nand_device *base,
> > >
> > > Please use a spinand structure as parameter, you don't need a
> > > nand_device here (same for other spinand functions).
> >
> > This function is helper function for generic ONFI layer.
> > From generic ONFI layer, I can get only nand_device.
> 
> How do you handle if the SPI NAND core is not compiled-in?
> 

Both raw NAND and SPI NAND define parameter_page_read function,
which will be called in nand_onfi_detect.

Rightly you pointed, I will add the following lines in nand_onfi_detect
to tackle if those functions are not compiled-in.

        /* return 0, if ONFI helper functions are not defined */                 
        if (!base->helper.parameter_page_read &&                                 
            !base->helper.check_revision &&                                      
            !base->helper.init_intf_data)                                        
                return 0;

I hope this answers your point.

Thanks,
Shiva

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ