From: Will Deacon <will@kernel.org>
To: 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, 18 Nov 2022 16:41:59 +0000 [thread overview]
Message-ID: <20221118164157.GA4802@willie-the-truck> (raw)
In-Reply-To: <20221117083419.2084264-1-jiucheng.xu@amlogic.com>
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?
Will
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2022-11-18 16:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-17 8:34 [PATCH v11 1/3] perf/amlogic: Add support for Amlogic meson G12 SoC DDR PMU driver 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 ` Will Deacon [this message]
2022-11-25 20:18 ` [PATCH v11 1/3] perf/amlogic: Add support for Amlogic meson G12 SoC DDR PMU driver Nicolas Dufresne
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=20221118164157.GA4802@willie-the-truck \
--to=will@kernel.org \
--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 \
/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