From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: linux-mmc@vger.kernel.org, Chris Ball <chris@printf.net>,
linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
Linus Walleij <linus.walleij@linaro.org>,
Mark Brown <broonie@kernel.org>, Arnd Bergmann <arnd@arndb.de>,
Alexandre Courbot <gnurou@gmail.com>,
Arend van Spriel <arend@broadcom.com>,
Sascha Hauer <s.hauer@pengutronix.de>,
Olof Johansson <olof@lixom.net>,
Hans de Goede <hdegoede@redhat.com>,
Doug Anderson <dianders@chromium.org>, NeilBrown <neilb@suse.de>
Subject: Re: [PATCH 0/4] mmc: core: Add support for MMC power sequences
Date: Fri, 2 Jan 2015 18:14:24 +0000 [thread overview]
Message-ID: <20150102181423.GS11285@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1420215248-20650-1-git-send-email-ulf.hansson@linaro.org>
On Fri, Jan 02, 2015 at 05:14:04PM +0100, Ulf Hansson wrote:
> To be able to handle these SOC specific power sequences, we add a MMC power
> sequence interface, which helps the mmc core to deal with such.
I think this should be done differently - part of that is with hind sight
given that we now have a range of interface types.
One of my early design mistakes with MMC was to incorporate the power up
and initialisation protocol (the 74 clocks business) into the core code.
This was wrong, because it is a detail which only applies to dumb host
interfaces. More inteligent interfaces do not need that complexity as
they handle that in hardware.
Rather than MMC ending up with more layers and more infrastructure like
this - turning it more into the turd which is sdhci - I would like to see
some proper thought put into design, specifically addressing the above
design issue.
What should be done is to move away from the opaque "set_ios" method into
something more appropriate - a set of callbacks which describe what we
want to achieve.
In the case of power up, there should be a single call into the host
controller code which is responsible for initiating the power up
sequence, and waits for the power up sequence to complete. In other
words, most of mmc_power_up() should be moved to a library function,
which dumb host adapters hook into the "power up" method. More
inteligent adapters (eg, PXA, sdhci) can add their own hook which poke
the hardware and return when the hardware has completed its power up
sequence.
That avoids the "mmc_delay(10)" for inteligent adapters where these
delays are not required - which presumably also are not required if some
special power up sequence for eMMC is required.
The same thing goes for this "powerseq" stuff - all you're doing is
propagating the same design mistake (with the POWER_UP/POWER_ON etc
details) into it. That shouldn't be the case - think about the dumb
powerup method I described above vs the inteligent method - these are
two separate powerup methods, and should be implemented as such.
--
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
according to speedtest.net.
next prev parent reply other threads:[~2015-01-02 18:14 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-02 16:14 [PATCH 0/4] mmc: core: Add support for MMC power sequences Ulf Hansson
[not found] ` <1420215248-20650-1-git-send-email-ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-01-02 16:14 ` [PATCH 1/4] mmc: core: Initial " Ulf Hansson
2015-01-02 16:14 ` [PATCH 2/4] mmc: pwrseq: Document DT bindings for the simple MMC power sequence Ulf Hansson
2015-01-02 16:14 ` [PATCH 3/4] mmc: pwrseq: Initial support for the simple MMC power sequence provider Ulf Hansson
2015-01-02 16:14 ` [PATCH 4/4] mmc: pwrseq_simple: Add support for a reset GPIO pin Ulf Hansson
2015-01-02 18:14 ` Russell King - ARM Linux [this message]
2015-01-04 19:20 ` [PATCH 0/4] mmc: core: Add support for MMC power sequences Hans de Goede
2015-01-12 14:29 ` Ulf Hansson
[not found] ` <CAPDyKFpo=WpE3hDxqETVXOYX6pFsSmO7YybLJF=kJFyYFVcaoA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-01-12 16:18 ` Russell King - ARM Linux
2015-01-13 14:08 ` Ulf Hansson
2015-01-13 14:23 ` Russell King - ARM Linux
2015-01-13 14:34 ` Ulf Hansson
2015-01-12 14:26 ` Tomeu Vizoso
2015-01-12 14:43 ` Ulf Hansson
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=20150102181423.GS11285@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=arend@broadcom.com \
--cc=arnd@arndb.de \
--cc=broonie@kernel.org \
--cc=chris@printf.net \
--cc=devicetree@vger.kernel.org \
--cc=dianders@chromium.org \
--cc=gnurou@gmail.com \
--cc=hdegoede@redhat.com \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mmc@vger.kernel.org \
--cc=neilb@suse.de \
--cc=olof@lixom.net \
--cc=s.hauer@pengutronix.de \
--cc=ulf.hansson@linaro.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).