From patchwork Tue Apr 25 03:24:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ruidong Tian X-Patchwork-Id: 13222777 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 83DC2C77B61 for ; Tue, 25 Apr 2023 03:25:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=g2gjtfw6J7nPw6R0AJeLTn17DPBlzOucmhTbLRrlPgg=; b=tSSGSY1HXXyTI4 WiXqA2i9/1QXTT094cPEHsmbxB+H2Rt7RvoIK/d0IAtDrFKoCxrhl+ri7Hcjz4R3nCeSKv6qEREpr ZDKRa8B2cxvHV07XTg+Ic0OTpeqxA8jO/9E5xfYb5GN03vJvN6Es+no1+/LJpMQ+C85EzWBfOnOyj tnSJvjvYJXOm7WH7pJgWcFHgDZ0LCcbvPSlLOH0na7jN1OLR575WuMtVpKtjNM7p6AYrwyQFVDg/P K0T0w++CwQLQrGwnwbuIyXXV88NXYH9n/hJfMZkzFoUfUsyEg8U+K1PdrgjjozPyE3ALpLFHv3inu fICNYKbMKFZbPAinwjXA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pr9I9-0005lr-1C; Tue, 25 Apr 2023 03:24:33 +0000 Received: from out30-98.freemail.mail.aliyun.com ([115.124.30.98]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pr9I5-0005kj-2N for linux-arm-kernel@lists.infradead.org; Tue, 25 Apr 2023 03:24:31 +0000 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R781e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045168;MF=tianruidong@linux.alibaba.com;NM=1;PH=DS;RN=8;SR=0;TI=SMTPD_---0VgyI3jM_1682393057; Received: from localhost(mailfrom:tianruidong@linux.alibaba.com fp:SMTPD_---0VgyI3jM_1682393057) by smtp.aliyun-inc.com; Tue, 25 Apr 2023 11:24:21 +0800 From: Ruidong Tian To: tianruidong@linux.alibaba.com, coresight@lists.linaro.org Cc: suzuki.poulose@arm.com, mike.leach@linaro.org, leo.yan@linaro.org, alexander.shishkin@linux.intel.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] coresight: perf: Release Coresight path when alloc trace id failed Date: Tue, 25 Apr 2023 11:24:16 +0800 Message-Id: <20230425032416.125542-1-tianruidong@linux.alibaba.com> X-Mailer: git-send-email 2.33.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230424_202429_966103_0564B450 X-CRM114-Status: UNSURE ( 6.83 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Error handler for etm_setup_aux can not release coresight path because cpu mask was cleared when coresight_trace_id_get_cpu_id failed. Call coresight_release_path function explicitly when alloc trace id filed. Signed-off-by: Ruidong Tian --- drivers/hwtracing/coresight/coresight-etm-perf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/hwtracing/coresight/coresight-etm-perf.c b/drivers/hwtracing/coresight/coresight-etm-perf.c index 711f451b6946..89e8ed214ea4 100644 --- a/drivers/hwtracing/coresight/coresight-etm-perf.c +++ b/drivers/hwtracing/coresight/coresight-etm-perf.c @@ -402,6 +402,7 @@ static void *etm_setup_aux(struct perf_event *event, void **pages, trace_id = coresight_trace_id_get_cpu_id(cpu); if (!IS_VALID_CS_TRACE_ID(trace_id)) { cpumask_clear_cpu(cpu, mask); + coresight_release_path(path); continue; }