From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9B6993F660E for ; Mon, 29 Jun 2026 09:00:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782723615; cv=none; b=J99MKi7cqe5RCsgehV2vXnEu3N6BVVZR7ht5g+93CznutWwDipNAQdFtmRiS9AcYnLvlwV04VKwDO/77nfR+qhSyVe83RQ7ThhE7W2XZM18ySx8ih2AMSKOV8IhCmAhuWApegRfJ6BZNal+HXAr2Reyr13D2SYC4eSh7Bh+0jiU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782723615; c=relaxed/simple; bh=yuWjaIMKIf5i6x1/uorLgf8zTF2UyYw+ckJ94QtfUbw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hF2RhcTLpILFcRp8Z9wAXGR5odzE1aUX0UTz0gAvaSnBWC+eihbyidzSMFj39KsxNMrmqvkMwjcUWwOR5Egtg/YrQrdD7mxBQR6PQozHJhRGij/6AnWO7hCPyZSUqZgOeEwF2NTfM0SgiLUOEQHZP9YklDRWcLs6bmMC8ijHLII= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b=tQwftB46; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b="tQwftB46" Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 90AC71A00; Mon, 29 Jun 2026 02:00:08 -0700 (PDT) Received: from e129823.cambridge.arm.com (e129823.arm.com [10.2.213.3]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 4CA9B3F836; Mon, 29 Jun 2026 02:00:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1782723613; bh=yuWjaIMKIf5i6x1/uorLgf8zTF2UyYw+ckJ94QtfUbw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tQwftB46xpbSwDbrabUKy51NUYSladOkmrygPHaSGh/6kIcDWGPOaSUIAULRNp45T PXY+xamz2y6Zw6nvmncrh2CZmpVswbjShZ2ye79O7XGRbqIyQkOODgGHmX8o7TN12h csfh4ONP33XJ4Ph+kPfmN6C6SlhOUTwWkzUy9ouY= From: Yeoreum Yun To: coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: suzuki.poulose@arm.com, mike.leach@arm.com, james.clark@linaro.org, alexander.shishkin@linux.intel.com, leo.yan@arm.com, jie.gan@oss.qualcomm.com, Yeoreum Yun Subject: [PATCH v8 01/13] coresight: etm4x: fix wrong check of etm4x_sspcicrn_present() Date: Mon, 29 Jun 2026 09:59:54 +0100 Message-ID: <20260629090007.1718746-2-yeoreum.yun@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260629090007.1718746-1-yeoreum.yun@arm.com> References: <20260629090007.1718746-1-yeoreum.yun@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit According to Embedded Trace Macrocell Architecture Specification ETMv4.0 to ETM4.6 [0], TRCSSPCICR is present only if all of the following are true: - TRCIDR4.NUMSSCC > n. - TRCIDR4.NUMPC > 0b0000. - TRCSSCSR.PC == 0b1. Comment for etm4x_sspcicrn_present() is align with the specification. However, the check should use drvdata->nr_pe_cmp to check TRCIDR4.NUMPC not nr_pe. Link: https://developer.arm.com/documentation/ihi0064/latest/ [0] Fixes: f6a18f354c58 ("coresight: etm4x: Handle access to TRCSSPCICRn") Reviewed-by: Leo Yan Signed-off-by: Yeoreum Yun --- drivers/hwtracing/coresight/coresight-etm4x-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hwtracing/coresight/coresight-etm4x-core.c b/drivers/hwtracing/coresight/coresight-etm4x-core.c index 14bb31bd6a0b..1e3b0344dc00 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x-core.c +++ b/drivers/hwtracing/coresight/coresight-etm4x-core.c @@ -93,7 +93,7 @@ static int etm4_probe_cpu(unsigned int cpu); static bool etm4x_sspcicrn_present(struct etmv4_drvdata *drvdata, int n) { return (n < drvdata->nr_ss_cmp) && - drvdata->nr_pe && + drvdata->nr_pe_cmp && (drvdata->config.ss_status[n] & TRCSSCSRn_PC); } -- LEVI:{C3F47F37-75D8-414A-A8BA-3980EC8A46D7}