From: p.zabel@pengutronix.de (Philipp Zabel)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 1/4] reset: Add support for the Amlogic Meson SoC Reset Controller
Date: Thu, 26 May 2016 13:02:42 +0200 [thread overview]
Message-ID: <1464260562.4109.77.camel@pengutronix.de> (raw)
In-Reply-To: <m2iny1h74c.fsf@baylibre.com>
Hi Kevin,
Am Mittwoch, den 25.05.2016, 19:42 -0700 schrieb Kevin Hilman:
> Neil Armstrong <narmstrong@baylibre.com> writes:
>
> > This patch adds the platform driver for the Amlogic Meson SoC Reset
> > Controller.
> >
> > The Meson8b and GXBB SoCs are supported.
> >
> > Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
>
> Maybe a question for Philipp, but when testog this version with the
> stmmac ethernet driver on the Amlogic boards, I noticed that ->reset was
> never getting called.
>
> Turns out, the stmmac driver only uses reset_control_assert() and
> reset_control_deassert(), both of which return -ENOTSUPP since this
> driver doesn't provide ->assert or ->deassert, so the driver's ->reset()
> never gets called.
>
> I haven't looked into the reset framework in detail, but if there's only
> a ->reset hook, I kind of expected that reset_control_deassert() would
> use that instead of returning -ENOTSUPP.
>
> If not, what's the proper way of handling hardware that only supports a
> write-only reset pulse? Should users of reset_control_* be adapted to
> check if ->deassert returns -ENOTSUPP and call ->reset?
I initially came up with this for i.MX6, which has a reset controller
that just like the Meson ones doesn't support manual assertion and
deassertion of the reset line.
My assumption then was that reset() is the default for all devices that
just need their internal state to be reset at some point. I didn't
expect the clock-like usage of manual deassert()/assert() for power
management to become so common.
So assert() and deassert() return -ENOTSUPP if the reset controller
doesn't support manually asserting or deasserting the reset line.
Of course you can argue that after a reset() pulse the reset line is
deasserted, and if you instead interpret the API in terms of expected
outcome, that would be similar to the state after call to deassert()
(iff the line was asserted before).
That would blur the line between reset() and deassert() somewhat, and in
my opinion having a call to deassert() first doing the exact opposite
isn't good nomenclature.
Personally, I'd prefer if the driver could switch to only using
reset_control_reset(rstc);
or, if the reset line needs to stay asserted during powerdown where the
reset controller supports it, but doesn't matter whert not, use:
ret = reset_control_deassert(rstc);
if (ret == -ENOTSUPP)
ret = reset_control_reset(rstc);
We could add a helper reset_control_deassert_or_reset() for that.
regards
Philipp
next prev parent reply other threads:[~2016-05-26 11:02 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-25 9:49 [PATCH v2 0/4] Amlogic: Meson: Add reset controller Neil Armstrong
2016-05-25 9:49 ` [PATCH v2 1/4] reset: Add support for the Amlogic Meson SoC Reset Controller Neil Armstrong
2016-05-25 10:14 ` Philipp Zabel
2016-05-26 2:42 ` Kevin Hilman
2016-05-26 11:02 ` Philipp Zabel [this message]
2016-05-26 18:42 ` Kevin Hilman
2016-05-30 16:14 ` Philipp Zabel
2016-05-25 9:49 ` [PATCH v2 2/4] dt-bindings: reset: Add bindings for the " Neil Armstrong
2016-05-25 19:10 ` Rob Herring
2016-05-26 7:30 ` Neil Armstrong
2016-05-25 9:49 ` [PATCH v2 3/4] ARM64: dts: amlogic: Enable Reset Controller on GXBB-based platforms Neil Armstrong
2016-05-25 9:49 ` [PATCH v2 4/4] ARM: dts: amlogic: Enable Reset Controller on Meson8b platforms Neil Armstrong
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=1464260562.4109.77.camel@pengutronix.de \
--to=p.zabel@pengutronix.de \
--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).