From: Boris Brezillon <boris.brezillon@free-electrons.com>
To: Marc Gonzalez <marc_gonzalez@sigmadesigns.com>
Cc: Richard Weinberger <richard@nod.at>,
<linux-mtd@lists.infradead.org>,
Sascha Hauer <s.hauer@pengutronix.de>,
Sergio Prado <sergio.prado@e-labworks.com>,
"Wenyou Yang" <wenyou.yang@atmel.com>,
Josh Wu <rainyfeeling@outlook.com>,
David Woodhouse <dwmw2@infradead.org>,
Brian Norris <computersforpeace@gmail.com>,
Marek Vasut <marek.vasut@gmail.com>,
"Cyrille Pitchen" <cyrille.pitchen@atmel.com>,
Krzysztof Kozlowski <krzk@kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [RESEND PATCH 1/3] mtd: nand: Pass the CS line to ->setup_data_interface()
Date: Tue, 21 Feb 2017 12:06:48 +0100 [thread overview]
Message-ID: <20170221120648.19e0d32c@bbrezillon> (raw)
In-Reply-To: <a5a9d822-a73c-4fd1-201c-7a17d9517f24@sigmadesigns.com>
On Tue, 21 Feb 2017 11:57:23 +0100
Marc Gonzalez <marc_gonzalez@sigmadesigns.com> wrote:
> On 20/02/2017 22:12, Boris Brezillon wrote:
>
> > Some NAND controllers can assign different NAND timings to different
> > CS lines. Pass the CS line information to ->setup_data_interface() so
> > that the NAND controller driver knows which CS line is concerned by
> > the setup_data_interface() request.
>
> I'm confused, because I thought I was already doing that.
> On my platform, I have different timings for each chip.
> (thus, for each CS, right?)
>
> In chip->select_chip, I program the appropriate timings
> which the controller will be using.
>
> What am I missing?
Maybe you don't have multi-dies chips, which is the case I'm fixing
here. If you have 2 separate chips, the existing hook should work just
fine.
>
> > diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
> > index c8894f31392e..d62a1c7c5c5c 100644
> > --- a/drivers/mtd/nand/nand_base.c
> > +++ b/drivers/mtd/nand/nand_base.c
> > @@ -1100,8 +1102,10 @@ static int nand_init_data_interface(struct nand_chip *chip)
> > if (ret)
> > continue;
> >
> > - ret = chip->setup_data_interface(mtd, chip->data_interface,
> > - true);
> > + /* Pass -1 to only */
>
> "Pass -1 to only" what?
>
> I suppose -1 means NAND_DATA_IFACE_CHECK_ONLY since
> #define NAND_DATA_IFACE_CHECK_ONLY -1
>
> Maybe you meant "Pass -1 to check only" here?
> The comment may need a slight rework.
Yep, didn't finish my sentence.
Since I decided to define a macro with a self-descriptive name, I
don't think I need this comment anymore.
>
> > + ret = chip->setup_data_interface(mtd,
> > + NAND_DATA_IFACE_CHECK_ONLY,
> > + chip->data_interface);
> > if (!ret) {
> > chip->onfi_timing_mode_default = mode;
> > break;
WARNING: multiple messages have this Message-ID (diff)
From: boris.brezillon@free-electrons.com (Boris Brezillon)
To: linux-arm-kernel@lists.infradead.org
Subject: [RESEND PATCH 1/3] mtd: nand: Pass the CS line to ->setup_data_interface()
Date: Tue, 21 Feb 2017 12:06:48 +0100 [thread overview]
Message-ID: <20170221120648.19e0d32c@bbrezillon> (raw)
In-Reply-To: <a5a9d822-a73c-4fd1-201c-7a17d9517f24@sigmadesigns.com>
On Tue, 21 Feb 2017 11:57:23 +0100
Marc Gonzalez <marc_gonzalez@sigmadesigns.com> wrote:
> On 20/02/2017 22:12, Boris Brezillon wrote:
>
> > Some NAND controllers can assign different NAND timings to different
> > CS lines. Pass the CS line information to ->setup_data_interface() so
> > that the NAND controller driver knows which CS line is concerned by
> > the setup_data_interface() request.
>
> I'm confused, because I thought I was already doing that.
> On my platform, I have different timings for each chip.
> (thus, for each CS, right?)
>
> In chip->select_chip, I program the appropriate timings
> which the controller will be using.
>
> What am I missing?
Maybe you don't have multi-dies chips, which is the case I'm fixing
here. If you have 2 separate chips, the existing hook should work just
fine.
>
> > diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
> > index c8894f31392e..d62a1c7c5c5c 100644
> > --- a/drivers/mtd/nand/nand_base.c
> > +++ b/drivers/mtd/nand/nand_base.c
> > @@ -1100,8 +1102,10 @@ static int nand_init_data_interface(struct nand_chip *chip)
> > if (ret)
> > continue;
> >
> > - ret = chip->setup_data_interface(mtd, chip->data_interface,
> > - true);
> > + /* Pass -1 to only */
>
> "Pass -1 to only" what?
>
> I suppose -1 means NAND_DATA_IFACE_CHECK_ONLY since
> #define NAND_DATA_IFACE_CHECK_ONLY -1
>
> Maybe you meant "Pass -1 to check only" here?
> The comment may need a slight rework.
Yep, didn't finish my sentence.
Since I decided to define a macro with a self-descriptive name, I
don't think I need this comment anymore.
>
> > + ret = chip->setup_data_interface(mtd,
> > + NAND_DATA_IFACE_CHECK_ONLY,
> > + chip->data_interface);
> > if (!ret) {
> > chip->onfi_timing_mode_default = mode;
> > break;
next prev parent reply other threads:[~2017-02-21 11:06 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-20 21:12 [RESEND PATCH 0/3] mtd: nand: atmel: Add ->setup_data_interface() + PM ops Boris Brezillon
2017-02-20 21:12 ` Boris Brezillon
2017-02-20 21:12 ` [RESEND PATCH 1/3] mtd: nand: Pass the CS line to ->setup_data_interface() Boris Brezillon
2017-02-20 21:12 ` Boris Brezillon
2017-02-21 10:57 ` Marc Gonzalez
2017-02-21 10:57 ` Marc Gonzalez
2017-02-21 11:06 ` Boris Brezillon [this message]
2017-02-21 11:06 ` Boris Brezillon
2017-02-21 12:02 ` Marc Gonzalez
2017-02-21 12:02 ` Marc Gonzalez
2017-02-21 12:47 ` Boris Brezillon
2017-02-21 12:47 ` Boris Brezillon
2017-02-20 21:12 ` [RESEND PATCH 2/3] mtd: nand: atmel: Add ->setup_data_interface() hooks Boris Brezillon
2017-02-20 21:12 ` Boris Brezillon
2017-02-20 22:47 ` Marek Vasut
2017-02-20 22:47 ` Marek Vasut
2017-02-21 8:13 ` Boris Brezillon
2017-02-21 8:13 ` Boris Brezillon
2017-02-20 21:12 ` [RESEND PATCH 3/3] mtd: nand: atmel: Add PM ops Boris Brezillon
2017-02-20 21:12 ` 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=20170221120648.19e0d32c@bbrezillon \
--to=boris.brezillon@free-electrons.com \
--cc=computersforpeace@gmail.com \
--cc=cyrille.pitchen@atmel.com \
--cc=dwmw2@infradead.org \
--cc=krzk@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=marc_gonzalez@sigmadesigns.com \
--cc=marek.vasut@gmail.com \
--cc=rainyfeeling@outlook.com \
--cc=richard@nod.at \
--cc=s.hauer@pengutronix.de \
--cc=sergio.prado@e-labworks.com \
--cc=wenyou.yang@atmel.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.