From: Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>
To: Sricharan R <sricharan-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
Cc: robin.murphy-5wv7dgnIgG8@public.gmane.org,
will.deacon-5wv7dgnIgG8@public.gmane.org,
joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org,
iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
m.szyprowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org,
sboyd-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
mathieu.poirier-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org
Subject: Re: [PATCH V2 1/3] iommu/arm-smmu: Add pm_runtime/sleep ops
Date: Thu, 2 Feb 2017 17:42:18 +0000 [thread overview]
Message-ID: <20170202174218.GO31394@leverpostej> (raw)
In-Reply-To: <1486055420-19671-2-git-send-email-sricharan-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
Hi,
On Thu, Feb 02, 2017 at 10:40:18PM +0530, Sricharan R wrote:
> +- clock-names: Should be a pair of "smmu_iface_clk" and "smmu_bus_clk"
> + required for smmu's register group access and interface
> + clk for the smmu's underlying bus access.
> +
> +- clocks: Phandles for respective clocks described by clock-names.
Which SMMU implementations are those clock-names valid for?
The SMMU architecture specifications do not architect the clocks, which
are implemementation-specific.
AFAICT, this doesn't match MMU-400 or MMU-500.
> +static int arm_smmu_init_clocks(struct arm_smmu_device *smmu)
> +{
> + const char *cname;
> + struct property *prop;
> + int i = 0;
> + struct device *dev = smmu->dev;
> +
> + smmu->num_clocks =
> + of_property_count_strings(dev->of_node, "clock-names");
> +
> + if (smmu->num_clocks < 1)
> + return 0;
> +
> + smmu->clocks = devm_kzalloc(dev,
> + sizeof(*smmu->clocks) * smmu->num_clocks,
> + GFP_KERNEL);
> +
> + if (!smmu->clocks) {
> + dev_err(dev, "Failed to allocate memory for clocks\n");
> + return -ENODEV;
> + }
> +
> + of_property_for_each_string(dev->of_node, "clock-names", prop, cname) {
> + struct clk *c = devm_clk_get(dev, cname);
> +
> + if (IS_ERR(c)) {
> + dev_err(dev, "Couldn't get clock: %s", cname);
> + return -EPROBE_DEFER;
> + }
> +
> + smmu->clocks[i] = c;
> + ++i;
> + }
> +
> + return 0;
> +}
I am very much not a fan of grabbing hold of resources that don't
necessarily match the binding, and we likely don't understand the use
of.
Either we know the names, and can manage them, or we don't, and cannot.
Thanks,
Mark.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2017-02-02 17:42 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-02 17:10 [PATCH V2 0/3] iommu/arm-smmu: Add runtime pm/sleep support Sricharan R
[not found] ` <1486055420-19671-1-git-send-email-sricharan-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2017-02-02 17:10 ` [PATCH V2 1/3] iommu/arm-smmu: Add pm_runtime/sleep ops Sricharan R
[not found] ` <1486055420-19671-2-git-send-email-sricharan-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2017-02-02 17:42 ` Mark Rutland [this message]
2017-02-08 10:53 ` Sricharan
2017-02-08 11:40 ` Mark Rutland
2017-02-08 12:30 ` Sricharan
2017-02-08 12:54 ` Robin Murphy
[not found] ` <b55359d8-2665-aef0-3215-53a0e8f21bcd-5wv7dgnIgG8@public.gmane.org>
2017-02-08 13:45 ` Sricharan
2017-02-08 13:52 ` Mark Rutland
2017-02-08 14:30 ` Robin Murphy
[not found] ` <db9bc01c-635d-1a57-8a6c-9be19a0cda16-5wv7dgnIgG8@public.gmane.org>
2017-02-09 13:35 ` Sricharan
2017-02-02 17:10 ` [PATCH V2 3/3] iommu/arm-smmu: Add the device_link between masters and smmu Sricharan R
2017-02-02 17:10 ` [PATCH V2 2/3] iommu/arm-smmu: Invoke pm_runtime during probe, add/remove device Sricharan R
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=20170202174218.GO31394@leverpostej \
--to=mark.rutland-5wv7dgnigg8@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
--cc=joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=m.szyprowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
--cc=mathieu.poirier-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=robin.murphy-5wv7dgnIgG8@public.gmane.org \
--cc=sboyd-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=sricharan-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=will.deacon-5wv7dgnIgG8@public.gmane.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).