From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Ladislav Michl <ladis@linux-mips.org>
Cc: Janusz Krzysztofik <jmkrzyszt@gmail.com>,
Andy Shevchenko <andy.shevchenko@gmail.com>,
linux-fbdev@vger.kernel.org,
ALSA Development Mailing List <alsa-devel@alsa-project.org>,
Aaro Koskinen <aaro.koskinen@iki.fi>,
Tony Lindgren <tony@atomide.com>,
Richard Weinberger <richard@nod.at>,
Mark Brown <broonie@kernel.org>,
Liam Girdwood <lgirdwood@gmail.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Peter Ujfalusi <peter.ujfalusi@ti.com>,
Boris Brezillon <boris.brezillon@bootlin.com>,
Tomi Valkeinen <tomi.valkeinen@ti.com>,
"open list:MEMORY TECHNOLOGY..." <linux-mtd@lists.infradead.org>,
linux-arm Mailing List <linux-arm-kernel@lists.infradead.org>,
linux-input <linux-input@vger.kernel.org>,
Linux OMAP Mailing List <linux-omap@vger.kernel.org>
Subject: Re: [alsa-devel] [PATCH 5/6] mtd: rawnand: ams-delta: use GPIO lookup table
Date: Sun, 20 May 2018 20:08:22 +0000 [thread overview]
Message-ID: <20180520200822.GA119427@dtor-ws> (raw)
In-Reply-To: <20180520192705.GA12883@lenoch>
On Sun, May 20, 2018 at 09:27:05PM +0200, Ladislav Michl wrote:
> On Sat, May 19, 2018 at 11:55:51PM +0200, Janusz Krzysztofik wrote:
> > On Saturday, May 19, 2018 8:00:38 PM CEST Andy Shevchenko wrote:
> > > On Sat, May 19, 2018 at 2:15 AM, Janusz Krzysztofik <jmkrzyszt@gmail.com>
> > wrote:
> > > > On Friday, May 18, 2018 11:21:14 PM CEST Andy Shevchenko wrote:
> > > >> On Sat, May 19, 2018 at 12:09 AM, Janusz Krzysztofik
> > > >>
> > > >> <jmkrzyszt@gmail.com> wrote:
> > > >> > + gpiod_rdy = devm_gpiod_get_optional(&pdev->dev, "rdy",
> > > >> > GPIOD_IN);
> > > >> > + if (!IS_ERR_OR_NULL(gpiod_rdy)) {
> > > >>
> > > >> So, is it optional or not at the end?
> > > >> If it is, why do we check for NULL?
> > > >
> > > > As far as I can understand, nand_chip->dev_ready() callback is optional.
> > > > That's why I decided to use the _optional variant of devm_gpiod_get(). In
> > > > case of ams-delta, the dev_ready() callback depends on availability of
> > > > the 'rdy' GPIO pin. As a consequence, I'm checking for both NULL and ERR
> > > > in order to decide if dev_ready() will be supported.
> > > >
> > > > I can pretty well replace it with the standard form and check for ERR only
> > > > if the purpose of the _optional form is different.
> > >
> > > NULL check in practice discards the _optional part of gpiod_get(). So,
> > > either you use non-optional variant and decide how to handle an
> > > errors, or user _optional w/o NULL check.
> >
> > OK, I'm going to use something like the below while submitting v2:
> >
> > - gpiod_rdy = devm_gpiod_get_optional(&pdev->dev, "rdy", GPIOD_IN);
> > - if (!IS_ERR_OR_NULL(gpiod_rdy)) {
> > - this->dev_ready = ams_delta_nand_ready;
> > - } else {
> > - this->dev_ready = NULL;
> > - pr_notice("Couldn't request gpio for Delta NAND ready.\n");
> > + priv->gpiod_rdy = devm_gpiod_get_optional(&pdev->dev, "rdy",
> > + GPIOD_IN);
> > + if (IS_ERR(priv->gpiod_rdy)) {
> > + err = PTR_ERR(priv->gpiod_nwp);
> ??? --------------------------------^^^^^^^^^
> > + dev_warn(&pdev->dev, "RDY GPIO request failed (%d)\n", err);
> > + goto err_gpiod;
>
> Driver will just use worst case delay instead of RDY signal, so this
> is perhaps too strict. I will work with degraded performance.
If RDY signal is not available then the board should not define it.
Degrading performance and having users wondering because RDY is
sometimes not available is not great. Especially if we get -EPROBE_DEFER
here.
Thanks.
--
Dmitry
next prev parent reply other threads:[~2018-05-20 20:08 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-18 21:09 [PATCH 1/6] ARM: OMAP1: ams-delta: add GPIO lookup tables Janusz Krzysztofik
2018-05-18 21:09 ` [PATCH 2/6] Input: ams_delta_serio: use GPIO lookup table Janusz Krzysztofik
2018-05-20 20:17 ` Dmitry Torokhov
2018-05-18 21:09 ` [PATCH 3/6] ASoC: ams_delta: " Janusz Krzysztofik
2018-05-21 10:05 ` Mark Brown
2018-05-23 18:52 ` Tony Lindgren
2018-05-24 20:35 ` Janusz Krzysztofik
2018-05-18 21:09 ` [PATCH 4/6] fbdev: omapfb: lcd_ams_delta: " Janusz Krzysztofik
2018-05-25 22:49 ` [Resend] " Janusz Krzysztofik
2018-07-09 19:16 ` [PATCH v2] video: " Janusz Krzysztofik
2018-07-17 16:54 ` [PATCH RESEND " Janusz Krzysztofik
2018-07-17 21:40 ` Janusz Krzysztofik
2018-05-18 21:09 ` [PATCH 5/6] mtd: rawnand: ams-delta: " Janusz Krzysztofik
2018-05-18 21:21 ` Andy Shevchenko
2018-05-18 23:15 ` Janusz Krzysztofik
2018-05-19 18:00 ` Andy Shevchenko
2018-05-19 21:55 ` Janusz Krzysztofik
2018-05-20 14:44 ` Andy Shevchenko
2018-05-20 15:37 ` Janusz Krzysztofik
2018-05-20 16:17 ` Andy Shevchenko
2018-05-20 19:27 ` [alsa-devel] " Ladislav Michl
2018-05-20 20:08 ` Dmitry Torokhov [this message]
2018-05-21 20:21 ` Janusz Krzysztofik
2018-05-21 20:57 ` Dmitry Torokhov
2018-05-18 21:09 ` [PATCH 6/6] ARM: OMAP1: ams-delta: make board header file local to mach-omap1 Janusz Krzysztofik
2018-05-21 17:35 ` [PATCH 1/6] ARM: OMAP1: ams-delta: add GPIO lookup tables Tony Lindgren
2018-05-21 18:10 ` Janusz Krzysztofik
2018-07-17 23:14 ` [PATCH v2 0/3] ARM: OMAP1: ams-delta: Complete driver gpiod migration Janusz Krzysztofik
2018-07-17 23:14 ` [PATCH v2 1/3 v2] video: fbdev: omapfb: lcd_ams_delta: use GPIO lookup table Janusz Krzysztofik
2018-07-17 23:14 ` [PATCH v2 2/3 v4] mtd: rawnand: ams-delta: " Janusz Krzysztofik
2018-07-18 7:20 ` Miquel Raynal
2018-07-19 6:39 ` Tony Lindgren
2018-07-17 23:14 ` [PATCH v2 3/3] ARM: OMAP1: ams-delta: make board header file local to mach-omap1 Janusz Krzysztofik
2018-07-18 14:18 ` [PATCH v2 0/3] ARM: OMAP1: ams-delta: Complete driver gpiod migration Gregory CLEMENT
2018-09-09 22:56 ` [PATCH v3 " Janusz Krzysztofik
2018-09-09 22:56 ` [PATCH v3 1/3] video: fbdev: omapfb: lcd_ams_delta: use GPIO lookup table Janusz Krzysztofik
2018-09-10 7:15 ` Linus Walleij
2018-09-09 22:56 ` [PATCH v3 2/3] mtd: rawnand: ams-delta: " Janusz Krzysztofik
2018-09-09 22:56 ` [PATCH v3 3/3] ARM: OMAP1: ams-delta: make board header file local to mach-omap1 Janusz Krzysztofik
2018-09-19 18:10 ` [PATCH v3 0/3] ARM: OMAP1: ams-delta: Complete driver gpiod migration Janusz Krzysztofik
2018-09-20 20:58 ` Tony Lindgren
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=20180520200822.GA119427@dtor-ws \
--to=dmitry.torokhov@gmail.com \
--cc=aaro.koskinen@iki.fi \
--cc=alsa-devel@alsa-project.org \
--cc=andy.shevchenko@gmail.com \
--cc=boris.brezillon@bootlin.com \
--cc=broonie@kernel.org \
--cc=jmkrzyszt@gmail.com \
--cc=ladis@linux-mips.org \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=linux-omap@vger.kernel.org \
--cc=peter.ujfalusi@ti.com \
--cc=richard@nod.at \
--cc=tomi.valkeinen@ti.com \
--cc=tony@atomide.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).