linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: mark.rutland@arm.com (Mark Rutland)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm: l2x0: add PMU support
Date: Thu, 18 Aug 2016 10:52:43 +0100	[thread overview]
Message-ID: <20160818095243.GA27045@leverpostej> (raw)
In-Reply-To: <20160818091058.GS1041@n2100.armlinux.org.uk>

Hi Russell,

On Thu, Aug 18, 2016 at 10:10:58AM +0100, Russell King - ARM Linux wrote:
> On Wed, Aug 17, 2016 at 05:26:31PM +0100, Mark Rutland wrote:
> > +static void l2x0_pmu_counter_config_write(int idx, u32 val)
> > +{
> > +	writel(val, l2x0_base + L2X0_EVENT_CNT0_CFG - 4 * idx);
> > +}
> > +
> > +static u32 l2x0_pmu_counter_read(int idx)
> > +{
> > +	return readl(l2x0_base + L2X0_EVENT_CNT0_VAL - 4 * idx);
> > +}
> > +
> > +static void l2x0_pmu_counter_write(int idx, u32 val)
> > +{
> > +	writel(val, l2x0_base + L2X0_EVENT_CNT0_VAL - 4 * idx);
> > +}
> > +
> > +static void __l2x0_pmu_enable(void)
> > +{
> > +	u32 val = readl(l2x0_base + L2X0_EVENT_CNT_CTRL);
> > +	val |= L2X0_EVENT_CNT_CTRL_ENABLE;
> > +	writel(val, l2x0_base + L2X0_EVENT_CNT_CTRL);
> > +}
> > +
> > +static void __l2x0_pmu_disable(void)
> > +{
> > +	u32 val = readl(l2x0_base + L2X0_EVENT_CNT_CTRL);
> > +	val &= ~L2X0_EVENT_CNT_CTRL_ENABLE;
> > +	writel(val, l2x0_base + L2X0_EVENT_CNT_CTRL);
> > +}
> 
> Are you sure you want to be using the barriered IOs here, which will
> come back in and run a sync on the L2C?

That is a very good point. I should not be using those here.

> Isn't that going to affect the performance measurements?

Yes. It will directly add to some counts, and will result in more lost
events than is necessary (as any L2C syncs performed while the PMU is
disabled delay enabling it again).

Thanks for pointing this out; I will fix this in v2.

Thanks,
Mark.

  reply	other threads:[~2016-08-18  9:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-17 16:26 [PATCH] arm: l2x0: add PMU support Mark Rutland
2016-08-18  9:10 ` Russell King - ARM Linux
2016-08-18  9:52   ` Mark Rutland [this message]
2016-08-19  0:05 ` Kim Phillips
2016-08-19 10:33   ` Mark Rutland

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=20160818095243.GA27045@leverpostej \
    --to=mark.rutland@arm.com \
    --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).