From: Dave Aldridge Date: Wed, 14 Sep 2016 13:20:54 +0000 (-0700) Subject: sonoma: perf: add support for sonoma (s7) into perf X-Git-Tag: v4.1.12-92~12^2~3 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=e3125b871798dcd831daaf70bb05ff3f005277fb;p=users%2Fjedix%2Flinux-maple.git sonoma: perf: add support for sonoma (s7) into perf This commit ensures that perf will now recognise that it is running on a sonoma device and will initialise correctly. Orabug: 24931042 Signed-off-by: Dave Aldridge (cherry picked from commit f39f00c4536c8c6ca0585a200a56894c2c158743) Signed-off-by: Allen Pais --- diff --git a/arch/sparc/kernel/pcr.c b/arch/sparc/kernel/pcr.c index eb978c77c76a7..1f69e8322fe6f 100644 --- a/arch/sparc/kernel/pcr.c +++ b/arch/sparc/kernel/pcr.c @@ -274,6 +274,7 @@ static int __init register_perf_hsvc(void) break; case SUN4V_CHIP_SPARC_M7: + case SUN4V_CHIP_SPARC_S7: perf_hsvc_group = HV_GRP_M7_PERF; break; @@ -323,6 +324,7 @@ static int __init setup_sun4v_pcr_ops(void) break; case SUN4V_CHIP_SPARC_M7: + case SUN4V_CHIP_SPARC_S7: pcr_ops = &m7_pcr_ops; break; diff --git a/arch/sparc/kernel/perf_event.c b/arch/sparc/kernel/perf_event.c index b5cdc95084bd4..f6ab01588d2ef 100644 --- a/arch/sparc/kernel/perf_event.c +++ b/arch/sparc/kernel/perf_event.c @@ -1189,7 +1189,8 @@ static bool is_stop_counting_cycles_requested(u64 val) */ if (!strcmp(sparc_pmu_type, "niagara4") || !strcmp(sparc_pmu_type, "niagara5") || - !strcmp(sparc_pmu_type, "sparc-m7")) { + !strcmp(sparc_pmu_type, "sparc-m7") || + !strcmp(sparc_pmu_type, "sparc-s7")) { if ((val & PCR_N4_SL) == PCR_N4_CYCLES_SELECTED) ret = true; } @@ -1203,7 +1204,8 @@ static void wait_for_counter_overflow(int pcr_index) if (!strcmp(sparc_pmu_type, "niagara4") || !strcmp(sparc_pmu_type, "niagara5") || - !strcmp(sparc_pmu_type, "sparc-m7")) { + !strcmp(sparc_pmu_type, "sparc-m7") || + !strcmp(sparc_pmu_type, "sparc-s7")) { pcr = pcr_ops->read_pcr(pcr_index); if (((pcr & PCR_N4_SL) == PCR_N4_CYCLES_SELECTED) && ((pcr & PCR_N4_UTRACE) || (pcr & PCR_N4_STRACE))) { @@ -1882,7 +1884,8 @@ static bool __init supported_pmu(void) sparc_pmu = &niagara4_pmu; return true; } - if (!strcmp(sparc_pmu_type, "sparc-m7")) { + if (!strcmp(sparc_pmu_type, "sparc-m7") || + !strcmp(sparc_pmu_type, "sparc-s7")) { sparc_pmu = &sparc_m7_pmu; return true; }