From: gmbnomis@gmail.com (Simon Baatz)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V2 00/10] mmc_of_parse() adaptations, DT support for Sheevaplugs
Date: Tue, 14 May 2013 18:26:52 +0200 [thread overview]
Message-ID: <20130514162652.GA13801@schnuecks.de> (raw)
In-Reply-To: <Pine.LNX.4.64.1305140819520.32151@axis700.grange>
Hi Guennadi,
On Tue, May 14, 2013 at 08:37:47AM +0200, Guennadi Liakhovetski wrote:
> On Mon, 13 May 2013, Simon Baatz wrote:
>
> > While adding DT support for the Sheevaplugs by Globalscale Technologies
> > (Kirkwood), it turned out that the DT binding of mvsdio lacked features to
> > properly support the hardware (active high/low of CD and WP pins could not
> > be described in DT).
> >
> > This is standard functionality provided by the mmc_of_parse() helper
> > function. However, mmc_of_parse() may allocate GPIO lines. If the
> > allocation fails, it outputs an error, but does not return an error to its
> > caller. Therefore, a proposal to handle errors in mmc_of_parse() is made.
>
> Thanks for the patches. In principle I'm fine either way. It is a policy
> decision IMHO. E.g. consider a situation. You have a DT with an SD-card
> slot, where card-detection is performed by a GPIO. OTOH the same pin is
> used on some other (optional) interface on the same board. If that other
> competing interface is unused, the driver isn't loaded, you can use the
> GPIO for card-detection. However, if that other interface is used, your
> attempt to get the card-detect pin will fail, but you still can use the
> interface in polling mode. No, I don't think this is a good example of
> hardware design :) User experience would depend on driver probing order,
> but in principle it is imaginable. So, with the current mmc_of_parse()
> you're more tolerant. You get a warning in the log, but the interface
> might still be usable. And if you're surprised why your write protection
> status hasn't been properly detected - just look in the log.
Yes, there is value in both ways. As should be clear by now, I prefer
being more strict here :-). But in the end, it is a policy decision
as you say.
There is also a "middle way" to split off the gpio allocation. This
has already been proposed in some other thread IIRC.
For example, split the current mmc_of_parse() into:
- mmc_of_parse(): Parses everything except the cd, wp gpios. It can't
return an error and assumes sensible default values in case of a
parse error (as it does today).
- mmc_of_gpio_cd(), mmc_of_gpio_wp(): Parses the cd/wp parts and
requests the respective gpio (returning an error if that fails).
However, this means up to three calls instead of one in the
driver (and the respective error checking if needed).
On the other hand, it offers more flexibility: the driver can decide
whether to ignore the error, fall back to MMC_CAP_NEEDS_POLL or abort
the probe.
> You're proposing a change in behaviour. After your change any failure to
> obtain a resource in mmc_of_parse() will fail interface probing.
> Personally I don't think there are any users around, who would notice this
> change, still, we have to be aware of it. And I don't know whether we
> should do that. You know, we don't break user-space ;-)
>
> So, technically I'm ok with the changes, but policy-wise I'm not sure how
> severe this change would be. We could go a bit slower and first add a
> return code as in your patch #1, but not fail drivers, like in your
> patches #2, 3,... but WARN_ON(mmc_of_parse() < 0); and continue for now.
> In 3.12 we could then replace those warnings with real failures. But maybe
> I'm just overcautious and we can just go ahead with your patches. You can
> add my
>
> Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
>
> for patches 1-3, and let's see what Chris thinks about this change.
Thanks for the review and the ack! Of course, I am fine with a more
cautious way if that's required.
- Simon
next prev parent reply other threads:[~2013-05-14 16:26 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-13 21:18 [PATCH V2 00/10] mmc_of_parse() adaptations, DT support for Sheevaplugs Simon Baatz
2013-05-13 21:18 ` [PATCH V2 01/10] mmc: return mmc_of_parse() errors to caller Simon Baatz
2013-05-14 7:20 ` Ulf Hansson
2013-05-13 21:18 ` [PATCH V2 02/10] mmc: sh_mmcif: handle mmc_of_parse() errors during probe Simon Baatz
2013-05-13 21:18 ` [PATCH V2 03/10] mmc: tmio-mmc: " Simon Baatz
2013-05-13 21:18 ` [PATCH V2 04/10] mmc: mxcmmc: " Simon Baatz
2013-05-13 21:18 ` [PATCH V2 05/10] mmc: sdhi-pxav3: " Simon Baatz
2013-05-14 6:38 ` Guennadi Liakhovetski
2013-05-13 21:18 ` [PATCH V2 06/10] mmc: tegra: " Simon Baatz
2013-05-13 21:18 ` [PATCH V2 07/10] ARM: mvebu: Use standard MMC binding for all users of mvsdio Simon Baatz
2013-05-13 23:09 ` Jason Cooper
2013-05-14 5:37 ` Simon Baatz
2013-05-15 0:29 ` Jason Cooper
2013-05-13 21:18 ` [PATCH V2 08/10] mmc: mvsdio: use standard MMC device-tree binding parser mmc_of_parse() Simon Baatz
2013-05-13 21:19 ` [PATCH V2 09/10] ARM: Kirkwood: Add dts files for Sheevaplug and eSATA Sheevaplug Simon Baatz
2013-05-15 0:31 ` Jason Cooper
2013-05-13 21:19 ` [PATCH V2 10/10] ARM: Kirkwood: add DT support for Sheevaplug and Sheevaplug eSATA Simon Baatz
2013-05-15 0:42 ` Jason Cooper
2013-05-15 0:53 ` [PATCH] ARM: kirkwood: enable Sheevaplug DT in defconfig Jason Cooper
2013-05-14 6:37 ` [PATCH V2 00/10] mmc_of_parse() adaptations, DT support for Sheevaplugs Guennadi Liakhovetski
2013-05-14 16:26 ` Simon Baatz [this message]
2013-05-15 19:42 ` Simon Baatz
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=20130514162652.GA13801@schnuecks.de \
--to=gmbnomis@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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).