From nobody Fri Apr 3 03:01:29 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.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 7707717BA2 for ; Wed, 25 Mar 2026 03:10:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774408230; cv=none; b=jlekiQ9FREZT+l4v6EY+XWeNC4aafIcQAyMHOR92WE+mRVdOxTisQl5Z9fe6s2Q8um4gtQwpTOmAo569cQ09A0k5xrNNzYGc87qNNZOiWi7Zi9TveQd0+mckjnVz8+apMJ13Olj9aEGTiF9bGvlN3jz+Ay+KtDJHa6g6OX9q7JY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774408230; c=relaxed/simple; bh=TNAeHe10nhtp5XqbgHEFoEnpsK1f4L2bacP1jjN5WIs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=jpQ7UVDCYXbZPYgWW84wFF5qxCBCNeG6JY/IquoTvVlWlrUFP+w3YHqj4hQXYu1/fZpaoJ6Hz5ibz56cJHqvACD1fgK61wHY/A9j96qoL3LHIIEnicZ9OvULM/En3+1zSGEbLxRopLwvJGFrQlbev1258DgH4KRNvU95ptz5U98= 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=bL/eXb8W; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Ntf8lno1; arc=none smtp.client-ip=205.220.168.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="bL/eXb8W"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Ntf8lno1" Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 62OJCuKR3110546 for ; Wed, 25 Mar 2026 03:10:29 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to; s=qcppdkim1; bh=qxLFbSS0kbFsz0H1eqsg/k O890DMlye2k4mq3SEhw9o=; b=bL/eXb8WrKEaVF0KailmRO+u8u4BANyiAaKa1G L/uCT4UokzJSaD36yyJ9SdEtntHgQAl2Ena6xHHSEA/5dJ0yrn6eCfxVhnXHWsEN 8/D7C0lrrZhbb16bLqeNVPMEFDSraIFXPMp76EPrN7BCrPF7JonFRARaIPh34Mus 8BVqsycxNJ6MTzyeeQ1gvK8/GkqXkeraY9VAZmDR2D51Jh/s8p06jTY3gImxVIK7 7Nq1aQJv5Xr1JTySaijxnWvYN1iYRPWJ/BNEH/uYkbNEWBN3ubdq5kaLklREoc3Z n7ONIMprz8jGAAH4x1zP8urwNAKQBzgyVtMLCEoSJ2hYnGRA== Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4d3vhvtfkd-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 25 Mar 2026 03:10:28 +0000 (GMT) Received: by mail-pj1-f70.google.com with SMTP id 98e67ed59e1d1-35c0bd3a968so865594a91.0 for ; Tue, 24 Mar 2026 20:10:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1774408228; x=1775013028; darn=vger.kernel.org; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:from:to:cc:subject:date:message-id:reply-to; bh=qxLFbSS0kbFsz0H1eqsg/kO890DMlye2k4mq3SEhw9o=; b=Ntf8lno1JIbvj7Eae50iXGLzaie1yp7Z5KikDo5jDpS8+rp9QJu/us3wzWP9mYeeld sj4Qovz0efEYUQgN6kjWplekNTH0nWpuATdIhWCivn0JWAwlOi8RKEIQzuj9RxYBvyLf MYHLi90YMhL5B2gXmiKXwTUICoYdcMNOgyAiSiZFiAEIFm9kkGJZoQSUnnxnqF5AYyPz d+gr5x1FyEOzM/RVV/G0vZArBYXsxbAE444gAuLIjupD2j44FalnHRUyoh03+2KmKSXG I9DYU1pdVMx9BQ2REbaxM9hnxoHGqh1zwk89QNRIu1TjasMC+ILUkXSwBUjSghUg156z aWVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774408228; x=1775013028; h=cc:to: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=qxLFbSS0kbFsz0H1eqsg/kO890DMlye2k4mq3SEhw9o=; b=piucasO5CFRF4b7U092J2IX2tLDufsYwZzODRU1YvA8zpQvyvVulH4vRC0HamkWnhV gNdqdQXin/cJaD+WqJYt/NVGYSrlI1zUkJsPrXTKZ8RW89B4qJpdy2MhK4Qjtcpg8S76 bR0DkGSFSIIEdtcre6B5652+K88FWNlmJUj13xqeFrj2Q+K7Y9N6E+nxzpe82IMEhFc9 cIOOyLAjC6J0Ev2o58LanBP3HEBt/I1MlSfB29Tfw6f1daLi5JUnytWxaEZYOCb4O4NX hvXz7M0Ch5c+wJkA43fy5YHrOy2KhsCyyAVycON7GMjNyDwH3Ewg+mNVp8kQwWlfmLL1 JgqQ== X-Forwarded-Encrypted: i=1; AJvYcCWUkMLaKf63FxG9/JkDyxebEVGK1imKBZ8/NzvIL9gQImP123gfjUT9H8AkoQt80LpUhYmLniDk86ls04k=@vger.kernel.org X-Gm-Message-State: AOJu0YwKbZUNxQQBgGPyT3diQnGbQlpIMwlgobVcRxHC2XWIgCo+Pl9y 80PPlIYtOGtrhzWXFBc+nYWQinvVJhxPfnC0YSya2+0qkYLhWUWgAZI+k7WGBlpKwpLmayRoNNZ jL4q2Lb7YS8znOfFBEua4NAfuDjT3rIoy5kojQqhU85jiulBIny0pwjyFsgQ2FqmaqNxubo1YEu c= X-Gm-Gg: ATEYQzzDXcONSmPDO0EvHkJYyd70TMLKNEXjgofgGDCZgQ/hl1L+xIHTSEO6tU/q9pA Fo7UeyHOJTsd5ahIUVrR5eolbnd9kspjINHOodGbUCJb8kw7JN3MblYV7w4xD2lYKsZEZjRiZwO jfYtUdt54SnP2Z9o1ON3pIZumZRYJzEnu280AaxpA4EY+aGYOTvvksjC0dYbTv1VJvjOK3stkaR H3XU0aEc2Ilq73TZ8Rw0UGHgG3AinIND78zgrLXdTM9ApRM33NDhvCdVTFIYnGNKA5pnzoGhQuc yP9sh6CbofdRhIUirMtmPRGNdhRbtSvFLG9BSzXe3GciodydSzbt5JiWZruvMFKkRniy/9OB2ad fT+RqT7wNEFoUo05hwe+6Iya0cwe2Ou8APFofcHXZEiKCNapU7DiiT6fQuiYhXPoPDOvyN4F4Py 5JGdO0OXnW X-Received: by 2002:a17:90b:3f47:b0:35c:59f:e345 with SMTP id 98e67ed59e1d1-35c0dd803fcmr1550871a91.26.1774408227839; Tue, 24 Mar 2026 20:10:27 -0700 (PDT) X-Received: by 2002:a17:90b:3f47:b0:35c:59f:e345 with SMTP id 98e67ed59e1d1-35c0dd803fcmr1550852a91.26.1774408227364; Tue, 24 Mar 2026 20:10:27 -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 98e67ed59e1d1-35c10e37a98sm221117a91.17.2026.03.24.20.10.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Mar 2026 20:10:27 -0700 (PDT) From: Jie Gan Date: Wed, 25 Mar 2026 11:10:08 +0800 Subject: [PATCH v3] coresight: tpdm: add traceid_show for checking traceid 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: <20260325-add-traceid-show-for-tpdm-v3-1-0eb836d4ec30@oss.qualcomm.com> X-B4-Tracking: v=1; b=H4sIABBSw2kC/42NQQ6CMBBFr0Jm7ZC2YCWuvIdh0XQGaSIUO4gaw t2tnMDNT95P/vsrCKfAAudihcRLkBDHDNWhAN+78cYYKDMYZayqtEVHhHNyngOh9PGFXUw4TzR g05CqlT3qTinI+ylxF967+9pm7oPMMX32q8X82n+si0GNmtgbZ09cM12iSPl4uruPw1DmgHbbt i/gEojsyQAAAA== To: Suzuki K Poulose , Mike Leach , James Clark , Leo Yan , Alexander Shishkin , Tingwei Zhang Cc: coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Jie Gan X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1774408224; l=4000; i=jie.gan@oss.qualcomm.com; s=20250909; h=from:subject:message-id; bh=TNAeHe10nhtp5XqbgHEFoEnpsK1f4L2bacP1jjN5WIs=; b=ehzHx9mieQTDiI0f6cTpwsQ6XB7Y8iNqWXg4ZSkGoGKN1gg/XfJgGNxFK8zO8HW/dsR42hnDY LXQHOg6++IFAVZvI177ftnx6VwPY9GDTNRU8N0wXJHh5ZNAMHk2LQUD X-Developer-Key: i=jie.gan@oss.qualcomm.com; a=ed25519; pk=3LxxUZRPCNkvPDlWOvXfJNqNO4SfGdy3eghMb8puHuk= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMzI1MDAyMSBTYWx0ZWRfX5fvSguqI8gpZ PQuoqwmy4YyxPJyiWqY41bR50sVIAzEOZX5hFeV9GNHLcERyAw5uNGH58HGxv4yrBnm0EVQN4g/ Lfco2kU+LrExIwqrBEWCJxhN9vv1R2jUi8ael2L4FJ+NE54Ron55oP1nYtLkzdXOeNom5Bm+YiN s1JOVLGoyzkStyRwWoczRErYhzZ3rmiHyV/px6/Rh2r/wYi40xo9qTmjjgQ37zfFmVJKjga6jcC diFx0BQXt/Fi2KLw5tnCAubFO7/+Gksya10sZU64fQVHdPwixaPrPvG++T3JeMFIRzyNlgRE712 HNuiMNhUx15+gF6tL03/uf369oG7SzMAyqu3tw0CJdjKoVhjXNsisIrnCZRABkUh27Tgt8RY0nG wY3MtO5an55C9BtbeE5FN2FGm5JiVzZQaRt5gAAgZl5+bN+CIb3IxhPmrSsQb6nGQNTqhe8WxaJ XIFfksfeWi9BrlJyNrw== X-Authority-Analysis: v=2.4 cv=P5M3RyAu c=1 sm=1 tr=0 ts=69c35224 cx=c_pps a=0uOsjrqzRL749jD1oC5vDA==:117 a=nuhDOHQX5FNHPW3J6Bj6AA==:17 a=IkcTkHD0fZMA:10 a=Yq5XynenixoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=DJpcGTmdVt4CTyJn9g5Z:22 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=5xuo2J1n2f9KI_P3fb0A:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=mQ_c8vxmzFEMiUWkPHU9:22 X-Proofpoint-ORIG-GUID: -k8kaZ4TlJSsjGtDASKq4O5_yfkWMtoV X-Proofpoint-GUID: -k8kaZ4TlJSsjGtDASKq4O5_yfkWMtoV 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-25_01,2026-03-24_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 phishscore=0 adultscore=0 lowpriorityscore=0 malwarescore=0 priorityscore=1501 spamscore=0 bulkscore=0 clxscore=1015 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2603050001 definitions=main-2603250021 Save the trace ID in drvdata during TPDM enablement and expose it to userspace to support trace data parsing. The TPDM device=E2=80=99s trace ID corresponds to the trace ID allocated to the connected TPDA device. Signed-off-by: Jie Gan --- Changes in v3: 1. Only allow user to read the traceid while the TPDM device is enabled. - Link to v2: https://lore.kernel.org/r/20260316-add-traceid-show-for-tpdm-= v2-1-1dec2a67e4ed@oss.qualcomm.com Changes in V2: 1. Use sysfs_emit instead of sprintf. Link to V1 - https://lore.kernel.org/all/20260306-add-traceid-show-for-tpdm= -v1-1-0658a8edb972@oss.qualcomm.com/ --- drivers/hwtracing/coresight/coresight-tpdm.c | 34 ++++++++++++++++++++++++= +++- drivers/hwtracing/coresight/coresight-tpdm.h | 2 ++ 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/drivers/hwtracing/coresight/coresight-tpdm.c b/drivers/hwtraci= ng/coresight/coresight-tpdm.c index da77bdaad0a4..c8339b973bfc 100644 --- a/drivers/hwtracing/coresight/coresight-tpdm.c +++ b/drivers/hwtracing/coresight/coresight-tpdm.c @@ -481,7 +481,7 @@ static void __tpdm_enable(struct tpdm_drvdata *drvdata) =20 static int tpdm_enable(struct coresight_device *csdev, struct perf_event *= event, enum cs_mode mode, - __maybe_unused struct coresight_path *path) + struct coresight_path *path) { struct tpdm_drvdata *drvdata =3D dev_get_drvdata(csdev->dev.parent); =20 @@ -497,6 +497,7 @@ static int tpdm_enable(struct coresight_device *csdev, = struct perf_event *event, } =20 __tpdm_enable(drvdata); + drvdata->traceid =3D path->trace_id; drvdata->enable =3D true; spin_unlock(&drvdata->spinlock); =20 @@ -693,6 +694,29 @@ static struct attribute_group tpdm_attr_grp =3D { .attrs =3D tpdm_attrs, }; =20 +static ssize_t traceid_show(struct device *dev, + struct device_attribute *attr, char *buf) +{ + unsigned long val; + struct tpdm_drvdata *drvdata =3D dev_get_drvdata(dev->parent); + + if (coresight_get_mode(drvdata->csdev) =3D=3D CS_MODE_DISABLED) + return -EINVAL; + + val =3D drvdata->traceid; + return sysfs_emit(buf, "%#lx\n", val); +} +static DEVICE_ATTR_RO(traceid); + +static struct attribute *traceid_attrs[] =3D { + &dev_attr_traceid.attr, + NULL, +}; + +static struct attribute_group traceid_attr_grp =3D { + .attrs =3D traceid_attrs, +}; + static ssize_t dsb_mode_show(struct device *dev, struct device_attribute *attr, char *buf) @@ -1367,6 +1391,12 @@ static const struct attribute_group *tpdm_attr_grps[= ] =3D { &tpdm_cmb_patt_grp, &tpdm_cmb_msr_grp, &tpdm_mcmb_attr_grp, + &traceid_attr_grp, + NULL, +}; + +static const struct attribute_group *static_tpdm_attr_grps[] =3D { + &traceid_attr_grp, NULL, }; =20 @@ -1425,6 +1455,8 @@ static int tpdm_probe(struct device *dev, struct reso= urce *res) desc.access =3D CSDEV_ACCESS_IOMEM(base); if (res) desc.groups =3D tpdm_attr_grps; + else + desc.groups =3D static_tpdm_attr_grps; drvdata->csdev =3D coresight_register(&desc); if (IS_ERR(drvdata->csdev)) return PTR_ERR(drvdata->csdev); diff --git a/drivers/hwtracing/coresight/coresight-tpdm.h b/drivers/hwtraci= ng/coresight/coresight-tpdm.h index 2867f3ab8186..11da64e1ade8 100644 --- a/drivers/hwtracing/coresight/coresight-tpdm.h +++ b/drivers/hwtracing/coresight/coresight-tpdm.h @@ -300,6 +300,7 @@ struct cmb_dataset { * @cmb Specifics associated to TPDM CMB. * @dsb_msr_num Number of MSR supported by DSB TPDM * @cmb_msr_num Number of MSR supported by CMB TPDM + * @traceid Trace ID of the path. */ =20 struct tpdm_drvdata { @@ -313,6 +314,7 @@ struct tpdm_drvdata { struct cmb_dataset *cmb; u32 dsb_msr_num; u32 cmb_msr_num; + u8 traceid; }; =20 /* Enumerate members of various datasets */ --- base-commit: b84a0ebe421ca56995ff78b66307667b62b3a900 change-id: 20260316-add-traceid-show-for-tpdm-88d040651f00 Best regards, --=20 Jie Gan