From: Nicolas Dufresne <nicolas@ndufresne.ca>
To: Will Deacon <will@kernel.org>, Jiucheng Xu <jiucheng.xu@amlogic.com>
Cc: Mark Rutland <mark.rutland@arm.com>,
Neil Armstrong <neil.armstrong@linaro.org>,
Kevin Hilman <khilman@baylibre.com>,
Jerome Brunet <jbrunet@baylibre.com>,
Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
Jianxin Pan <jianxin.pan@amlogic.com>,
Kelvin Zhang <kelvin.zhang@amlogic.com>,
Chris Healy <healych@amzon.com>,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-amlogic@lists.infradead.org
Subject: Re: [PATCH v11 1/3] perf/amlogic: Add support for Amlogic meson G12 SoC DDR PMU driver
Date: Fri, 25 Nov 2022 15:18:16 -0500 [thread overview]
Message-ID: <7e979311cb5199c4ba9dbf1b0aad027e25563614.camel@ndufresne.ca> (raw)
In-Reply-To: <20221118164157.GA4802@willie-the-truck>
Le vendredi 18 novembre 2022 à 16:41 +0000, Will Deacon a écrit :
> On Thu, Nov 17, 2022 at 04:34:15PM +0800, Jiucheng Xu wrote:
> > Add support for Amlogic Meson G12 Series SOC - DDR bandwidth PMU driver
> > framework and interfaces. The PMU can not only monitor the total DDR
> > bandwidth, but also individual IP module bandwidth.
> >
> > Signed-off-by: Jiucheng Xu <jiucheng.xu@amlogic.com>
> > Tested-by: Chris Healy <healych@amzon.com>
>
> amzon.com?
>
> > +static umode_t meson_ddr_perf_format_attr_visible(struct kobject *kobj,
> > + struct attribute *attr,
> > + int n)
> > +{
> > + struct pmu *pmu = dev_get_drvdata(kobj_to_dev(kobj));
> > + struct ddr_pmu *ddr_pmu = to_ddr_pmu(pmu);
> > + const u64 *capability = ddr_pmu->info.hw_info->capability;
> > + struct device_attribute *dev_attr;
> > + int id;
> > + char value[20]; // config1:xxx, 20 is enough
> > +
> > + dev_attr = container_of(attr, struct device_attribute, attr);
> > + dev_attr->show(NULL, NULL, value);
> > +
> > + if (sscanf(value, "config1:%d", &id) == 1)
> > + return capability[0] & (1 << id) ? attr->mode : 0;
> > +
> > + if (sscanf(value, "config2:%d", &id) == 1)
> > + return capability[1] & (1 << id) ? attr->mode : 0;
>
> Should these be '(1ULL << id)' to avoid shifting beyond the side of the
> 32-bit type?
Found:
typedef unsigned short umode_t;
I'd suggest the BIT() macro then, very easy to read and should work for this
case.
>
> Will
>
> _______________________________________________
> linux-amlogic mailing list
> linux-amlogic@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-amlogic
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
prev parent reply other threads:[~2022-11-25 20:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-17 8:34 Jiucheng Xu
2022-11-17 8:34 ` [PATCH v11 2/3] docs/perf: Add documentation for the Amlogic G12 DDR PMU Jiucheng Xu
2022-11-17 8:34 ` [PATCH v11 3/3] dt-binding: perf: Add Amlogic " Jiucheng Xu
2022-11-18 16:41 ` [PATCH v11 1/3] perf/amlogic: Add support for Amlogic meson G12 SoC DDR PMU driver Will Deacon
2022-11-25 20:18 ` Nicolas Dufresne [this message]
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=7e979311cb5199c4ba9dbf1b0aad027e25563614.camel@ndufresne.ca \
--to=nicolas@ndufresne.ca \
--cc=healych@amzon.com \
--cc=jbrunet@baylibre.com \
--cc=jianxin.pan@amlogic.com \
--cc=jiucheng.xu@amlogic.com \
--cc=kelvin.zhang@amlogic.com \
--cc=khilman@baylibre.com \
--cc=linux-amlogic@lists.infradead.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=martin.blumenstingl@googlemail.com \
--cc=neil.armstrong@linaro.org \
--cc=will@kernel.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
all inboxes | Powered by JetHome®