From patchwork Mon Apr 9 09:00:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anju T Sudhakar X-Patchwork-Id: 896184 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40KPSd6jpPz9s25 for ; Mon, 9 Apr 2018 19:02:09 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.vnet.ibm.com Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 40KPSd4CbfzF2B0 for ; Mon, 9 Apr 2018 19:02:09 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.vnet.ibm.com X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=none (mailfrom) smtp.mailfrom=linux.vnet.ibm.com (client-ip=148.163.158.5; helo=mx0a-001b2d01.pphosted.com; envelope-from=anju@linux.vnet.ibm.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.vnet.ibm.com Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 40KPQp0GTszDrpY for ; Mon, 9 Apr 2018 19:00:33 +1000 (AEST) Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w398wrWv126361 for ; Mon, 9 Apr 2018 05:00:31 -0400 Received: from e06smtp12.uk.ibm.com (e06smtp12.uk.ibm.com [195.75.94.108]) by mx0b-001b2d01.pphosted.com with ESMTP id 2h84u68vak-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Mon, 09 Apr 2018 05:00:30 -0400 Received: from localhost by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 9 Apr 2018 10:00:28 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp12.uk.ibm.com (192.168.101.142) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 9 Apr 2018 10:00:27 +0100 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w3990RRN2228712; Mon, 9 Apr 2018 09:00:27 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C05E84C046; Mon, 9 Apr 2018 09:53:09 +0100 (BST) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0272A4C04A; Mon, 9 Apr 2018 09:53:09 +0100 (BST) Received: from xenial-xerus.in.ibm.com (unknown [9.124.35.144]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 9 Apr 2018 09:53:08 +0100 (BST) From: Anju T Sudhakar To: mpe@ellerman.id.au Subject: [PATCH 0/4] powerpc/perf: IMC Cleanups Date: Mon, 9 Apr 2018 14:30:21 +0530 X-Mailer: git-send-email 2.7.4 X-TM-AS-GCONF: 00 x-cbid: 18040909-0008-0000-0000-000004E841D4 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18040909-0009-0000-0000-00001E7B64CA Message-Id: <1523264425-19544-1-git-send-email-anju@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-04-09_03:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1804090099 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: maddy@linux.vnet.ibm.com, linuxppc-dev@lists.ozlabs.org, anju@linux.vnet.ibm.com Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" This patch series includes some cleanups and Unregistration of thread-imc pmu, if the kernel does not have core-imc registered. The entire patch set has been verified using the static checker smatch. Command used: $ make ARCH=powerpc CHECK="/smatch -p=kernel" C=1 vmlinux | tee warns.txt Tests Done: * Fail core-imc at init: nest-imc - working cpuhotplug - works as expected thread-imc - not registered * Fail thread-imc at init: nest-imc - works core-imc - works cpuhotplug - works * Fail nest-imc at init core-imc - works thread-imc -works cpuhotplug - works * Fail only one nest unit (say for mcs23) Other nest-units - works core-imc - works thread-imc - works cpuhotplug - works. * Kexec works The first three patches in this series addresses the comments by Dan Carpenter. Anju T Sudhakar (4): powerpc/perf: Rearrange memory freeing in imc init powerpc/perf: Replace the direct return with goto statement powerpc/perf: Return appropriate value for unknown domain powerpc/perf: Unregister thread-imc if core-imc not supported arch/powerpc/include/asm/imc-pmu.h | 1 + arch/powerpc/perf/imc-pmu.c | 64 +++++++++++++++++++------------ arch/powerpc/platforms/powernv/opal-imc.c | 22 +++++++++-- 3 files changed, 60 insertions(+), 27 deletions(-)