From: pawel.moll@arm.com (Pawel Moll)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/5] bus: arm-ccn: Correct required arguments for XP PMU events
Date: Fri, 12 Aug 2016 17:25:55 +0100 [thread overview]
Message-ID: <1471019156-5485-5-git-send-email-pawel.moll@arm.com> (raw)
In-Reply-To: <1471019156-5485-1-git-send-email-pawel.moll@arm.com>
XP can provide events from two sources: watchpoints, observing traffic
on device ports and PMU looking at internal buses.
Unfortunately the sysfs definition of the PMU events was requiring
port number (instead of bus number) and direction (the buses are
unidirectional), as these fields were shared with the watchpoint event.
Although it does not introduce a major problem (port can be used as
bus alias and direction is simply ignored for XP PMU events), it's
better to fix it now, before external tools start depending on this
behaviour.
Signed-off-by: Pawel Moll <pawel.moll@arm.com>
---
drivers/bus/arm-ccn.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/drivers/bus/arm-ccn.c b/drivers/bus/arm-ccn.c
index 647a27b..e7c2321 100644
--- a/drivers/bus/arm-ccn.c
+++ b/drivers/bus/arm-ccn.c
@@ -213,6 +213,7 @@ static int arm_ccn_node_to_xp_port(int node)
#define CCN_CONFIG_TYPE(_config) (((_config) >> 8) & 0xff)
#define CCN_CONFIG_EVENT(_config) (((_config) >> 16) & 0xff)
#define CCN_CONFIG_PORT(_config) (((_config) >> 24) & 0x3)
+#define CCN_CONFIG_BUS(_config) (((_config) >> 24) & 0x3)
#define CCN_CONFIG_VC(_config) (((_config) >> 26) & 0x7)
#define CCN_CONFIG_DIR(_config) (((_config) >> 29) & 0x1)
#define CCN_CONFIG_MASK(_config) (((_config) >> 30) & 0xf)
@@ -242,6 +243,7 @@ static CCN_FORMAT_ATTR(xp, "config:0-7");
static CCN_FORMAT_ATTR(type, "config:8-15");
static CCN_FORMAT_ATTR(event, "config:16-23");
static CCN_FORMAT_ATTR(port, "config:24-25");
+static CCN_FORMAT_ATTR(bus, "config:24-25");
static CCN_FORMAT_ATTR(vc, "config:26-28");
static CCN_FORMAT_ATTR(dir, "config:29-29");
static CCN_FORMAT_ATTR(mask, "config:30-33");
@@ -351,10 +353,14 @@ static ssize_t arm_ccn_pmu_event_show(struct device *dev,
break;
case CCN_TYPE_XP:
res += snprintf(buf + res, PAGE_SIZE - res,
- ",xp=?,port=?,vc=?,dir=?");
+ ",xp=?,vc=?");
if (event->event == CCN_EVENT_WATCHPOINT)
res += snprintf(buf + res, PAGE_SIZE - res,
- ",cmp_l=?,cmp_h=?,mask=?");
+ ",port=?,dir=?,cmp_l=?,cmp_h=?,mask=?");
+ else
+ res += snprintf(buf + res, PAGE_SIZE - res,
+ ",bus=?");
+
break;
case CCN_TYPE_MN:
res += snprintf(buf + res, PAGE_SIZE - res, ",node=%d", ccn->mn_id);
@@ -1029,7 +1035,7 @@ static void arm_ccn_pmu_xp_event_config(struct perf_event *event)
hw->event_base = CCN_XP_DT_CONFIG__DT_CFG__XP_PMU_EVENT(hw->config_base);
id = (CCN_CONFIG_VC(event->attr.config) << 4) |
- (CCN_CONFIG_PORT(event->attr.config) << 3) |
+ (CCN_CONFIG_BUS(event->attr.config) << 3) |
(CCN_CONFIG_EVENT(event->attr.config) << 0);
val = readl(source->base + CCN_XP_PMU_EVENT_SEL);
--
2.7.4
next prev parent reply other threads:[~2016-08-12 16:25 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-12 16:25 [PATCH 0/5] CCN fixes for 4.8 Pawel Moll
2016-08-12 16:25 ` [PATCH 1/5] bus: arm-ccn: Fix PMU handling of MN Pawel Moll
2016-08-12 16:25 ` [PATCH 2/5] bus: arm-ccn: Do not attempt to configure XPs for cycle counter Pawel Moll
2016-08-12 16:25 ` [PATCH 3/5] bus: arm-ccn: Fix XP watchpoint settings bitmask Pawel Moll
2016-08-12 16:25 ` Pawel Moll [this message]
2016-08-12 16:25 ` [PATCH 5/5] bus: arm-ccn: Add missing event attribute exclusions for host/guest Pawel Moll
2016-09-02 14:01 ` [PATCH 0/5] CCN fixes for 4.8 Arnd Bergmann
2016-09-02 14:07 ` Pawel Moll
2016-09-02 14:12 ` Arnd Bergmann
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=1471019156-5485-5-git-send-email-pawel.moll@arm.com \
--to=pawel.moll@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).