From mboxrd@z Thu Jan 1 00:00:00 1970 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 6E466312803 for ; Wed, 1 Jul 2026 01:54: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=1782870870; cv=none; b=qmMUmXyHNRfuL2lbS9cwGmwDjslgzaXhCY8K7i8qC394KZe1QU11h+/uJI6X6c2qg62JsUsVLpVgFFR3WMcXhDppiQMsKhMa6h4tWTmDpqmikojwCdKzh2PSNcn91LlgVn3I1IFccfQAA1Ec9CTGAvGPEsMSIDVXYbAddItWVOI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782870870; c=relaxed/simple; bh=jPUYlzMEHul9CNoXVAyvw1WxSAWNAF1m3Kd9igZDHK4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=E57RXGNA8mqwPYAQ4SxhxUL2eTbB70p3XleNzhoAv/yW5O9UeR2aZGC+6vFhS9gC6kKyPr73Vg7FT2Yt9wooEC3zwCWjvFOJhDVy47nKBxishXIMqO3DqWBczjUrclehCooX5jM0XlyY34Q/pngxKOrDV3ZWCDiLOoOkgi+QXns= 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=o5EZ128S; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=TxW0bh9y; 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="o5EZ128S"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="TxW0bh9y" 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 65UNLsqU3377707 for ; Wed, 1 Jul 2026 01:54:28 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= tgOSSppSHeyCQQrXCGuCdT6GPj1V3cln/qe0vnrJEJA=; b=o5EZ128SMcw4GUHj lP90HOxkso3lbUvP20Jgu4xk7NpIujDz5aY5xqz9yTM2ESCqg9mIpth9plJqGgkY TiC69bkh7zAlQgSmePqJSRT/BMFr0SXlb75hM6T5mAV9UakfBltTw9879Fnl+GuY YSDisxHzI3yQ2jGOZSgEvEP38+uAYj731sZuj5Ww3wjq2Ude2H//fbDB5xJR8wdP ypCg35Du8LmuIr6H+mu3gXJbV2zhTZScYxEVJDq2NV52P51wCFc+E6BhuiRKu5bp 3Wn4nVUJe8dmKUMVcG9b6uu0xRHb0OHNQqIxByfSlR34f1oZ98qrEPFdmh33vfP9 ai70RA== Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4f4hbd25br-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 01 Jul 2026 01:54:28 +0000 (GMT) Received: by mail-pl1-f200.google.com with SMTP id d9443c01a7336-2c9d8549d55so1617855ad.0 for ; Tue, 30 Jun 2026 18:54:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1782870868; x=1783475668; 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=tgOSSppSHeyCQQrXCGuCdT6GPj1V3cln/qe0vnrJEJA=; b=TxW0bh9yjeuiUJsL5ggbFNDeGUUc7wLHa4XIoEkNP9hB7HFU0KWJ3BuATr2ezvYzVJ YHVEcd/lM8x0fR6xLHrr1psbeYahz2uF8HzZSfp6wiZ/drodnDfA5A72SFrtu4/zgX3Q Kn1/9py0wuRwZOX0VhUVNpGOrL4gOKtluhWT99FRze6V/xmmDlLDOPNeuoptSCfX+nPJ HDERRzqWydmW9Z7GeCdfhnmAN705KPoaV/v/lRrLADrUcKAdOROH84JOIoOnWUu6YQor 61M2t5K5KE4b6D6cGZQNzsl19E3/6kkVwTWX7XbBSHEGVGguGc1tWGWv5vB0nOP3wHKp 379A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782870868; x=1783475668; 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=tgOSSppSHeyCQQrXCGuCdT6GPj1V3cln/qe0vnrJEJA=; b=SsmxveQr5d80CCdKfwi1+8lQzmUBfzEl6u3aPEG85/48OnJH4jDPP0q8F+EBddYSXD M/P1WhkNuqYS1IKyYJM/QOlqD5hOO3/EdJNZcZTxxBLOhFJbDYB28ZlAkt6jYcLVzIHm L+NINXKBdfzDNvM6oijKttUTAadURlF3OiCaNRMGYLIKronMHbjnaXsHd0QNk4+CK2Z9 wUG9hgzrEH93kPgVi3nWxgCCMKJOmdi+cWe68oRGynXk813XCLZAVozt1rvCYOgvBm6L DNZsyP2lLprW66DbRuCqQvrMrcSJkrdpN09DsiFksKmeOA0/gAEmMTl+1zN1+QAbvzY1 YkdQ== X-Forwarded-Encrypted: i=1; AHgh+Rr0hOBTCSdjhaZCo1mbNPwlcyGSazTe4NzGYgVAlRX/6Y75KjTuWGKayNLwPEKNRPJmMb+oH4NtqBT89Yg=@vger.kernel.org X-Gm-Message-State: AOJu0YyTNYmkAcXzrAeO9TfQeuU6nRE6caTbfzfChbPbELkrjhRffqI6 kSRYH1h0TFcsCp2/60BzqauJDVStfgjiOnifiV1S614r+tteikIHJH+tA7dZ6vNAJVljJCprP3L /NjEAIHq5DqrUIf2w76KPTtnOJ1dzqhZq/08SFwP5I8iMiIXdccVw63rJ+Qa+pkRnw1U= X-Gm-Gg: AfdE7cmmuc0iZvjUw4QZpdN162wTszIjRXdhnoQuTSIv6s/7ULo4dwCv6TRcq6QE6+c mVSEFac31IUP/CHc/S9oGTpnBcIVaaPklYXBS558/50zZPg8gqPKOu9SALbWWJhpMq91wbXGL+k 4TYezy0DWKcaUdYyfeG/sockq/j2tdTBxxp4LeuAUxFS3Wyt+mpI778iEhPZNqxKhT/gdCToVy2 BFmKmSoAaJmSHmLeN05DQ43tLLaKixy3QIrfHUk2fqhiHBMe0TVaXd9skmETrYhnxrJIuJNBM8U vSNJMXSu9Zcr8EmV4yBU4oCw1Cb7svt206PB66gRxU3W7W3fZ/0k8m1dtr5zlXYk4U+WJbqXwKt GDgpCSpq94q4PwDtW0Lh7XqNBd2S44yb9hbHf4Kw0VAue7J6mvvwgjgjneN8sAlSWWVv7mPtOng == X-Received: by 2002:a17:902:ce06:b0:2c9:a5e9:c26e with SMTP id d9443c01a7336-2ca5a552e0bmr24064975ad.13.1782870867691; Tue, 30 Jun 2026 18:54:27 -0700 (PDT) X-Received: by 2002:a17:902:ce06:b0:2c9:a5e9:c26e with SMTP id d9443c01a7336-2ca5a552e0bmr24064595ad.13.1782870867202; Tue, 30 Jun 2026 18:54: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 d9443c01a7336-2ca37a7102esm23040315ad.6.2026.06.30.18.54.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jun 2026 18:54:26 -0700 (PDT) From: Jie Gan Date: Wed, 01 Jul 2026 09:53:42 +0800 Subject: [PATCH v4 2/5] coresight: tnoc: add AG tnoc standalone compatible to the platform driver 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: <20260701-fix-tracenoc-probe-issue-v4-2-aefab449a470@oss.qualcomm.com> References: <20260701-fix-tracenoc-probe-issue-v4-0-aefab449a470@oss.qualcomm.com> In-Reply-To: <20260701-fix-tracenoc-probe-issue-v4-0-aefab449a470@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=1782870847; l=4552; i=jie.gan@oss.qualcomm.com; s=20250909; h=from:subject:message-id; bh=jPUYlzMEHul9CNoXVAyvw1WxSAWNAF1m3Kd9igZDHK4=; b=OEqkorXAE2d8ScPpY78cyBhpnWxbNw8WGkA7mG5v1VHqkug/8+KCAMspKvF+rul3OJeFxzTkX kLcJShiMV6iCxwnZGsJjEz9rb7WJd/1fb3OFFV+u87mJbJXNm3N76lr X-Developer-Key: i=jie.gan@oss.qualcomm.com; a=ed25519; pk=3LxxUZRPCNkvPDlWOvXfJNqNO4SfGdy3eghMb8puHuk= X-Proofpo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ntFg3VTdPwuSLBg== X-Proofpoint-GUID: 0HYW4oAuCenTzZeiwpAClh71bmzkFRsJ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-30_06,2026-06-26_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 priorityscore=1501 clxscore=1015 impostorscore=0 phishscore=0 adultscore=0 malwarescore=0 bulkscore=0 spamscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607010018 The Aggregator TNOC can be described either as an AMBA device using the "qcom,coresight-tnoc", "arm,primecell" compatible or as a standalone platform device using the new "qcom,coresight-agtnoc" compatible. The latter avoids the AMBA bus and the associated peripheral-ID probing. Add "qcom,coresight-agtnoc" to the platform driver's match table so the Aggregator TNOC can probe through the platform driver, 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. The platform driver name is updated to "coresight-tnoc" accordingly. Restrict the ATID-unsupported handling to the Interconnect TNOC. The previous check disabled ATID for every non-AMBA device, which would wrongly cover the standalone Aggregator TNOC. Only "qcom,coresight-itnoc" lacks aggregation and ATID functionality, so key the check on that 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..4ccd5f38b92a 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-agtnoc" }, {} }; -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