Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751949AbdCPHhx (ORCPT ); Thu, 16 Mar 2017 03:37:53 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:35312 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751185AbdCPHhu (ORCPT ); Thu, 16 Mar 2017 03:37:50 -0400 From: Madhavan Srinivasan To: mpe@ellerman.id.au Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Anju T Sudhakar , "Gautham R . Shenoy" , Balbir Singh , Benjamin Herrenschmidt , Paul Mackerras , Anton Blanchard , Sukadev Bhattiprolu , Michael Neuling , Stewart Smith , Daniel Axtens , Stephane Eranian , Madhavan Srinivasan Subject: [PATCH 13/13] powerpc/perf: Enable/disable core engine during cpuhotplug Date: Thu, 16 Mar 2017 13:05:07 +0530 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1489649707-8021-1-git-send-email-maddy@linux.vnet.ibm.com> References: <1489649707-8021-1-git-send-email-maddy@linux.vnet.ibm.com> X-TM-AS-MML: disable x-cbid: 17031607-1617-0000-0000-000001B7C899 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17031607-1618-0000-0000-000047F21307 Message-Id: <1489649707-8021-14-git-send-email-maddy@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-03-16_06:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1702020001 definitions=main-1703160061 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1809 Lines: 49 From: Anju T Sudhakar This patch disables the core imc engine when we offline all the cpus available in a core. Also it enables core imc when any of the cpu in that core comes back. Enable/disable core imc is done through the opal calls OPAL_CORE_IMC_ENABLE and OPAL_CORE_IMC_DISABLE respectively. Cc: Gautham R. Shenoy Cc: Balbir Singh Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Anton Blanchard Cc: Sukadev Bhattiprolu Cc: Michael Neuling Cc: Stewart Smith Cc: Daniel Axtens Cc: Stephane Eranian Signed-off-by: Anju T Sudhakar Signed-off-by: Madhavan Srinivasan --- arch/powerpc/perf/imc-pmu.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/perf/imc-pmu.c b/arch/powerpc/perf/imc-pmu.c index 2ff39fe2a5ce..278c7a427b43 100644 --- a/arch/powerpc/perf/imc-pmu.c +++ b/arch/powerpc/perf/imc-pmu.c @@ -127,6 +127,7 @@ static int ppc_core_imc_cpu_online(unsigned int cpu) /* Else, set the cpu in the mask, and change the context */ cpumask_set_cpu(cpu, &core_imc_cpumask); + opal_core_imc_counters_control(OPAL_CORE_IMC_ENABLE, 0, 0, 0); core_imc_change_cpu_context(-1, cpu); return 0; } @@ -149,8 +150,10 @@ static int ppc_core_imc_cpu_offline(unsigned int cpu) if (ncpu < nr_cpu_ids) { target = ncpu; cpumask_set_cpu(target, &core_imc_cpumask); - } else + } else { + opal_core_imc_counters_control(OPAL_CORE_IMC_DISABLE, 0, 0, 0); target = -1; + } /* migrate the context */ core_imc_change_cpu_context(cpu, target); -- 2.7.4