From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 5/9] ARM: dove: create a proper PMU driver for power domains, PMU IRQs and resets
Date: Fri, 13 Mar 2015 12:29:44 +0000 [thread overview]
Message-ID: <20150313122944.GF8656@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <89767639.F6rHWX5yIj@wuerfel>
On Fri, Mar 13, 2015 at 01:07:06PM +0100, Arnd Bergmann wrote:
> On Thursday 12 March 2015 18:31:15 Russell King wrote:
> > +int __init dove_init_pmu(void)
> > +{
> > + struct device_node *np_pmu, *np;
> > + struct pmu_data *pmu;
> > + int ret, parent_irq;
> > +
> > + /* Lookup the PMU node */
> > + np_pmu = of_find_compatible_node(NULL, NULL, "marvell,dove-pmu");
> > + if (!np_pmu)
> > + return 0;
>
> What is the reason that this is not a platform_driver? I think you
> should try to make it one, or explain in the changelog the reason
> for not making it one. This obviously ties in with the question I
> asked about who calls dove_init_pmu().
It's because I need for the PM domain support to be available early
right now, and much of this code pre-dates the integration of OF with
PM domains. Even booting with DT, I still need some platform devices
manually declared and bound to these PM domains in order to (a) properly
test this code, (b) test other parts of the system effectively, and
(c) have a working system.
However, I do agree that in the longer term this should probably be
converted to a platform device driver, assuming that everything that
makes use of it copes with it.
However, one thing that is a concern with that is the PM domain code
does not yet support the removal of PM domains. I guess we should
ensure that PM domain providers set driver.suppress_bind_attrs so
that at least userspace can't unbind these drivers.
> > + ret = of_parse_phandle_with_args(np, "resets", "#reset-cells",
> > + 0, &args);
> > + if (ret == 0) {
> > + if (args.np == pmu->of_node)
> > + domain->rst_mask = BIT(args.args[0]);
> > + of_node_put(args.np);
> > + }
>
> In particular, manually parsing the "resets" property is something
> we should try to avoid. With a platform driver, this could become
> devm_reset_control_get(), otherwise I think of_reset_control_get()
> would also do the right thing here.
The hardware requires a specific sequence of register writes for the
PM domain code, which includes the reset register.
The problem is that if we were to use the reset API directly from the
PM domain code, we would have to separate the locks for the reset code
from the PM domain code. That then leads to there being a race between
the reset code potentially being able to write to the reset register in
the middle of a PM domain sequence.
--
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.
next prev parent reply other threads:[~2015-03-13 12:29 UTC|newest]
Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-12 18:30 [FOR DISCUSSION 0/9] Dove PMU support Russell King - ARM Linux
2015-03-12 18:31 ` [PATCH 5/9] ARM: dove: create a proper PMU driver for power domains, PMU IRQs and resets Russell King
2015-03-13 12:07 ` Arnd Bergmann
2015-03-13 12:29 ` Russell King - ARM Linux [this message]
2015-03-13 12:42 ` Arnd Bergmann
2015-03-13 12:47 ` Russell King - ARM Linux
2015-03-13 15:08 ` Arnd Bergmann
2015-03-13 15:28 ` Russell King - ARM Linux
2015-03-13 15:36 ` Arnd Bergmann
2015-03-13 12:59 ` Russell King - ARM Linux
2015-03-12 18:31 ` [PATCH 6/9] ARM: dt: dove: add Dove PMU DT entry to dove.dtsi Russell King
2015-03-13 12:30 ` Thomas Petazzoni
2015-03-13 12:33 ` Russell King - ARM Linux
2015-03-16 18:27 ` Gregory CLEMENT
2015-03-17 13:43 ` Russell King - ARM Linux
2015-03-17 15:09 ` Sebastian Hesselbarth
2015-03-17 15:15 ` Russell King - ARM Linux
2015-03-25 8:25 ` Linus Walleij
2015-03-12 18:31 ` [PATCH 7/9] ARM: dt: dove: wire up RTC interrupt Russell King
2015-03-12 18:31 ` [PATCH 8/9] ARM: dt: dove: add video decoder power domain description Russell King
2015-03-12 18:31 ` [PATCH 9/9] ARM: dt: dove: add GPU " Russell King
2015-03-13 11:57 ` [FOR DISCUSSION 0/9] Dove PMU support Arnd Bergmann
2015-03-13 12:11 ` Russell King - ARM Linux
2015-03-13 12:26 ` Arnd Bergmann
2015-03-13 12:32 ` Russell King - ARM Linux
2015-03-13 12:47 ` Arnd Bergmann
2015-03-13 16:23 ` [PATCH 01/10] pm: domains: quieten down generic pm domains Russell King
2015-03-13 17:10 ` Kevin Hilman
2015-03-13 16:23 ` [PATCH 02/10] pm: domains: factor out code to get the generic PM domain from a struct device Russell King
2015-03-13 17:20 ` Kevin Hilman
2015-03-13 17:35 ` Russell King - ARM Linux
2015-03-13 16:23 ` [PATCH 03/10] pm: domains: avoid potential oops in pm_genpd_remove_device() Russell King
2015-03-13 17:28 ` Kevin Hilman
2015-03-13 16:23 ` [PATCH 04/10] pm: domains: sync runtime PM status with PM domains after probe Russell King
2015-03-13 17:33 ` Kevin Hilman
2015-03-13 16:23 ` [PATCH 05/10] dt-bindings: add Marvell PMU documentation Russell King
2015-03-17 0:28 ` Rob Herring
2015-03-13 16:23 ` [PATCH 06/10] ARM: dove: create a proper PMU driver for power domains, PMU IRQs and resets Russell King
2015-03-13 16:23 ` [PATCH 07/10] ARM: dt: dove: add Dove PMU DT entry to dove.dtsi Russell King
2015-03-13 16:23 ` [PATCH 08/10] ARM: dt: dove: wire up RTC interrupt Russell King
2015-03-13 16:24 ` [PATCH 09/10] ARM: dt: dove: add video decoder power domain description Russell King
2015-03-13 16:24 ` [PATCH 10/10] ARM: dt: dove: add GPU " Russell King
2015-03-19 21:59 ` [FOR DISCUSSION 0/9] Dove PMU support Rafael J. Wysocki
2015-03-19 22:02 ` Rafael J. Wysocki
2015-03-20 12:16 ` Russell King - ARM Linux
2015-03-20 12:44 ` Rafael J. Wysocki
2015-03-20 17:19 ` Russell King - ARM Linux
2015-03-20 17:20 ` [PATCH 1/3] pm: domains: quieten down generic pm domains Russell King
2015-03-20 17:20 ` [PATCH 2/3] pm: domains: factor out code to get the generic PM domain from a struct device Russell King
2015-03-23 13:28 ` Ulf Hansson
2015-03-23 15:17 ` Russell King - ARM Linux
2015-03-24 0:29 ` Rafael J. Wysocki
2015-03-26 15:20 ` Russell King - ARM Linux
2015-03-26 16:00 ` Russell King - ARM Linux
2015-03-20 17:20 ` [PATCH 3/3] pm: domains: avoid potential oops in pm_genpd_remove_device() Russell King
2015-03-23 13:32 ` 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=20150313122944.GF8656@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--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).