All of lore.kernel.org
 help / color / mirror / Atom feed
From: Will Deacon <will.deacon@arm.com>
To: Zhi Li <lznuaa@gmail.com>
Cc: "mark.rutland@arm.com" <mark.rutland@arm.com>,
	Aisheng Dong <aisheng.dong@nxp.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"festevam@gmail.com" <festevam@gmail.com>,
	"s.hauer@pengutronix.de" <s.hauer@pengutronix.de>,
	Frank Li <frank.li@nxp.com>,
	"robh+dt@kernel.org" <robh+dt@kernel.org>,
	dl-linux-imx <linux-imx@nxp.com>,
	"kernel@pengutronix.de" <kernel@pengutronix.de>,
	"shawnguo@kernel.org" <shawnguo@kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH V4 2/4] drivers/perf: imx_ddr: Add ddr performance counter support
Date: Tue, 16 Apr 2019 14:51:16 +0100	[thread overview]
Message-ID: <20190416135116.GC3313@fuggles.cambridge.arm.com> (raw)
In-Reply-To: <CAHrpEqQnJAdUeKLUFE0r6DxnCtitEumvgd5xOzKmJmYXy3mQ4w@mail.gmail.com>

On Mon, Apr 08, 2019 at 02:10:28PM -0500, Zhi Li wrote:
> On Fri, Apr 5, 2019 at 10:03 AM Will Deacon <will.deacon@arm.com> wrote:
> >
> > On Fri, Apr 05, 2019 at 09:58:38AM -0500, Zhi Li wrote:
> > > On Fri, Apr 5, 2019 at 9:38 AM Will Deacon <will.deacon@arm.com> wrote:
> > > > On Fri, Apr 05, 2019 at 09:34:38AM -0500, Zhi Li wrote:
> > > > > On Thu, Apr 4, 2019 at 6:17 AM Will Deacon <will.deacon@arm.com> wrote:
> > > > > > On Fri, Feb 15, 2019 at 06:03:11PM +0000, Frank Li wrote:
> > > > > > > Add ddr performance monitor support for iMX8QXP
> > > > > > >
> > > > > > > There are 4 counters for ddr perfomance events.
> > > > > > > counter 0 is dedicated for cycles.
> > > > > > > you choose any up to 3 no cycles events.
> > > > > > >
> > > > > > > for example:
> > > > > > >
> > > > > > > perf stat -a -e ddr0/read-access/,ddr0/write-access/,ddr0/precharge/ ls
> > > > > > > perf stat -a -e ddr0/cycles/,ddr0/read-access/,ddr0/write-access/ ls
> > > > > >
> > > > > > Could you elaborate a bit on DDR_CAP_AXI_ID, please? Specifically, how
> > >
> > > Only imx845 have AXID filter capability now.
> > >
> > > > > > does the COUNTER_DPCR1 register work and what happens if I specify two
> > > > > > simultaneous events with different values in config1? I'm a little wary
> > >
> > > There are difference match register for each event.
> > > 1. Read event with config 1 A
> > > 2. Read event with config 1 B
> > >
> > > 1 will show read count with filter A
> > > 2 will show read count with filter B.
> >
> > Thanks, that makes sense, but I can't see how that corresponds to the code
> > in the patch:
> >
> > +static void ddr_perf_event_start(struct perf_event *event, int flags)
> > +{
> > +       struct ddr_pmu *pmu = to_ddr_pmu(event->pmu);
> > +       struct hw_perf_event *hwc = &event->hw;
> > +       int counter = hwc->idx;
> > +
> > +       if (pmu->flags & DDR_CAP_AXI_ID) {
> > +               if (event->attr.config == EVENT_AXI_READ ||
> > +                   event->attr.config == EVENT_AXI_WRITE) {
> > +                       int val = event->attr.config1;
> > +
> > +                       writel(val, pmu->base + COUNTER_DPCR1);
> > +               }
> > +       }
> > +
> > +       local64_set(&hwc->prev_count, 0);
> > +
> > +       ddr_perf_event_enable(pmu, event->attr.config, counter, true);
> >
> > ddr_perf_event_enable() does what you'd expect, and uses hwc->idx to
> > allocate a counter, but the code before it just always writes to DPCR1.
> >
> > What am I missing?
> 
> I double check with our IC design team. My previous answer is wrong.
> Only one DPCR1. It will impact all event EVENT_AXI_READ and  EVENT_AXI_WRITE.
> 
> Thank means just choose one config1 for event EVENT_AXI_READ or EVENT_AXI_WRITE

I think you need either to enforce that in the driver, or drop this
filtering capability for now. We shouldn't just tell userspace "oh yeah,
don't do that."

Given that your patch 3 (which updates a .dts file) doesn't appear to
support the filtering, I suggest just dropping that support initially so
that we can queue the rest of this driver for 5.2.

Will

WARNING: multiple messages have this Message-ID (diff)
From: Will Deacon <will.deacon@arm.com>
To: Zhi Li <lznuaa@gmail.com>
Cc: "mark.rutland@arm.com" <mark.rutland@arm.com>,
	Aisheng Dong <aisheng.dong@nxp.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"festevam@gmail.com" <festevam@gmail.com>,
	"s.hauer@pengutronix.de" <s.hauer@pengutronix.de>,
	Frank Li <frank.li@nxp.com>,
	"robh+dt@kernel.org" <robh+dt@kernel.org>,
	dl-linux-imx <linux-imx@nxp.com>,
	"kernel@pengutronix.de" <kernel@pengutronix.de>,
	"shawnguo@kernel.org" <shawnguo@kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH V4 2/4] drivers/perf: imx_ddr: Add ddr performance counter support
Date: Tue, 16 Apr 2019 14:51:16 +0100	[thread overview]
Message-ID: <20190416135116.GC3313@fuggles.cambridge.arm.com> (raw)
In-Reply-To: <CAHrpEqQnJAdUeKLUFE0r6DxnCtitEumvgd5xOzKmJmYXy3mQ4w@mail.gmail.com>

On Mon, Apr 08, 2019 at 02:10:28PM -0500, Zhi Li wrote:
> On Fri, Apr 5, 2019 at 10:03 AM Will Deacon <will.deacon@arm.com> wrote:
> >
> > On Fri, Apr 05, 2019 at 09:58:38AM -0500, Zhi Li wrote:
> > > On Fri, Apr 5, 2019 at 9:38 AM Will Deacon <will.deacon@arm.com> wrote:
> > > > On Fri, Apr 05, 2019 at 09:34:38AM -0500, Zhi Li wrote:
> > > > > On Thu, Apr 4, 2019 at 6:17 AM Will Deacon <will.deacon@arm.com> wrote:
> > > > > > On Fri, Feb 15, 2019 at 06:03:11PM +0000, Frank Li wrote:
> > > > > > > Add ddr performance monitor support for iMX8QXP
> > > > > > >
> > > > > > > There are 4 counters for ddr perfomance events.
> > > > > > > counter 0 is dedicated for cycles.
> > > > > > > you choose any up to 3 no cycles events.
> > > > > > >
> > > > > > > for example:
> > > > > > >
> > > > > > > perf stat -a -e ddr0/read-access/,ddr0/write-access/,ddr0/precharge/ ls
> > > > > > > perf stat -a -e ddr0/cycles/,ddr0/read-access/,ddr0/write-access/ ls
> > > > > >
> > > > > > Could you elaborate a bit on DDR_CAP_AXI_ID, please? Specifically, how
> > >
> > > Only imx845 have AXID filter capability now.
> > >
> > > > > > does the COUNTER_DPCR1 register work and what happens if I specify two
> > > > > > simultaneous events with different values in config1? I'm a little wary
> > >
> > > There are difference match register for each event.
> > > 1. Read event with config 1 A
> > > 2. Read event with config 1 B
> > >
> > > 1 will show read count with filter A
> > > 2 will show read count with filter B.
> >
> > Thanks, that makes sense, but I can't see how that corresponds to the code
> > in the patch:
> >
> > +static void ddr_perf_event_start(struct perf_event *event, int flags)
> > +{
> > +       struct ddr_pmu *pmu = to_ddr_pmu(event->pmu);
> > +       struct hw_perf_event *hwc = &event->hw;
> > +       int counter = hwc->idx;
> > +
> > +       if (pmu->flags & DDR_CAP_AXI_ID) {
> > +               if (event->attr.config == EVENT_AXI_READ ||
> > +                   event->attr.config == EVENT_AXI_WRITE) {
> > +                       int val = event->attr.config1;
> > +
> > +                       writel(val, pmu->base + COUNTER_DPCR1);
> > +               }
> > +       }
> > +
> > +       local64_set(&hwc->prev_count, 0);
> > +
> > +       ddr_perf_event_enable(pmu, event->attr.config, counter, true);
> >
> > ddr_perf_event_enable() does what you'd expect, and uses hwc->idx to
> > allocate a counter, but the code before it just always writes to DPCR1.
> >
> > What am I missing?
> 
> I double check with our IC design team. My previous answer is wrong.
> Only one DPCR1. It will impact all event EVENT_AXI_READ and  EVENT_AXI_WRITE.
> 
> Thank means just choose one config1 for event EVENT_AXI_READ or EVENT_AXI_WRITE

I think you need either to enforce that in the driver, or drop this
filtering capability for now. We shouldn't just tell userspace "oh yeah,
don't do that."

Given that your patch 3 (which updates a .dts file) doesn't appear to
support the filtering, I suggest just dropping that support initially so
that we can queue the rest of this driver for 5.2.

Will

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2019-04-16 13:51 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-15 18:03 [PATCH V4 1/4] dt-bindings: perf: imx8-ddr: add imx8qxp ddr performance monitor Frank Li
2019-02-15 18:03 ` Frank Li
2019-02-15 18:03 ` [PATCH V4 2/4] drivers/perf: imx_ddr: Add ddr performance counter support Frank Li
2019-02-15 18:03   ` Frank Li
2019-02-22 19:45   ` Zhi Li
2019-02-22 19:45     ` Zhi Li
2019-02-28 21:39     ` Zhi Li
2019-02-28 21:39       ` Zhi Li
2019-03-12 21:49       ` Zhi Li
2019-03-12 21:49         ` Zhi Li
2019-04-04 11:17   ` Will Deacon
2019-04-04 11:17     ` Will Deacon
2019-04-05 14:34     ` Zhi Li
2019-04-05 14:34       ` Zhi Li
2019-04-05 14:38       ` Will Deacon
2019-04-05 14:38         ` Will Deacon
2019-04-05 14:58         ` Zhi Li
2019-04-05 14:58           ` Zhi Li
2019-04-05 15:03           ` Will Deacon
2019-04-05 15:03             ` Will Deacon
2019-04-08 19:10             ` Zhi Li
2019-04-08 19:10               ` Zhi Li
2019-04-16 13:51               ` Will Deacon [this message]
2019-04-16 13:51                 ` Will Deacon
2019-04-16 20:41                 ` Zhi Li
2019-04-16 20:41                   ` Zhi Li
2019-02-15 18:03 ` [PATCH V4 3/4] arm64: dts: imx8qxp: added ddr performance monitor nodes Frank Li
2019-02-15 18:03   ` Frank Li
2019-02-18 17:38   ` Fabio Estevam
2019-02-18 17:38     ` Fabio Estevam
2019-02-15 18:03 ` [PATCH V4 4/4] MAINTAINERS: Added imx DDR performonitor driver maintainer information Frank Li
2019-02-15 18:03   ` Frank Li
2019-02-15 20:01   ` Uwe Kleine-König
2019-02-15 20:01     ` Uwe Kleine-König
2019-02-15 21:13     ` Zhi Li
2019-02-15 21:44       ` Uwe Kleine-König
2019-02-15 21:44         ` Uwe Kleine-König
2019-02-18  1:22         ` Shawn Guo
2019-02-18  1:22           ` Shawn Guo
2019-02-20  6:28         ` Aisheng Dong
2019-02-20  6:28           ` Aisheng Dong
2019-02-18 16:56 ` [PATCH V4 1/4] dt-bindings: perf: imx8-ddr: add imx8qxp ddr performance monitor Rob Herring
2019-02-18 16:56   ` Rob Herring

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=20190416135116.GC3313@fuggles.cambridge.arm.com \
    --to=will.deacon@arm.com \
    --cc=aisheng.dong@nxp.com \
    --cc=devicetree@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=frank.li@nxp.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=lznuaa@gmail.com \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.