From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Florian Fainelli <f.fainelli@gmail.com>
Cc: Vignesh Raghavendra <vigneshr@ti.com>,
Kamal Dasu <kdasu.kdev@gmail.com>,
Richard Weinberger <richard@nod.at>,
linux-kernel@vger.kernel.org, Marek Vasut <marek.vasut@gmail.com>,
bcm-kernel-feedback-list@broadcom.com,
linux-mtd@lists.infradead.org,
Brian Norris <computersforpeace@gmail.com>,
David Woodhouse <dwmw2@infradead.org>
Subject: Re: [PATCH v2 2/2] mtd: nand: raw: brcmnand: fallback to detected ecc-strength, ecc-step-size
Date: Tue, 21 May 2019 10:53:01 +0200 [thread overview]
Message-ID: <20190521105301.26e049b5@xps13> (raw)
In-Reply-To: <63bbd3eb-60c1-042c-633c-cfa6fbef528c@gmail.com>
Hi Florian,
Florian Fainelli <f.fainelli@gmail.com> wrote on Mon, 20 May 2019
12:11:42 -0700:
> On 5/20/19 12:05 PM, Kamal Dasu wrote:
> > This change supports nand-ecc-step-size and nand-ecc-strength fields in
> > brcmnand DT node to be optional.
> > see: Documentation/devicetree/bindings/mtd/brcm,brcmnand.txt
> >
> > If both nand-ecc-strength and nand-ecc-step-size are not specified in
> > device tree node for NAND, raw NAND layer does detect ECC information by
> > reading ONFI extended parameter page for parts using ONFI >= 2.1.
> > In case of non-ONFI NAND parts there could be a nand_id table entry with
> > ECC information. If there is valid device tree entry for nand-ecc-strength
> > and nand-ecc-step-size fields it still shall override the detected values.
> >
> > Signed-off-by: Kamal Dasu <kdasu.kdev@gmail.com>
> > ---
> > drivers/mtd/nand/raw/brcmnand/brcmnand.c | 11 +++++++++++
> > 1 file changed, 11 insertions(+)
> >
> > diff --git a/drivers/mtd/nand/raw/brcmnand/brcmnand.c b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
> > index ce0b8ff..a4d2057 100644
> > --- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c
> > +++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
> > @@ -2144,6 +2144,17 @@ static int brcmnand_setup_dev(struct brcmnand_host *host)
> > return -EINVAL;
> > }
> >
> > + if (chip->ecc.mode != NAND_ECC_NONE &&
> > + (!chip->ecc.size || !chip->ecc.strength)) {
> > + if (chip->base.eccreq.step_size && chip->base.eccreq.strength) {
> > + /* use detected ECC parameters */
> > + chip->ecc.size = chip->base.eccreq.step_size;
> > + chip->ecc.strength = chip->base.eccreq.strength;
> > + pr_info("Using ECC step-size %d, strength %d\n",
> > + chip->ecc.size, chip->ecc.strength);
>
> Nit: should not we use dev_info(&host->pdev->dev) for printing the
> message in case we have multiple NAND controllers on chip, that way we
> can still differentiate them from the prints?
Yes, that would fit what the rest of the driver does. After that I
think the patchset will be ready.
Thanks,
Miquèl
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
WARNING: multiple messages have this Message-ID (diff)
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Florian Fainelli <f.fainelli@gmail.com>
Cc: Kamal Dasu <kdasu.kdev@gmail.com>,
linux-mtd@lists.infradead.org,
bcm-kernel-feedback-list@broadcom.com,
linux-kernel@vger.kernel.org,
Brian Norris <computersforpeace@gmail.com>,
Richard Weinberger <richard@nod.at>,
David Woodhouse <dwmw2@infradead.org>,
Marek Vasut <marek.vasut@gmail.com>,
Vignesh Raghavendra <vigneshr@ti.com>
Subject: Re: [PATCH v2 2/2] mtd: nand: raw: brcmnand: fallback to detected ecc-strength, ecc-step-size
Date: Tue, 21 May 2019 10:53:01 +0200 [thread overview]
Message-ID: <20190521105301.26e049b5@xps13> (raw)
In-Reply-To: <63bbd3eb-60c1-042c-633c-cfa6fbef528c@gmail.com>
Hi Florian,
Florian Fainelli <f.fainelli@gmail.com> wrote on Mon, 20 May 2019
12:11:42 -0700:
> On 5/20/19 12:05 PM, Kamal Dasu wrote:
> > This change supports nand-ecc-step-size and nand-ecc-strength fields in
> > brcmnand DT node to be optional.
> > see: Documentation/devicetree/bindings/mtd/brcm,brcmnand.txt
> >
> > If both nand-ecc-strength and nand-ecc-step-size are not specified in
> > device tree node for NAND, raw NAND layer does detect ECC information by
> > reading ONFI extended parameter page for parts using ONFI >= 2.1.
> > In case of non-ONFI NAND parts there could be a nand_id table entry with
> > ECC information. If there is valid device tree entry for nand-ecc-strength
> > and nand-ecc-step-size fields it still shall override the detected values.
> >
> > Signed-off-by: Kamal Dasu <kdasu.kdev@gmail.com>
> > ---
> > drivers/mtd/nand/raw/brcmnand/brcmnand.c | 11 +++++++++++
> > 1 file changed, 11 insertions(+)
> >
> > diff --git a/drivers/mtd/nand/raw/brcmnand/brcmnand.c b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
> > index ce0b8ff..a4d2057 100644
> > --- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c
> > +++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
> > @@ -2144,6 +2144,17 @@ static int brcmnand_setup_dev(struct brcmnand_host *host)
> > return -EINVAL;
> > }
> >
> > + if (chip->ecc.mode != NAND_ECC_NONE &&
> > + (!chip->ecc.size || !chip->ecc.strength)) {
> > + if (chip->base.eccreq.step_size && chip->base.eccreq.strength) {
> > + /* use detected ECC parameters */
> > + chip->ecc.size = chip->base.eccreq.step_size;
> > + chip->ecc.strength = chip->base.eccreq.strength;
> > + pr_info("Using ECC step-size %d, strength %d\n",
> > + chip->ecc.size, chip->ecc.strength);
>
> Nit: should not we use dev_info(&host->pdev->dev) for printing the
> message in case we have multiple NAND controllers on chip, that way we
> can still differentiate them from the prints?
Yes, that would fit what the rest of the driver does. After that I
think the patchset will be ready.
Thanks,
Miquèl
next prev parent reply other threads:[~2019-05-21 8:53 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-20 19:05 [PATCH v2 1/2] dt-bindings: mtd: brcmnand: Make nand-ecc-strength and nand-ecc-step-size optional Kamal Dasu
2019-05-20 19:05 ` Kamal Dasu
2019-05-20 19:05 ` [PATCH v2 2/2] mtd: nand: raw: brcmnand: fallback to detected ecc-strength, ecc-step-size Kamal Dasu
2019-05-20 19:05 ` Kamal Dasu
2019-05-20 19:11 ` Florian Fainelli
2019-05-20 19:11 ` Florian Fainelli
2019-05-21 8:53 ` Miquel Raynal [this message]
2019-05-21 8:53 ` Miquel Raynal
2019-05-21 8:53 ` Miquel Raynal
2019-05-21 8:53 ` Miquel Raynal
2019-05-21 8:53 ` [PATCH v2 1/2] dt-bindings: mtd: brcmnand: Make nand-ecc-strength and nand-ecc-step-size optional Miquel Raynal
2019-05-21 8:53 ` Miquel Raynal
2019-05-21 9:31 ` Schrempf Frieder
2019-05-21 9:31 ` Schrempf Frieder
2019-05-21 9:32 ` Miquel Raynal
2019-05-21 9:32 ` Miquel Raynal
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=20190521105301.26e049b5@xps13 \
--to=miquel.raynal@bootlin.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=computersforpeace@gmail.com \
--cc=dwmw2@infradead.org \
--cc=f.fainelli@gmail.com \
--cc=kdasu.kdev@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=marek.vasut@gmail.com \
--cc=richard@nod.at \
--cc=vigneshr@ti.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.