[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190819111918.6be79570@xps13>
Date: Mon, 19 Aug 2019 11:19:18 +0200
From: Miquel Raynal <miquel.raynal@...tlin.com>
To: "Shivamurthy Shastri (sshivamurthy)" <sshivamurthy@...ron.com>
Cc: Richard Weinberger <richard@....at>,
David Woodhouse <dwmw2@...radead.org>,
Brian Norris <computersforpeace@...il.com>,
Marek Vasut <marek.vasut@...il.com>,
Vignesh Raghavendra <vigneshr@...com>,
Boris Brezillon <bbrezillon@...nel.org>,
Marcel Ziswiler <marcel.ziswiler@...adex.com>,
Frieder Schrempf <frieder.schrempf@...tron.de>,
"linux-mtd@...ts.infradead.org" <linux-mtd@...ts.infradead.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Jeff Kletsky <git-commits@...ycomm.com>,
Chuanhong Guo <gch981213@...il.com>,
liaoweixiong <liaoweixiong@...winnertech.com>
Subject: Re: [EXT] Re: [PATCH 6/8] mtd: spinand: micron: Turn driver
implementation generic
Hi Boris,
I need your opinion on the question below.
"Shivamurthy Shastri (sshivamurthy)" <sshivamurthy@...ron.com> wrote on
Mon, 19 Aug 2019 09:03:38 +0000:
> Hi Miquel,
>
> >
> > Hi Shiva,
> >
> > shiva.linuxworks@...il.com wrote on Mon, 22 Jul 2019 07:56:19 +0200:
> >
> > > From: Shivamurthy Shastri <sshivamurthy@...ron.com>
> > >
> >
> > I am not sure the "turn implemenatation generic" title describes what
> > you do.
> >
> > > Driver is redesigned using parameter page to support Micron SPI NAND
> > > flashes.
> >
> > Redesigned is perhaps a bit too much.
> >
> > "
> > > The reason why spinand_select_op_variant globalized is that the Micron
> > > driver no longer calling spinand_match_and_init.
> > >
> > > Signed-off-by: Shivamurthy Shastri <sshivamurthy@...ron.com>
> > > ---
> > > drivers/mtd/nand/spi/core.c | 2 +-
> > > drivers/mtd/nand/spi/micron.c | 61 +++++++++++++++++++++++++-------
> > ---
> > > include/linux/mtd/spinand.h | 4 +++
> > > 3 files changed, 49 insertions(+), 18 deletions(-)
> > >
> > > diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c
> > > index 7ae76dab9141..aae715d388b7 100644
> > > --- a/drivers/mtd/nand/spi/core.c
> > > +++ b/drivers/mtd/nand/spi/core.c
> > > @@ -920,7 +920,7 @@ static void spinand_manufacturer_cleanup(struct
> > spinand_device *spinand)
> > > return spinand->manufacturer->ops->cleanup(spinand);
> > > }
> > >
> > > -static const struct spi_mem_op *
> > > +const struct spi_mem_op *
> > > spinand_select_op_variant(struct spinand_device *spinand,
> > > const struct spinand_op_variants *variants)
> > > {
> > > diff --git a/drivers/mtd/nand/spi/micron.c
> > b/drivers/mtd/nand/spi/micron.c
> > > index 95bc5264ebc1..6fde93ec23a1 100644
> > > --- a/drivers/mtd/nand/spi/micron.c
> > > +++ b/drivers/mtd/nand/spi/micron.c
> > > @@ -90,22 +90,10 @@ static int micron_ecc_get_status(struct
> > spinand_device *spinand,
> > > return -EINVAL;
> > > }
> > >
> > > -static const struct spinand_info micron_spinand_table[] = {
> > > - SPINAND_INFO("MT29F2G01ABAGD", 0x24,
> > > - NAND_MEMORG(1, 2048, 128, 64, 2048, 40, 2, 1, 1),
> > > - NAND_ECCREQ(8, 512),
> > > - SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
> > > - &write_cache_variants,
> > > - &update_cache_variants),
> > > - 0,
> > > - SPINAND_ECCINFO(µn_ooblayout_ops,
> > > - micron_ecc_get_status)),
> > > -};
> > > -
> >
> > I don't know if it is wise to drop this structure.
> >
> > > static int micron_spinand_detect(struct spinand_device *spinand)
> > > {
> > > + const struct spi_mem_op *op;
> > > u8 *id = spinand->id.data;
> > > - int ret;
> > >
> > > /*
> > > * Micron SPI NAND read ID need a dummy byte,
> > > @@ -114,16 +102,55 @@ static int micron_spinand_detect(struct
> > spinand_device *spinand)
> > > if (id[1] != SPINAND_MFR_MICRON)
> > > return 0;
> > >
> > > - ret = spinand_match_and_init(spinand, micron_spinand_table,
> > > - ARRAY_SIZE(micron_spinand_table),
> > id[2]);
> >
> > I am not sure this is the right solution. I would keep this call and
> > overwrite what you need to overwrite with the fixup hook.
> >
>
> Then, I will have dummy structure like below.
>
> static const struct spinand_info micron_spinand_table[] = {
> SPINAND_INFO(NULL, 0,
> NAND_MEMORG(0, 0, 0, 0, 0, 0, 0, 0, 0),
> NAND_ECCREQ(0, 0),
> SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
> &write_cache_variants,
> &update_cache_variants),
> 0,
> SPINAND_ECCINFO(µn_ooblayout_ops,
> micron_ecc_get_status)),
> };
>
> Let me know if you are thinking for different approach.
>
Thanks,
Miquèl
Powered by blists - more mailing lists