From mboxrd@z Thu Jan 1 00:00:00 1970 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 B02A938F93B for ; Tue, 7 Jul 2026 09:09:51 +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=1783415393; cv=none; b=d1PZM/DY7MpK+SupIlXLDEdM4x9Kj3zdleXBhNDrUW7h3iJO3bXvHPL6OFoHpsMS+8CfTba1kOH4iiZlxUdj8/ySTxxBaeiCQyQtwSwQZ2gLYMAwqaQp5WAkOidtfIOm2d6374B9lvugOx6BxKELAcmHywK6059Mb9El4Ov13Ao= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783415393; c=relaxed/simple; bh=EN+FdeBGpyAvvN3mrzi/TzCpXDx8W4gkJX8PCHt0KsM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=m5+STZr6plvfL0o0VlDHuWCUfI7s4GWyvu9V4LW7lBBqtd+raIdxN7X1YuQi4iHZ3nIGwyP5xDJ2I+Iovml8vgZrhFYL6ZYMXNgaKZqx0sal0vjmikP9w4y0MgvisKVRmEpsvU7g2A5N2GtIdKKE5grJtY0KHTmGBUSX1hWReRU= 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=Fv/MpW3S; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=dSIl4CvV; 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="Fv/MpW3S"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="dSIl4CvV" Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6678ECHV3231442 for ; Tue, 7 Jul 2026 09:09:50 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= QVzZmvzUW+j5l14x9BgwKtH/lDVSeIvlHRk66AloFqs=; b=Fv/MpW3ShNcWG/oO mgrRmyfym790lG3WVAvAeImva8/AZpaseOS9gsFBTHkayHfBzneppUmmmr1ljt4N qWxYwsVopA5S6qlIwvV8qlh1Ve1Rm+yaClfdyPsGGv9WXe6c8hwLcnInoRCr2jVK CDLjYbxkNNUSKQ3SCMAZsVIEzaXbcrpYBP7cXf8C0h3tG2GLF8NhdElAR89kdT6R jXK7Rs98h3baQDvqO0xNPS6WaErks8+kfVp7O2hsKvEkksSVAybBuSwFKP89zCzz qNf01t3pFrw1W9sgIx/NWQUPAbTnLXwwpdsiryZrA8/yM6ME60s+bkPAlTuusqfl DLOw/g== Received: from mail-pf1-f198.google.com (mail-pf1-f198.google.com [209.85.210.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4f8qj79mvb-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 07 Jul 2026 09:09:50 +0000 (GMT) Received: by mail-pf1-f198.google.com with SMTP id d2e1a72fcca58-8482df30da4so968985b3a.2 for ; Tue, 07 Jul 2026 02:09:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1783415389; x=1784020189; 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=QVzZmvzUW+j5l14x9BgwKtH/lDVSeIvlHRk66AloFqs=; b=dSIl4CvVxm/cF/Zsg6S7AT5Ej5a+9Xazmx9RyKfZjmhQrYLTsMvQInpQeWPpArlWrt 6lriR1Iu6KRERW4a0MGgc7R/KpIyCmU0QKJE30bj6ag7smcQFx9mYRyB5NnEeLsCKkXE XiWj/RIYKzdXbOEFkBharHjMcknBettGvtv/Eh4k0CZoMFWUVZZsdZ5WVGVMF15i2kfP aP+EZuxaMF4GB8XivoFpGTidC93QgwzoQH836HQ6x6jqff1pofhfX3YzRuXJYUfwf3pk GjyO/zMr0RPIeEkAQT+3ddC7GdGm4K9BNoYu3v6PLgAbt3IU9VZKgBjeuaNew2zGDE6i /0iA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783415389; x=1784020189; 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=QVzZmvzUW+j5l14x9BgwKtH/lDVSeIvlHRk66AloFqs=; b=GXM8bc05+nObLIphIE/5Zz4gVimbK0g09InU8aS5BFFrgSNxF5XWdpIJiRtc4j94Gz oshmwehSLVj2CQDbiR7nCrq8Owu7f3poS2+72uiHSZ2ConPsZqLPCIm2RgfwXKkkqck8 5tGRzKwkBS7uIYfgTQKpAydHKdiHyTf1Vmz04Dh3iQjR2rpL/JSQpHpINt8+pZ0Rhr3n 4nMA5Jgxpkl10AAgH7UcP2Q76Fh2Nk6evqHvQFtOFnzWLf89Rzi6OSrDQzLJl2CkdvkP pgV5OpuurWjRTj8vp5uPrkjTfdSBfm8XBY1z9LFNVhZdznWRKKYEZB/o8apCNDzuFLvf lQuA== X-Forwarded-Encrypted: i=1; AHgh+Rrhulm1eUatMwR56Vi0DpJhXSVDNY7Khqapd3IBk4e3zDQ/rpyj3PkpEFgfhCmQW1L9QpHcWgTwinRyJvU=@vger.kernel.org X-Gm-Message-State: AOJu0YzYgYp3DADVIFZ/eoMtKFmGSniIoodyvW9p4TzKzme5MPhB3YJX WcvLVe8rymesSxtCfm+K7pdBKHcXiO6+m25n2yKUCQTN5bYUel9ceW2bxK1SnoyTnd77ll9tbqR AqEEl5fB/2kLmpzN987CRmrUGbse15KppdlAEgJtrRmzHkb8/5pzzfEowfemWkNN+8JODhbEDy2 7ezQ== X-Gm-Gg: AfdE7cnu4YQPoZLT65p3OXVIW1I72XpgTTO8yyDdaocIM7an3+u0PhG8pnUIaI8bdq6 TVitLySQYKXLijmFEqChyDRon7HmmVkVqVUswBAHf7k+Hk5rnhN13m6fwnstENhi1fI4niK6w5O q/BfoUlheCqaO/DykhiW5j1pAfSoOihc88x0zfXmxiYWa1fKuV0HwytzCYCz+Jf14KZBJJ1wpg5 gdUjhQ4gGLCMvtEDhE1ykVItXk9CNoqv2vpUnvOHG2KVE+oBvCWcGfbVFtAR1b/Y4Pzw0RlKuTA lqcx+qHxk4YeBDM3wqnb5vegjerO7MGjizPuuzz7LKpZCyN+poLQARopDaw2xZXdHIppZp7Fuuq E7lCizMGos5OltqwrazbeSzN5DeSxs2mCl+0MdsAEW1lAfHCVcUYdFrwAV9bI1kCNO3OrSP5xgg == X-Received: by 2002:a05:6a00:27ac:b0:847:904c:8452 with SMTP id d2e1a72fcca58-84826cdbb70mr4249798b3a.38.1783415389465; Tue, 07 Jul 2026 02:09:49 -0700 (PDT) X-Received: by 2002:a05:6a00:27ac:b0:847:904c:8452 with SMTP id d2e1a72fcca58-84826cdbb70mr4249763b3a.38.1783415388859; Tue, 07 Jul 2026 02:09:48 -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 d2e1a72fcca58-847f6b975a0sm5140582b3a.14.2026.07.07.02.09.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jul 2026 02:09:48 -0700 (PDT) From: Jie Gan Date: Tue, 07 Jul 2026 17:08:50 +0800 Subject: [PATCH v5 2/5] coresight: tnoc: Bind Aggregator TNOC on the platform bus 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: 7bit Message-Id: <20260707-fix-tracenoc-probe-issue-v5-2-bf733ed9ebd0@oss.qualcomm.com> References: <20260707-fix-tracenoc-probe-issue-v5-0-bf733ed9ebd0@oss.qualcomm.com> In-Reply-To: <20260707-fix-tracenoc-probe-issue-v5-0-bf733ed9ebd0@oss.qualcomm.com> To: Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Tingwei Zhang , Jingyi Wang , Jie Gan , Abel Vesa , Suzuki K Poulose , Mike Leach , James Clark , Leo Yan , Yuanfang Zhang , Abel Vesa , Alexander Shishkin Cc: Konrad Dybcio , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1783415365; l=4982; i=jie.gan@oss.qualcomm.com; s=20250909; h=from:subject:message-id; bh=EN+FdeBGpyAvvN3mrzi/TzCpXDx8W4gkJX8PCHt0KsM=; b=dRccxZSbmUk4pEE5sN+9ZaHTb1sq8axFFGR8dU7llgq6JFKBk/UJJhF0Neya5XB/HgSD6VuOp mQYF+9vCnGrDeq/geHhwazBmPeCNJsH8gFsVxuT5XQP3T+v0qDt8vOM X-Developer-Key: i=jie.gan@oss.qualcomm.com; a=ed25519; pk=3LxxUZRPCNkvPDlWOvXfJNqNO4SfGdy3eghMb8puHuk= X-Proofpoint-ORIG-GUID: erav789OalJBk5xu_0H7ejbh0VDlSs70 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzA3MDA4OCBTYWx0ZWRfX7GYUJYJD2jM+ V1RzijgJxVngcF49cKWlrFJgft0b9K5lR5B+zZKSq3GwBHhX4JbvtI1Qh8uauowU3foqv6q51n+ G2R0+augeYR1ydBcx7Mf0o/FSO01BO5SXM/fkAIF1q0TsMNa1A58nNSKAZbrx7fB3q3fyqPv8lb 7DfTVDyHxP8cKMpCcBPP23z2td/ADBSWZ6fi3CulpdFqFIbtILn6ti74CvywbH/xQlgrD9y7zZ1 /VIh2WcE4vOXsZcEkbeA4t0ug+q224waT8RgTaaQpEYLcSPK2U977MmFVa4FK4cBLn39NcIWiQx Uk+pFqp6jEeah9pBdoT5cyJ5uUq27BkJi8xWe4vH/NAUUpYf3WIq11YwdJYxxevd7JD6KeDuZOT PXOkFpX3m4Q5WOpDmddikvGrtzn664VH7zS93SHwb1nfN6tdaxEceOOY6qP1LzYA82UBg0SsTiB IiIm2nNVMVuLaIoAb0Q== X-Authority-Analysis: v=2.4 cv=PIM/P/qC c=1 sm=1 tr=0 ts=6a4cc25e cx=c_pps a=m5Vt/hrsBiPMCU0y4gIsQw==:117 a=nuhDOHQX5FNHPW3J6Bj6AA==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_glEPmIy2e8OvE2BGh3C:22 a=EUspDBNiAAAA:8 a=SM-CJC9rQbeaPTssbJMA:9 a=QEXdDO2ut3YA:10 a=IoOABgeZipijB_acs4fv:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwNzA3MDA4OCBTYWx0ZWRfX5DT4WBm62tkw juPIckYMo1hT+H/9Ch1ML+vsPDY4ABXRMMgxgr7MXIrdfgH3mZFLwzZfmAeAOR/MAyQ1oNYwO2R lh0n/JrruC0noqfxILG5xqhUAW0Fv88= X-Proofpoint-GUID: erav789OalJBk5xu_0H7ejbh0VDlSs70 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-07_02,2026-07-06_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 clxscore=1015 impostorscore=0 malwarescore=0 adultscore=0 phishscore=0 suspectscore=0 lowpriorityscore=0 spamscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607070088 The Aggregator TNOC is bound as an AMBA device through the "qcom,coresight-tnoc", "arm,primecell" compatible. Binding on the AMBA bus requires the peripheral to expose valid CoreSight peripheral and component ID registers, which the AMBA bus reads to match and probe the device. The Aggregator TNOC does not implement these ID registers, so AMBA probing fails and the device never comes up. Bind the Aggregator TNOC on the platform bus instead, where the device is matched by its compatible string and no peripheral-ID probing is performed. Add "qcom,coresight-tnoc" to the platform driver's match table, and rename the platform driver and its callbacks from the "itnoc"-specific names to generic "tnoc" names, since the driver now serves both the Interconnect and Aggregator TNOC. Update the platform driver name to "coresight-tnoc" accordingly. The ATID-unsupported handling keyed off dev_is_amba(), which disabled ATID allocation for every platform-bus device. With the Aggregator TNOC now on the platform bus, that check would wrongly disable its ATID, even though the Aggregator TNOC owns the ATID that tags the whole aggregation path. The Interconnect TNOC aggregates trace within its subsystem but carries no ATID of its own, because the downstream Aggregator TNOC already owns the ATID for the path. So base the check on the "qcom,coresight-itnoc" compatible and let every other form allocate a trace ID. Signed-off-by: Jie Gan --- drivers/hwtracing/coresight/coresight-tnoc.c | 37 +++++++++++++++------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-tnoc.c b/drivers/hwtracing/coresight/coresight-tnoc.c index 9e8de4323d28..737cc802aefe 100644 --- a/drivers/hwtracing/coresight/coresight-tnoc.c +++ b/drivers/hwtracing/coresight/coresight-tnoc.c @@ -130,7 +130,7 @@ static int trace_noc_init_default_data(struct trace_noc_drvdata *drvdata) { int atid; - if (!dev_is_amba(drvdata->dev)) { + if (of_device_is_compatible(drvdata->dev->of_node, "qcom,coresight-itnoc")) { drvdata->atid = -EOPNOTSUPP; return 0; } @@ -278,7 +278,7 @@ static struct amba_driver trace_noc_driver = { .id_table = trace_noc_ids, }; -static int itnoc_probe(struct platform_device *pdev) +static int tnoc_platform_probe(struct platform_device *pdev) { struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); int ret; @@ -295,16 +295,18 @@ static int itnoc_probe(struct platform_device *pdev) return ret; } -static void itnoc_remove(struct platform_device *pdev) +static void tnoc_platform_remove(struct platform_device *pdev) { struct trace_noc_drvdata *drvdata = platform_get_drvdata(pdev); coresight_unregister(drvdata->csdev); pm_runtime_disable(&pdev->dev); + if (drvdata->atid > 0) + coresight_trace_id_put_system_id(drvdata->atid); } #ifdef CONFIG_PM -static int itnoc_runtime_suspend(struct device *dev) +static int tnoc_runtime_suspend(struct device *dev) { struct trace_noc_drvdata *drvdata = dev_get_drvdata(dev); @@ -313,7 +315,7 @@ static int itnoc_runtime_suspend(struct device *dev) return 0; } -static int itnoc_runtime_resume(struct device *dev) +static int tnoc_runtime_resume(struct device *dev) { struct trace_noc_drvdata *drvdata = dev_get_drvdata(dev); @@ -321,35 +323,36 @@ static int itnoc_runtime_resume(struct device *dev) } #endif -static const struct dev_pm_ops itnoc_dev_pm_ops = { - SET_RUNTIME_PM_OPS(itnoc_runtime_suspend, itnoc_runtime_resume, NULL) +static const struct dev_pm_ops tnoc_dev_pm_ops = { + SET_RUNTIME_PM_OPS(tnoc_runtime_suspend, tnoc_runtime_resume, NULL) }; -static const struct of_device_id itnoc_of_match[] = { +static const struct of_device_id tnoc_of_match[] = { { .compatible = "qcom,coresight-itnoc" }, + { .compatible = "qcom,coresight-tnoc" }, {} }; -MODULE_DEVICE_TABLE(of, itnoc_of_match); +MODULE_DEVICE_TABLE(of, tnoc_of_match); -static struct platform_driver itnoc_driver = { - .probe = itnoc_probe, - .remove = itnoc_remove, +static struct platform_driver tnoc_platform_driver = { + .probe = tnoc_platform_probe, + .remove = tnoc_platform_remove, .driver = { - .name = "coresight-itnoc", - .of_match_table = itnoc_of_match, + .name = "coresight-tnoc", + .of_match_table = tnoc_of_match, .suppress_bind_attrs = true, - .pm = &itnoc_dev_pm_ops, + .pm = &tnoc_dev_pm_ops, }, }; static int __init tnoc_init(void) { - return coresight_init_driver("tnoc", &trace_noc_driver, &itnoc_driver); + return coresight_init_driver("tnoc", &trace_noc_driver, &tnoc_platform_driver); } static void __exit tnoc_exit(void) { - coresight_remove_driver(&trace_noc_driver, &itnoc_driver); + coresight_remove_driver(&trace_noc_driver, &tnoc_platform_driver); } module_init(tnoc_init); module_exit(tnoc_exit); -- 2.34.1