Skip to content

Commit c578121

Browse files
rmurphy-armwilldeacon
authored andcommitted
perf/arm-cmn: Decode CAL devices properly in debugfs
The debugfs code is lazy, and since it only keeps the bottom byte of each connect_info register to save space, it also treats the whole thing as the device_type since the other bits were reserved anyway. Upon closer inspection, though, this is no longer true on newer IP versions, so let's be good and decode the exact field properly. This should help it not get confused when a Component Aggregation Layer is present (which is already implied if Node IDs are found for both device addresses represented by the next two lines of the table). Signed-off-by: Robin Murphy <[email protected]> Link: https://lore.kernel.org/r/6a13a6128a28cfe2eec6d09cf372a167ec9c3b65.1652274773.git.robin.murphy@arm.com Signed-off-by: Will Deacon <[email protected]>
1 parent 3630b2a commit c578121

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/perf/arm-cmn.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
#define CMN_MXP__CONNECT_INFO_P3 0x0030
6464
#define CMN_MXP__CONNECT_INFO_P4 0x0038
6565
#define CMN_MXP__CONNECT_INFO_P5 0x0040
66+
#define CMN__CONNECT_INFO_DEVICE_TYPE GENMASK_ULL(4, 0)
6667

6768
/* PMU registers occupy the 3rd 4KB page of each node's region */
6869
#define CMN_PMU_OFFSET 0x2000
@@ -400,7 +401,7 @@ static struct dentry *arm_cmn_debugfs;
400401
#ifdef CONFIG_DEBUG_FS
401402
static const char *arm_cmn_device_type(u8 type)
402403
{
403-
switch(type) {
404+
switch(FIELD_GET(CMN__CONNECT_INFO_DEVICE_TYPE, type)) {
404405
case 0x00: return " |";
405406
case 0x01: return " RN-I |";
406407
case 0x02: return " RN-D |";

0 commit comments

Comments
 (0)