Patch "bus: arm-ccn: Fix PMU handling of MN" has been added to the 4.7-stable tree
This is a note to let you know that I've just added the patch titled
bus: arm-ccn: Fix PMU handling of MN
to the 4.7-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
bus-arm-ccn-fix-pmu-handling-of-mn.patch
and it can be found in the queue-4.7 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
4e486cba285ff06a1f28f0fc2991dde1482d1dcfMon Sep 17 00:00:00 2001
From: Pawel Moll <[email protected]>
Date: Tue, 2 Aug 2016 16:45:37 +0100
Subject: bus: arm-ccn: Fix PMU handling of MN
From: Pawel Moll <[email protected]>
commit 4e486cba285ff06a1f28f0fc2991dde1482d1dcf upstream.
The "Miscellaneous Node" fell through cracks of node initialisation, as its ID is shared with HN-I.
This patch treats MN as a special case (which it is), adding separate validation check for it and pre-defining the node ID in relevant events descriptions. That way one can simply run:
# perf stat -a -e ccn/mn_ecbarrier/ <workload>
Additionally, direction in the MN pseudo-events XP watchpoint definitions is corrected to be "TX" (1) as they are defined from the crosspoint point of view (thus barriers are transmitted from XP to MN).
--- drivers/bus/arm-ccn.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-)
drivers/bus/arm-ccn.c +16 -3
@@ -187,6 +187,7 @@ struct arm_ccn {struct arm_ccn_component *xp;struct arm_ccn_dt dt; +int mn_id; };
@@ -326,6 +327,7 @@ struct arm_ccn_pmu_event {static ssize_t arm_ccn_pmu_event_show (struct device *dev,struct device_attribute *attr,char *buf) { +struct arm_ccn *ccn =pmu_to_arm_ccn (dev_get_drvdata (dev));struct arm_ccn_pmu_event *event =container_of (attr, struct arm_ccn_pmu_event, attr);ssize_t res;
@@ -352,6 +354,9 @@ static ssize_t arm_ccn_pmu_event_show(st res +=snprintf (buf + res,PAGE_SIZE - res,",cmp_l=?,cmp_h=?,mask=?" );break ; +case CCN_TYPE_MN : + res +=snprintf (buf + res,PAGE_SIZE - res,",node=%d" , ccn->mn_id); +break ;default : res +=snprintf (buf + res,PAGE_SIZE - res,",node=?" );break ;
@@ -381,9 +386,9 @@ static umode_t arm_ccn_pmu_events_is_vis }static struct arm_ccn_pmu_event arm_ccn_pmu_events[] = { -CCN_EVENT_MN (eobarrier,"dir=0,vc=0,cmp_h=0x1c00" ,CCN_IDX_MASK_OPCODE ), -CCN_EVENT_MN (ecbarrier,"dir=0,vc=0,cmp_h=0x1e00" ,CCN_IDX_MASK_OPCODE ), -CCN_EVENT_MN (dvmop,"dir=0,vc=0,cmp_h=0x2800" ,CCN_IDX_MASK_OPCODE ), +CCN_EVENT_MN (eobarrier,"dir=1,vc=0,cmp_h=0x1c00" ,CCN_IDX_MASK_OPCODE ), +CCN_EVENT_MN (ecbarrier,"dir=1,vc=0,cmp_h=0x1e00" ,CCN_IDX_MASK_OPCODE ), +CCN_EVENT_MN (dvmop,"dir=1,vc=0,cmp_h=0x2800" ,CCN_IDX_MASK_OPCODE ),CCN_EVENT_HNI (txdatflits,"dir=1,vc=3" ,CCN_IDX_MASK_ANY ),CCN_EVENT_HNI (rxdatflits,"dir=0,vc=3" ,CCN_IDX_MASK_ANY ),CCN_EVENT_HNI (txreqflits,"dir=1,vc=0" ,CCN_IDX_MASK_ANY ),
@@ -757,6 +762,12 @@ static int arm_ccn_pmu_event_init(struct/* Validate node/xp vs topology */ switch (type) { +case CCN_TYPE_MN : +if (node_xp != ccn->mn_id) { +dev_warn (ccn->dev,"Invalid MN ID %d!\n" , node_xp); +return -EINVAL ; + } +break ;case CCN_TYPE_XP :if (node_xp >= ccn->num_xps) {dev_warn (ccn->dev,"Invalid XP ID %d!\n" , node_xp);
@@ -1369,6 +1380,8 @@ static int arm_ccn_init_nodes(struct armswitch (type) {case CCN_TYPE_MN : + ccn->mn_id = id; +return 0 ;case CCN_TYPE_DT :return 0 ;case CCN_TYPE_XP :
Patches currently in stable-queue which might be from [email protected] are
queue-4.7/bus-arm-ccn-fix-xp-watchpoint-settings-bitmask.patch queue-4.7/bus-arm-ccn-do-not-attempt-to-configure-xps-for-cycle-counter.patch queue-4.7/bus-arm-ccn-fix-pmu-handling-of-mn.patch