From nobody Mon Apr 13 07:31:42 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5EEFB3806CB for ; Mon, 9 Mar 2026 09:48:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773049713; cv=none; b=i8zEIqVSincEoXE7RcM+ICtdKGYxloikkTQEoGSFXbnsVTxTxyBMTE+BV3+loMLo6BWOHM+N/19Mu9QnTlIdGCRR40zHB0iu7E3c34jq9420Idc3yMZfOa5xXTllwcBUGTldtT6Sw+TKRnPcrwWZAyBloY7NOYRJk9mjoe4sOCs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773049713; c=relaxed/simple; bh=llmH4e6V3hO6E83982AsOxGjOSWUtW0WJVedEVEMywU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=kQ8cOlmZGA3bCbOCMG8G+u4j21c6jC0t8o32xKfgeszXKwapslPvDkzhvYzkvcDlOO/tpaxRxQE2FfXASeTs1KolzUVAUBXI66ITkITg7vQJiKP9nbfNYbW8RQMeDTFPN/LmGOrxmFj0+tL86NqfPH1glvEG/kB8sCpb3hn3ZqQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=BhUnyAja; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=OUcJmyqF; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="BhUnyAja"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="OUcJmyqF" Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 62981evV233691 for ; Mon, 9 Mar 2026 09:48:31 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= ni0/4keecpjX5VSQGHRPGLdHSb1TkQhd8WAcXKlEV5w=; b=BhUnyAjaLEdiIxpL jvTrmaziZsrGUESQ24yWUDhSw0n+/nxKNUZyBXj5Z3vL0raJ/TyDAvOfGFMoO7fD oECwOB8zXIBfMYL+bFgOfMP6W5DxqimYpKDyM70cH95O/Li6i8HiQt6RcuPiGVeL DQV1Mehy0okpQ/rK67uJ8o7DfFeywOx2jr34169dMM70a5kJeIXj77juF0h4Jc1i tMI9Us9lWU+/nMMM+hgU2I2SdGhFzZj8CqW6J6gdItRyVJNiPFKNW3iVpG8YaXym +F/ULQWIa1a/DQAwU19YiHn+jiYVyTAzFIvAjpeEuyQjD4oaZ0t8XoF/23aV0R/A t4Q9LQ== Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4crc3vcu0r-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 09 Mar 2026 09:48:31 +0000 (GMT) Received: by mail-pl1-f197.google.com with SMTP id d9443c01a7336-2ae66ee7354so58065185ad.0 for ; Mon, 09 Mar 2026 02:48:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1773049710; x=1773654510; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=ni0/4keecpjX5VSQGHRPGLdHSb1TkQhd8WAcXKlEV5w=; b=OUcJmyqFy/wVeIm2/rCgyDfhFaU5r0huE9Bzi0Y5ccXgJtLMkWH5IzjZmY4bWvX0ee 0TwIBxmb3cNt7uoUa0+IiNtX6Y519tL9EauORJwpvnrYZoAyJZF4MIQwlrQd4JjC/mzH map51MPI7apfxlbbBNtXielVWgE5dVzaZNgtcv0GL/mc93xtYcJtRt40DI4BRDUc+/iu BwAzyZAnGQ/juTX0TVzFrzRiZswQv+qmDkhFmwAUOPx2dfMKyWJgzRvzA6911hwIGAym rrjTYNdC5n0UxvvsO8vf4gg2Y5dDMd4Ko3xyeBcI1GqsYSFTtSV6pUv5BoV8CkPqW/Gs +6xQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773049710; x=1773654510; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=ni0/4keecpjX5VSQGHRPGLdHSb1TkQhd8WAcXKlEV5w=; b=Ul4f+sugSIcFmpKnSSJ0DKZHA/BfcLJCII/tMz1pebECNBNdG0YNXFxKlCZZdsRQ0z TuvKpdyCWj4VgBa8sR0uP4UHqLobIf8WjUd2htexE3EXc435pDsaIX3f+PzV2WP8+Hvq hPNFci0LU8PxRY/m/nsKFbS1wWyOJxw/wDourN9XMoP8hAn1dgMhiGsTkesmUCANqz12 RYiaDpOGQ6KOyEyaXugn0wV0FOdhjQBltiixw6T4HD7xM9OdYCxG5Nmibt8ujZRITo2e uq3lBG/jeOIHr+PtDo3Z32ghFuOE4tNMvJ8b2obfAUhQoc6265YKubpoFCbQvOkUi+eu YcHQ== X-Forwarded-Encrypted: i=1; AJvYcCUWeswV1V/VUBdmW2tQK8rQHNPBRKeojALBPCPw9R/A1Hs1T9kgJSAg4xqh+orsxwWepxgUEz3rzkerDDE=@vger.kernel.org X-Gm-Message-State: AOJu0YwMkUw78uKeg7RXAVL+MJOlokeSlhIb/AhWAmcnLeG/InXuXpXO Qe+2NqTvV1pPIw1JaKrVZyENXyK9sncGkS3+bT5ZoxbyLYtX5+UjkZZRp4zWCUYMFz6EvhYGQ+D nuT0d5w/EemlpIpvzIxZrp5sW//jFX5SojemRhVCDpKdhcf0SN0R2TbRJ4qVXWDJGcH4= X-Gm-Gg: ATEYQzyOoyPTD9ys4Qth62+J+9ws/50nfh88le8/r/SWxsYsB+hVQymfd6BclwCjMe5 iWdfdKzMf4WQSR2wXz+TfJaENtSapy22IRC0cxuqr7bqOdTx0br2ZsFpmnwoOgPFyqZkeLOhPsJ wN8gGWBxs6lN/KOg45z0kCQ/zrF6+9wyh9URG+SWdjEfgfAC+rgRavUXKPYAEjainXDRZ8Nu9aH sXCAi8+XpkXCs7u++ohEWoPHHxbByGBjV5zPbWGbVDE1oeMavz/Vr/b2leRKMGjJEVIkFiCmODG ODBI1hlNPbcLH3NLMEQrrbPeGtn47mm9hGvJfV3tPvtLS2iIDRSvWRpHo9b097rwuvg6MlBTuO1 DsDQHBwvzKecl71BPpf4f71S+yUD+vz2Je8/f+9YqyVeDi/PX2lsAbd6KwPjRfhii4fD7N00oFg rZ4IvKHgHG X-Received: by 2002:a17:902:f54e:b0:2ae:5b64:12d6 with SMTP id d9443c01a7336-2ae8250bf7cmr106451105ad.44.1773049710255; Mon, 09 Mar 2026 02:48:30 -0700 (PDT) X-Received: by 2002:a17:902:f54e:b0:2ae:5b64:12d6 with SMTP id d9443c01a7336-2ae8250bf7cmr106450885ad.44.1773049709754; Mon, 09 Mar 2026 02:48:29 -0700 (PDT) Received: from jiegan-gv.ap.qualcomm.com (tpe-colo-wan-fw-bordernet.qualcomm.com. [103.229.16.4]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2ae83e575e6sm104948435ad.5.2026.03.09.02.48.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Mar 2026 02:48:29 -0700 (PDT) From: Jie Gan Date: Mon, 09 Mar 2026 17:47:43 +0800 Subject: [PATCH v14 4/7] coresight: etr: add a new function to retrieve the CTCU device Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260309-enable-byte-cntr-for-ctcu-v14-4-c08823e5a8e6@oss.qualcomm.com> References: <20260309-enable-byte-cntr-for-ctcu-v14-0-c08823e5a8e6@oss.qualcomm.com> In-Reply-To: <20260309-enable-byte-cntr-for-ctcu-v14-0-c08823e5a8e6@oss.qualcomm.com> To: Suzuki K Poulose , Mike Leach , James Clark , Alexander Shishkin , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Tingwei Zhang , Bjorn Andersson , Konrad Dybcio Cc: coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, Jie Gan X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1773049687; l=2348; i=jie.gan@oss.qualcomm.com; s=20250909; h=from:subject:message-id; bh=llmH4e6V3hO6E83982AsOxGjOSWUtW0WJVedEVEMywU=; b=ZWwvjevBRuD/l0uekFO+E3V0xCFxTSow6u0fcDJPRW/fuMwYDlO4ra1VdbrW0jw8FnH5JfkuW /Fsg2B2btOHCX/vyFjPgGVmo2b+UJ8qqqOk+hMQtjgHLukNIAOBhn31 X-Developer-Key: i=jie.gan@oss.qualcomm.com; a=ed25519; pk=3LxxUZRPCNkvPDlWOvXfJNqNO4SfGdy3eghMb8puHuk= X-Proofpoint-ORIG-GUID: aTqAs2LEuKRJOEt8l79wf05wfclYSLjy X-Proofpoint-GUID: aTqAs2LEuKRJOEt8l79wf05wfclYSLjy X-Authority-Analysis: v=2.4 cv=OOQqHCaB c=1 sm=1 tr=0 ts=69ae976f cx=c_pps a=cmESyDAEBpBGqyK7t0alAg==:117 a=nuhDOHQX5FNHPW3J6Bj6AA==:17 a=IkcTkHD0fZMA:10 a=Yq5XynenixoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=gowsoOTTUOVcmtlkKump:22 a=EUspDBNiAAAA:8 a=FuIWbRVyn4pKkvqW11oA:9 a=QEXdDO2ut3YA:10 a=1OuFwYUASf3TG4hYMiVC:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMzA5MDA5MCBTYWx0ZWRfX1An5Tqn5/7Cj GAjQdg2vdOhypGFogI6hSdCxF0+36xW9J4US63Z/XNHxUjN4T71ptIVYA1qyhcscKAeXZp8P1VY ELjds3G4VJ9ULJVmpaR1TNAl5L/7mCHABwujMPcb7S4MIktQop1mpnI7g+mbFZtcWwNvZAioflL DznLH3fm5CdVmZkOisYiKtVRhqQ9zaWdLBCi/ZoDAa9LyFrWloaeeXZ+nhg7ns8qy5orlou1TmY 8k+GmS5nejAAYLAMoU4Gb8xxqtpcRBfrD7V02GMNk+FAwZcERAkTK3C5P9GbaQaSG5QZXLFJH6+ F80pKDDuv7dMMii5JAxP2p+SacqbrXpbHl5pAk2JW3L1I1jYXHeuiST5ZXPuWajeeguUA8+CjdU gfuvU4AQnGCHv8m2tsbrXWTe3TrDFhHRr6z47SjESGM6dpedD6Zem8ZrRbQ+PVegV+mVhqjiYFh zhyQG3Z43LrrtzERISg== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-03-09_03,2026-03-06_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 impostorscore=0 suspectscore=0 spamscore=0 malwarescore=0 bulkscore=0 clxscore=1015 phishscore=0 lowpriorityscore=0 priorityscore=1501 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2602130000 definitions=main-2603090090 Add tmc_etr_get_ctcu_device function to find the ptr of the coresight_device of the CTCU device if the CTCU device is connected to the TMC ETR device. Signed-off-by: Jie Gan --- drivers/hwtracing/coresight/coresight-tmc-etr.c | 24 +++++++++++++++++++++= +++ drivers/hwtracing/coresight/coresight-tmc.h | 1 + 2 files changed, 25 insertions(+) diff --git a/drivers/hwtracing/coresight/coresight-tmc-etr.c b/drivers/hwtr= acing/coresight/coresight-tmc-etr.c index 15c0874ff641..f4223215ef8d 100644 --- a/drivers/hwtracing/coresight/coresight-tmc-etr.c +++ b/drivers/hwtracing/coresight/coresight-tmc-etr.c @@ -865,6 +865,30 @@ tmc_etr_get_catu_device(struct tmc_drvdata *drvdata) } EXPORT_SYMBOL_GPL(tmc_etr_get_catu_device); =20 +/* + * TMC ETR could be connected to a CTCU device, which can provide ATID fil= ter + * and byte-cntr service. This is represented by the output port of the TMC + * (ETR) connected to the input port of the CTCU. + * + * Returns : coresight_device ptr for the CTCU device if a CTCU is found. + * : NULL otherwise. + */ +struct coresight_device * +tmc_etr_get_ctcu_device(struct tmc_drvdata *drvdata) +{ + struct coresight_device *etr =3D drvdata->csdev; + union coresight_dev_subtype ctcu_subtype =3D { + .helper_subtype =3D CORESIGHT_DEV_SUBTYPE_HELPER_CTCU + }; + + if (!IS_ENABLED(CONFIG_CORESIGHT_CTCU)) + return NULL; + + return coresight_find_output_type(etr->pdata, CORESIGHT_DEV_TYPE_HELPER, + ctcu_subtype); +} +EXPORT_SYMBOL_GPL(tmc_etr_get_ctcu_device); + static const struct etr_buf_operations *etr_buf_ops[] =3D { [ETR_MODE_FLAT] =3D &etr_flat_buf_ops, [ETR_MODE_ETR_SG] =3D &etr_sg_buf_ops, diff --git a/drivers/hwtracing/coresight/coresight-tmc.h b/drivers/hwtracin= g/coresight/coresight-tmc.h index 69d55ee3895f..aaa443abe8e9 100644 --- a/drivers/hwtracing/coresight/coresight-tmc.h +++ b/drivers/hwtracing/coresight/coresight-tmc.h @@ -470,6 +470,7 @@ static inline uint32_t find_crash_tracedata_crc(struct = tmc_drvdata *drvdata, } =20 struct coresight_device *tmc_etr_get_catu_device(struct tmc_drvdata *drvda= ta); +struct coresight_device *tmc_etr_get_ctcu_device(struct tmc_drvdata *drvda= ta); =20 void tmc_etr_set_catu_ops(const struct etr_buf_operations *catu); void tmc_etr_remove_catu_ops(void); --=20 2.34.1