From: Boris Brezillon <boris.brezillon@free-electrons.com>
To: "Peter Pan 潘栋 (peterpandong)" <peterpandong@micron.com>
Cc: "richard@nod.at" <richard@nod.at>,
"computersforpeace@gmail.com" <computersforpeace@gmail.com>,
"arnaud.mouiche@gmail.com" <arnaud.mouiche@gmail.com>,
"thomas.petazzoni@free-electrons.com"
<thomas.petazzoni@free-electrons.com>,
"marex@denx.de" <marex@denx.de>,
"cyrille.pitchen@wedev4u.fr" <cyrille.pitchen@wedev4u.fr>,
"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
"peterpansjtu@gmail.com" <peterpansjtu@gmail.com>,
"linshunquan1@hisilicon.com" <linshunquan1@hisilicon.com>
Subject: Re: [PATCH v6 11/15] nand: spi: add basic operations support
Date: Wed, 31 May 2017 12:02:46 +0200 [thread overview]
Message-ID: <20170531120246.60e3009e@bbrezillon> (raw)
In-Reply-To: <B7799737-B040-4824-BBAF-5A0510CD553C@micron.com>
Hi Peter,
On Wed, 31 May 2017 06:51:34 +0000
Peter Pan 潘栋 (peterpandong) <peterpandong@micron.com> wrote:
> >> +/**
> >> + * spinand_disable_ecc - disable internal ECC
> >> + * @spinand: SPI NAND device structure
> >> + */
> >> +static void spinand_disable_ecc(struct spinand_device *spinand)
> >> +{
> >> + u8 cfg = 0;
> >> +
> >> + spinand_get_cfg(spinand, &cfg);
> >> +
> >> + if ((cfg & CFG_ECC_MASK) == CFG_ECC_ENABLE) {
> >> + cfg &= ~CFG_ECC_ENABLE;
> >> + spinand_set_cfg(spinand, cfg);
> >> + }
> >
> > Is this really a generic (manufacturer-agnostic) feature??? I had the
> > feeling that is was only working for Micron. If that's the case, this
> > 'disable-ecc' step should be done in spi/micron.c in a
> > micron_spinand_init() function.
>
> As far as I can see, Micron is not the only vendor to disable on die ecc
> by this way, actually all vendors I know use this .
Hm, ok. I'm a bit skeptical (vendors tend to implement this kind of
feature with vendor specific commands, but maybe it has changed with SPI
NANDs), but I'll trust you on this one.
> And this series
> doesn't support on die ecc, so IMO it is necessary to disable it during
> initialization
Actually I was not arguing on the need to disable on-die ECC, just
wasn't sure this should be done in the core. If it's really generic,
then it's fine.
>
> >
> >> +}
[...]
> >>
> >> diff --git a/include/linux/mtd/spinand.h b/include/linux/mtd/spinand.h
> >> index dd9da71..04ad1dd 100644
> >> --- a/include/linux/mtd/spinand.h
> >> +++ b/include/linux/mtd/spinand.h
> >> @@ -103,11 +103,14 @@ struct spinand_controller_ops {
> >> * return directly and let others to detect.
> >> * @init: initialize SPI NAND device.
> >> * @cleanup: clean SPI NAND device footprint.
> >> + * @prepare_op: prepara read/write operation.
> >
> > ^ prepare
> >
> >
> >
> >> */
> >> struct spinand_manufacturer_ops {
> >> bool (*detect)(struct spinand_device *spinand);
> >> int (*init)(struct spinand_device *spinand);
> >> void (*cleanup)(struct spinand_device *spinand);
> >> + void (*prepare_op)(struct spinand_device *spinand,
> >> + struct spinand_op *op, u32 page, u32 column);
> >
> > It seems to be here to prepare read/write page operations, so I'd like
> > to rename this method ->prepare_page_op() if you don't mind.
>
> I'm ok with the new name
Actually, in the mean time I asked Cyrille how dummy cycles were
handled in the spi-nor subsystem and how spi flash controllers are
dealing with such dummy cycles. It seems that some controllers are able
to handle those dummy cycles on their own (without any software
intervention to skip bits or move things around in output bufs.
I'll let Cyrille comment on this specific aspect, but I wonder if we
shouldn't just specify the number of dummy cycles and let the
controller handle that.
Regards,
Boris
next prev parent reply other threads:[~2017-05-31 10:03 UTC|newest]
Thread overview: 65+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-24 7:06 [PATCH v6 00/15] A SPI NAND framework under generic NAND framework Peter Pan
2017-05-24 7:06 ` [PATCH v6 01/15] mtd: nand: Rename nand.h into rawnand.h Peter Pan
2017-05-24 7:06 ` [PATCH v6 02/15] mtd: nand: move raw NAND related code to the raw/ subdir Peter Pan
2017-05-24 7:06 ` [PATCH v6 03/15] mtd: nand: add a nand.h file to expose basic NAND stuff Peter Pan
2017-05-29 20:14 ` Boris Brezillon
2017-05-24 7:07 ` [PATCH v6 04/15] mtd: nand: raw: prefix conflicting names with nandcchip instead of nand Peter Pan
2017-05-29 20:22 ` Boris Brezillon
2017-05-24 7:07 ` [PATCH v6 05/15] mtd: nand: raw: create struct rawnand_device Peter Pan
2017-05-29 21:05 ` Boris Brezillon
2017-05-24 7:07 ` [PATCH v6 06/15] mtd: nand: raw: make BBT code more generic Peter Pan
2017-05-24 7:07 ` [PATCH v6 07/15] mtd: nand: move BBT code to drivers/mtd/nand/ Peter Pan
2017-05-24 7:07 ` [PATCH v6 08/15] mtd: nand: Add the page iterator concept Peter Pan
2017-05-29 21:12 ` Boris Brezillon
2017-05-24 7:07 ` [PATCH v6 09/15] mtd: nand: make sure mtd_oob_ops consistent in bbt Peter Pan
2017-05-29 21:06 ` Boris Brezillon
2017-05-24 7:07 ` [PATCH v6 10/15] nand: spi: add basic blocks for infrastructure Peter Pan
2017-05-29 21:51 ` Boris Brezillon
2017-05-31 7:02 ` Peter Pan 潘栋 (peterpandong)
2017-05-31 21:45 ` Cyrille Pitchen
2017-06-01 7:24 ` Boris Brezillon
2017-05-24 7:07 ` [PATCH v6 11/15] nand: spi: add basic operations support Peter Pan
2017-05-29 22:11 ` Boris Brezillon
2017-05-31 6:51 ` Peter Pan 潘栋 (peterpandong)
2017-05-31 10:02 ` Boris Brezillon [this message]
2017-06-27 20:15 ` Boris Brezillon
2017-06-28 9:41 ` Arnaud Mouiche
2017-06-28 11:32 ` Boris Brezillon
2017-06-29 5:45 ` Peter Pan 潘栋 (peterpandong)
2017-06-29 6:07 ` Peter Pan 潘栋 (peterpandong)
2017-06-29 7:05 ` Arnaud Mouiche
2017-10-11 13:35 ` Boris Brezillon
2017-10-12 1:28 ` Peter Pan
2017-05-24 7:07 ` [PATCH v6 12/15] nand: spi: Add bad block support Peter Pan
2017-05-24 7:07 ` [PATCH v6 13/15] nand: spi: add Micron spi nand support Peter Pan
2017-05-24 7:07 ` [PATCH v6 14/15] nand: spi: Add generic SPI controller support Peter Pan
2017-05-24 7:07 ` [PATCH v6 15/15] MAINTAINERS: Add SPI NAND entry Peter Pan
2017-05-29 20:59 ` [PATCH v6 00/15] A SPI NAND framework under generic NAND framework Boris Brezillon
2017-12-04 13:32 ` Frieder Schrempf
2017-12-04 14:05 ` Boris Brezillon
2017-12-05 1:35 ` Peter Pan 潘栋 (peterpandong)
2017-12-05 12:58 ` Boris Brezillon
2017-12-05 13:03 ` Boris Brezillon
2017-12-12 9:58 ` Frieder Schrempf
2017-12-13 21:27 ` Boris Brezillon
2017-12-14 6:15 ` Peter Pan
2017-12-14 7:50 ` Boris Brezillon
2017-12-14 8:06 ` Peter Pan
2017-12-14 14:39 ` Frieder Schrempf
2017-12-14 14:43 ` Frieder Schrempf
2017-12-14 15:38 ` Boris Brezillon
2017-12-15 1:08 ` Peter Pan
2017-12-15 1:21 ` Peter Pan
2017-12-21 11:48 ` Frieder Schrempf
2017-12-21 13:01 ` Boris Brezillon
2017-12-21 13:54 ` Frieder Schrempf
2017-12-22 0:49 ` Peter Pan
2017-12-22 6:37 ` Peter Pan
2017-12-22 8:28 ` Boris Brezillon
2017-12-22 13:51 ` Boris Brezillon
2018-01-02 2:51 ` Peter Pan
2018-01-03 16:46 ` Boris Brezillon
2018-01-04 2:01 ` Peter Pan
2018-01-08 22:07 ` Boris Brezillon
2017-12-15 2:35 ` Peter Pan
2017-12-15 12:41 ` Boris Brezillon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170531120246.60e3009e@bbrezillon \
--to=boris.brezillon@free-electrons.com \
--cc=arnaud.mouiche@gmail.com \
--cc=computersforpeace@gmail.com \
--cc=cyrille.pitchen@wedev4u.fr \
--cc=linshunquan1@hisilicon.com \
--cc=linux-mtd@lists.infradead.org \
--cc=marex@denx.de \
--cc=peterpandong@micron.com \
--cc=peterpansjtu@gmail.com \
--cc=richard@nod.at \
--cc=thomas.petazzoni@free-electrons.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).