From nobody Thu Dec 18 04:29:43 2025 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 17D572874FF for ; Thu, 11 Dec 2025 06:11:42 +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=1765433505; cv=none; b=qU6QJj7J/wC3q0xCfMMCOyr/EFnbSOSWJKLqv9uFNv0MEYgOAr8kUOPJ7C7Aavdkkec41JdLrGMMSqKjmbuh2LFM/A4m2uOvMAtmT9xVwLipK6KfvM5+g3YsbR+FPgGf9auVDNAcp8rTZ/Bs1yArT7asD97a98SNHXLU45Vc7Xs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765433505; c=relaxed/simple; bh=V1yqLgVyRYM0PUluEeNsvfvMV9kESqLqhRAs3x4U+UY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=EAdVhzdPvcCNyjnS1XNn36wlGxy6kawFeqr99l6U/H1YL0sZ9lvGUIgCQvhsck62bIhuQJ9lMngstcWaS5L4Sl6qMBZDJ+b/MS6y1XjBaTV1vONMQOydS4lLbzh8yM4J/ZMlrpOEyzo84g+QOedI0jvOjNct4/tUNdOtb0bxp1o= 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=BAHuHfzt; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=jeZtYhFr; 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="BAHuHfzt"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="jeZtYhFr" Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 5BB1GbD63927045 for ; Thu, 11 Dec 2025 06:11:42 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= H37x9ua3ePA/7qaC/cjVE28usIUyXzLi30yOiv+YEFA=; b=BAHuHfztQk7DX8Vo +WTpDE6Q5vy1zofvvcra0c/15iJijCSGpOsJAmNeOs97IBaY1wMg8ZtgnVoObgtV wHaucBwFBmKI5O3ew3+Xj0exx6gqziM5zCsUtLWFUncqb4soIG7tzxOSY8nCy5w8 Mrfu1k7Rh/bjr1r3Y3d3bGSPPFzv3kRwxFNeMSEMOQ84hIfZBLZIgwHUewb1RBcU kHdCutVvIkuJoj4pR5oxp5XC3eP1sRHYHK3owEsSPlIID1YIWy57QaUslWBQel/d zC9WcpZn38WrCH5peH4sz87HlgbYH9dAWOholV6BhgBeIKImPQpe+quHb6fNj4Bs dhwyHw== Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4aym580pva-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 11 Dec 2025 06:11:41 +0000 (GMT) Received: by mail-pl1-f199.google.com with SMTP id d9443c01a7336-2955f0b8895so16562035ad.0 for ; Wed, 10 Dec 2025 22:11:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1765433501; x=1766038301; 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=H37x9ua3ePA/7qaC/cjVE28usIUyXzLi30yOiv+YEFA=; b=jeZtYhFrgWRXJZpr2N0XnyMZMqHCJnVOQHu08RzNkhbHWd4GtoTt+GFOCODDGLmErA WG2+GliLzWYmqtlthHBrg+cKc4P7SPQN9q0O0DR/hwT1JbLhOB1teZdoxCy7pbk2wH9y wexRROnjnqPgkigknUc3uXlyc32X7v/oOTRtILmdS+FeDclvEFip0BDe2FWAfdmHaCO/ OOm7RaEnL/jd5C+lCaFub5egh9J5Om5wM56ngVI5YZdeu8Q+ZXNe11FN8aEd2oJQV2E/ s7d5DW/NyQwNv4bET9lnJJvpJlz/9EdtA8jKKk+8VTL8RNaw+rUsFELC++zLePZkP2HC ql7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765433501; x=1766038301; 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=H37x9ua3ePA/7qaC/cjVE28usIUyXzLi30yOiv+YEFA=; b=bJzf0uoLzrX8qCPu19TrsDiZp0k5S3mpWZS0Y5zREQ8rW/kY8+ptAz3+ywLh/pzMWR b6ZpA2AdZqFG6oASQftiOVu84rN/IC7pGjqrIJH8ZfIpwFpskGhrioVyuWHNOugy/yGg NsfBWvNzddsljf1iU+Wv9yNgF1FXAbdZIDF9QouBw+HeeJzxfSmursuR6K+J52mU1oLP /6n3kCwF0fgRx6zVy1T6nA0fhLClk2XT0+K3JKX+Nl4m+g7BSs5PBBh6Rkdw6sAZLg2T csj+QDweDnv4LrTyBV8RTpxnmdUrU82URojbix4C93Px5Z35wppjJaF+hiaM2E89cQOt GLVw== X-Forwarded-Encrypted: i=1; AJvYcCXd68hqxjQLELeiSEdMrvp43JG17jFO2r/ZlJPhCtaxz9yW9bdu3RmsVaQjQ7ebwpXgLmzHTUW2R5pdKQ4=@vger.kernel.org X-Gm-Message-State: AOJu0Yyw0yMRapF0/INLLtctUg+dBkdjRTKp5WkWhEGPMXhIEs7HFplM lbKkhuag09B0AOjb/yf8oIWpK1gcC5XpVf9UhRgVuJm8wtSCvZhR0rwhXgOT6fgPdvVT/KRAHOw KjDPo7jbB4WRp/NthgkvmxDXth/owSd5xvmCtKpqYW5JOvId8qKuFGqnYZSuPjx0ELwk= X-Gm-Gg: AY/fxX7pHJgq2HA1oLhhxi6Q5dieN217PTJmmCnmZFvHr1KmCe8idaSptt7FAYUZovg 890eRG0eySseVMp80yP12wFe4MN31YgAJTjIjC0p4U1eIJy5AaEFprgIACt6VXPYJBAtvFSFT70 q2v4V1qtPUHdde8rhdfu14Ysgc7YaUuJ+VJd0uFQX6Mij/OA61cJUDJ2l3HGG8u3PSPGpIptJkK wmoQoVPGSv6mv9C3naKT8Ev0b3iMcO0gPfz0bJuwVLyDmsH5ocqNTS+CeYcGS6AZd0eLDRlgi1f IxyOPBnihbpAwyo80qgxcKJzIGLLtcnMZ06aFm242Z/s/UwtsXgDTUXa6rQGTnVjL6jjjhhi4dK z/5TzBojI6mkE48aCbbg81GwEEtD1zWMjJqcB+IMzwmWxwvN+a5zWcWzsDlMojHJCqe4C48VC X-Received: by 2002:a17:903:1547:b0:299:dc97:a6c9 with SMTP id d9443c01a7336-29eeebfe83dmr12700295ad.20.1765433500944; Wed, 10 Dec 2025 22:11:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IGwYgKqzGeqU7toBB3FXsS20/zU0kWSROq2OAeA21VHW7Aj231W3vxDpdsEaA0jyBj4HPae/Q== X-Received: by 2002:a17:903:1547:b0:299:dc97:a6c9 with SMTP id d9443c01a7336-29eeebfe83dmr12700075ad.20.1765433500442; Wed, 10 Dec 2025 22:11:40 -0800 (PST) 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-29eea065186sm11725945ad.89.2025.12.10.22.11.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Dec 2025 22:11:40 -0800 (PST) From: Jie Gan Date: Thu, 11 Dec 2025 14:10:41 +0800 Subject: [PATCH v8 2/8] coresight: core: add a new API to retrieve the helper 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: <20251211-enable-byte-cntr-for-ctcu-v8-2-3e12ff313191@oss.qualcomm.com> References: <20251211-enable-byte-cntr-for-ctcu-v8-0-3e12ff313191@oss.qualcomm.com> In-Reply-To: <20251211-enable-byte-cntr-for-ctcu-v8-0-3e12ff313191@oss.qualcomm.com> To: Suzuki K Poulose , Mike Leach , James Clark , Alexander Shishkin , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Tingwei Zhang , Mao Jinlong , 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=1765433484; l=2705; i=jie.gan@oss.qualcomm.com; s=20250909; h=from:subject:message-id; bh=V1yqLgVyRYM0PUluEeNsvfvMV9kESqLqhRAs3x4U+UY=; b=8bi2aJgwsd3U0FCI77yLrfMBwxWS5FP25X0Ek9isQ9rjD9FpLTnLlZ+eJ5y7aHJ2RNUNOBFFk 6rOoVUCe+mICa+ydcW1naz7MEek9HQMlbNOYZ4gaZV32mTlwUl4sMTy X-Developer-Key: i=jie.gan@oss.qualcomm.com; a=ed25519; pk=3LxxUZRPCNkvPDlWOvXfJNqNO4SfGdy3eghMb8puHuk= X-Proofpoint-GUID: D7C_az5TQhvz4YNCi79JIkFkf7Uc1fIV X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMjExMDA0MiBTYWx0ZWRfX4KJ6hIn2ya3P bA1m0+JAPmuxIzuLj87xIiGFflmt8XJtICmdGjzc+3xiuWOd45q06/jwvmQjYX/cxtcNU83tLj1 2Y890Idg+meUkxrxQWpTBKkJCBvynjh0YXYBp6oMd4Iyz76JNVgtmtdLSgihN1BHHSgdi3kpXw9 5cT6HqEKTgvJK6Y7EES4mv53vM8YWgtFObnlINhgDPT8bMZCF6Mz+zVur0I7cc6optroaQdLPIo yi+0q5Yx1HdkCbeoUlhko0+/xLSCkx4yO3eDZIa+sBoFKylzl/Q9+7Np4nYgozq5WLh2Rt5/RQx dOHFTBdb/CR1AaNjMwc7o5HLCQHsOAixpN8RADjDJyNo3R627xZ0W972eoV4ID5RNHlNX5s+Sdz oE8PTeOgofe0eGRyIHzMnhFDEvX0sw== X-Authority-Analysis: v=2.4 cv=FYU6BZ+6 c=1 sm=1 tr=0 ts=693a609d cx=c_pps a=JL+w9abYAAE89/QcEU+0QA==:117 a=nuhDOHQX5FNHPW3J6Bj6AA==:17 a=IkcTkHD0fZMA:10 a=wP3pNCr1ah4A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=KKAkSRfTAAAA:8 a=EUspDBNiAAAA:8 a=AzIya3-Hz0U1LB2V40wA:9 a=QEXdDO2ut3YA:10 a=324X-CrmTo6CU4MGRt3R:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-ORIG-GUID: D7C_az5TQhvz4YNCi79JIkFkf7Uc1fIV X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-12-10_03,2025-12-09_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 malwarescore=0 phishscore=0 priorityscore=1501 impostorscore=0 lowpriorityscore=0 bulkscore=0 adultscore=0 spamscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2510240001 definitions=main-2512110042 Retrieving the helper device of the specific coresight device based on its helper_subtype because a single coresight device may has multiple types of the helper devices. Reviewed-by: Mike Leach Signed-off-by: Jie Gan --- drivers/hwtracing/coresight/coresight-core.c | 35 ++++++++++++++++++++++++= ++++ drivers/hwtracing/coresight/coresight-priv.h | 2 ++ 2 files changed, 37 insertions(+) diff --git a/drivers/hwtracing/coresight/coresight-core.c b/drivers/hwtraci= ng/coresight/coresight-core.c index 0e8448784c62..667883ccb4b7 100644 --- a/drivers/hwtracing/coresight/coresight-core.c +++ b/drivers/hwtracing/coresight/coresight-core.c @@ -585,6 +585,41 @@ struct coresight_device *coresight_get_sink(struct cor= esight_path *path) } EXPORT_SYMBOL_GPL(coresight_get_sink); =20 +/** + * coresight_get_helper: find the helper device of the assigned csdev. + * + * @csdev: The csdev the helper device is conntected to. + * @type: helper_subtype of the expected helper device. + * + * Retrieve the helper device for the specific csdev based on its + * helper_subtype. + * + * Return: the helper's csdev upon success or NULL for fail. + */ +struct coresight_device *coresight_get_helper(struct coresight_device *csd= ev, + enum coresight_dev_subtype_helper subtype) +{ + int i; + struct coresight_device *helper; + + /* protect the connections */ + mutex_lock(&coresight_mutex); + for (i =3D 0; i < csdev->pdata->nr_outconns; ++i) { + helper =3D csdev->pdata->out_conns[i]->dest_dev; + if (!helper || !coresight_is_helper(helper)) + continue; + + if (helper->subtype.helper_subtype =3D=3D subtype) { + mutex_unlock(&coresight_mutex); + return helper; + } + } + mutex_unlock(&coresight_mutex); + + return NULL; +} +EXPORT_SYMBOL_GPL(coresight_get_helper); + /** * coresight_get_in_port: Find the input port number at @csdev where a @re= mote * device is connected to. diff --git a/drivers/hwtracing/coresight/coresight-priv.h b/drivers/hwtraci= ng/coresight/coresight-priv.h index cbf80b83e5ce..8e39a4dc7256 100644 --- a/drivers/hwtracing/coresight/coresight-priv.h +++ b/drivers/hwtracing/coresight/coresight-priv.h @@ -157,6 +157,8 @@ void coresight_path_assign_trace_id(struct coresight_pa= th *path, enum cs_mode mode); int coresight_get_in_port(struct coresight_device *csdev, struct coresight_device *remote); +struct coresight_device *coresight_get_helper(struct coresight_device *csd= ev, + enum coresight_dev_subtype_helper subtype); =20 #if IS_ENABLED(CONFIG_CORESIGHT_SOURCE_ETM3X) int etm_readl_cp14(u32 off, unsigned int *val); --=20 2.34.1