From nobody Tue Feb 10 06:58:05 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 755CE2FF675 for ; Fri, 19 Dec 2025 10:05:08 +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=1766138711; cv=none; b=NbEG8M9TTmhhYvxrYiyRS/0M5ahy/8mZtwboCrY7M75G/aXqFOu0QXJHDMdO5i35QoOsSOntXSD2GiDmjpP9CiX1ZEEzCAijspydQHfT2p4jwi+LWHZrHO1QVwnFGdkCIaoxpNeMBbFJdKFgOSABIFNF3jKg0jkFhaBOEVAifj8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766138711; c=relaxed/simple; bh=84lkaSKWH8O6/1UqEnUr2OLepIFqOmYvmKmr+mmTBI0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Z16v/nNbkPO2XNQXaF+MrxOMDsKUevsKyvaKTDSW51hFVFCagP0pIvlbVXT9zIIo+sh2mAnOczF6AZftJxHKNq5he1fIWhNTLejVighWjo78fl/gEqQ1rCTkXAM0d0Nk2wg7q/09/bUfh50pVMKR46wF0A8jMMV5D4FYXve3zAU= 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=m1YaN5HB; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=IzZrSvN6; 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="m1YaN5HB"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="IzZrSvN6" Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 5BJ4cBxI4145506 for ; Fri, 19 Dec 2025 10:05:06 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= 3paLq8rlIq8VD1L3wSj2Cm25PF20wxq+Uu1GCVBMemY=; b=m1YaN5HBoGcZ6hXM 6qyusIQACDtt+Jv5Yl03ax+Dj4uYz3Rf0TqxK2MluNxPPZ1mzCQrU0UlVcV/XaR7 FjTu4WyTlK5epaDzdZ6CnXWLTaDwhEcvluNcdtckUzlzkh4KBpcwMh1AG0EnXwZw XzN0TjkYNQKzJTaCqpXlpOzZ8m5dguZHfG0NNuYXdyVOfGtXCSrGTNOSL08rvEz4 2c0pzOP5apCRexXmMp23Q1NEi7tES8HaZgRUe1hV8Ev61aVz73y16kWgOuuPDEB4 zDDWxgatozmOq033zpBBvDczZy4zZtJomem40SVldC6iaijGz4imgTqc6d1I8b+V 49AaeQ== Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4b4r2dt8n1-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 19 Dec 2025 10:05:06 +0000 (GMT) Received: by mail-pl1-f198.google.com with SMTP id d9443c01a7336-29f8e6a5de4so22473205ad.2 for ; Fri, 19 Dec 2025 02:05:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1766138705; x=1766743505; 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=3paLq8rlIq8VD1L3wSj2Cm25PF20wxq+Uu1GCVBMemY=; b=IzZrSvN6sO6qWkzgHp4mJ9M63k2gmpEgoLRLsTAoDprSHXwGO4q3FdFZAwyZGDa9HZ 8WRo67Ntx1S5Udarm2cy4/joNL4XViP0MjEAjb/2Si4m/3w79MftIkicfEp4G234Z1JH dKX6XlmltJCQf3y+9meAM6KKQE1kA+N/WVKpqnb/ErLhvElqfcJyEHoji+S1UbT+ygr4 uuAuj3pTM0Wi/5h6HoqoFHOx3zVnAM+A/woSfEdYZxmn9sAhlECezPCsXqaFqJEbi5eG POR+4CpMf5kysmyNjzAn3KgTEdxyAsnSVZyyZLMOjeBSbmNVp9DSFKnpgLnTIOlGJxqw AJnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766138705; x=1766743505; 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=3paLq8rlIq8VD1L3wSj2Cm25PF20wxq+Uu1GCVBMemY=; b=t1Y2skSvDNml7jB6lM3ZofbTmmsdSZ7qN2LLEQhAhmifoRVJCCMlFTeI3ILU3dgrMe OlrLO1uH4jUt+1pAASNFbLm4ycqZ3ZQt0ocO+nnU0ANIFTcwkOhFSB4GCJaCeHuzIJus UUvlRLtrOKyDnoawFreZT4kbspvBj/TXAOS7rD3bEiHJiuvH6OY8DXnl3eYs+YebmaYx ehgyytwUvXQjtD6lDK1rHhzso/fU4bXW7CCD3TSlz+wsmaOqrbCn883cTsvUnL52Ykdr MYKsvOm8VLtlUEzTquJGM4W+6p7TteoYbQHhMjaV32bK9//UzA40NfaXMHvQj7rFcHxM b+2w== X-Forwarded-Encrypted: i=1; AJvYcCVBkhTSUvdl7ECJckzPKdZn8MbmElUBNmSjDj8WK9QQ4yrO6BgIXLXTqUAOXu9T595+/gva25qLJ3rIvCY=@vger.kernel.org X-Gm-Message-State: AOJu0Yzo2ilzKDvDABsQMByHM4qAuNeYqZDvb2y9bObi/5fETV//COsn xCI4S1JJs7pTywGYoysaoFwi/aBcL8GIi7cpXhrDbSpEgcMWAfq9PyoSG5q1G78aCysq+SFVs+e fT4TTkQKcQdu8cxj4Rd4EjVMm27To0UHHBDqywBzNZ1j5buU+dyMixWJlNM3idYrqK/0= X-Gm-Gg: AY/fxX6turM1pb4ex2V5U6CtfsrM+B3DVRzulpWYc+vKswVkx8Q2nES1OOtQusFW84q ucFiOXnwoTvjsQ8/ailHh+DsBysldnhnA3vY81BDWuHdZdwiGV3HyGvC2epbdyJX1YPhnmE5aOW oB15byytKOUsln2zqkGOV47n7rnYmfBrNl8eZl8Y/t4rk1rhGyrpXn1LfKOLReog5BVte3Kisdy qnQFnaUlpdECmCy6aTlzYqH5x4bZ0CrArEdftzHXNhb7bhxHby32ZRlCAM948Mvhhv/gQt+MalT A0bUgYdiN9O4a7TtvnLKdUiZH1QyQYZCiiIPafdgT5tIYPpVXxXZSt42JUImEveo6GsynNawAVX IOSt9dp5qXtxlVXyQvYbeRp9VoM07XBMRPF01VNItHoeP1/FayETsV9qh1DSEMI5Q7NbK7nwT X-Received: by 2002:a17:903:2f82:b0:2a1:10f7:9717 with SMTP id d9443c01a7336-2a2f2c4cea2mr22734245ad.58.1766138705172; Fri, 19 Dec 2025 02:05:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IE86Gcx4/pdsN78cTc6IZEqVYlAu7Pg2RKKPEaD+JmAiHkfxh2unEsO8p1vgr1qCebbNJdLQQ== X-Received: by 2002:a17:903:2f82:b0:2a1:10f7:9717 with SMTP id d9443c01a7336-2a2f2c4cea2mr22733875ad.58.1766138704572; Fri, 19 Dec 2025 02:05:04 -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-2a2f3d74bbbsm18164435ad.94.2025.12.19.02.05.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Dec 2025 02:05:04 -0800 (PST) From: Jie Gan Date: Fri, 19 Dec 2025 18:04:21 +0800 Subject: [PATCH v5 3/3] coresight: tpda: add sysfs node to flush specific port 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: <20251219-add_sysfs_nodes_to_configure_tpda-v5-3-ca93ddfe9d30@oss.qualcomm.com> References: <20251219-add_sysfs_nodes_to_configure_tpda-v5-0-ca93ddfe9d30@oss.qualcomm.com> In-Reply-To: <20251219-add_sysfs_nodes_to_configure_tpda-v5-0-ca93ddfe9d30@oss.qualcomm.com> To: Suzuki K Poulose , Mike Leach , James Clark , Alexander Shishkin , Tingwei Zhang Cc: coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Jie Gan , Tao Zhang X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1766138691; l=4048; i=jie.gan@oss.qualcomm.com; s=20250909; h=from:subject:message-id; bh=z522mHUju9vRVUJ4EsB7w92lZqaINA1rVyfv0aHL+jE=; b=czq7mBtMkML+YO0p5L2NSoep8l9D9PgTJ906RFU4Duz7UifhkjpftVbt8f41FKYXGcEQRXDi/ kZ5rRf0dFVxCmVmHFEz+Gr8nmfaCgqO7HtGYFg1fDlWo4NP9SEC9zwp X-Developer-Key: i=jie.gan@oss.qualcomm.com; a=ed25519; pk=3LxxUZRPCNkvPDlWOvXfJNqNO4SfGdy3eghMb8puHuk= X-Proofpoint-ORIG-GUID: A7Z5QWWLSP7oYFNu9KW_cMa4zBxZJdL9 X-Authority-Analysis: v=2.4 cv=A7ph/qWG c=1 sm=1 tr=0 ts=69452352 cx=c_pps a=MTSHoo12Qbhz2p7MsH1ifg==:117 a=nuhDOHQX5FNHPW3J6Bj6AA==:17 a=IkcTkHD0fZMA:10 a=wP3pNCr1ah4A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=KKAkSRfTAAAA:8 a=K1mhiUCce_5FropZUN0A:9 a=QEXdDO2ut3YA:10 a=GvdueXVYPmCkWapjIL-Q:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-GUID: A7Z5QWWLSP7oYFNu9KW_cMa4zBxZJdL9 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMjE5MDA4MiBTYWx0ZWRfX4zNoPKkkcwI8 am+CFdNWaYVSTbbbqA3i2O3y7wg2kwYHeR/eEsUU2UPtjyjjFDwWcEOIUmkOqJDlu61Yv/bvIZw VZlQck9QcWzDdiYyEYJANicUig28bPdXlkSm5vCDKo+xbNkSfSA+Im7BSu9ByIO7P0VlNdTgqXQ fD3szLH1OvAIFSSNBgWBmfumu5maXEaj7yLRIZxkQbGScZCU0AyTRwCeDGKTw2nEr4ivP8YUAwq nmGSrsTkr0csg/1mJmiG1ZHZ67SY3POcNy5mX5fVviO/M36xrQPXuRX+PzhTJT2+dWMTns9dOoJ zV456wt6/zGXQNGbqTTl6DHsYnh1Uy4/mL4z3XEi1y8X7CQUlYilqmbv+fc8DYukxljW32phczM Wk7mDgw9ePX8GsYlHxJF5yfItgjV6noIefsuJoUJHX1UBz3cX4FbFME/6HThsQcSARWhs4jxDN0 6D0PUVMC7uyHKjD4ilQ== 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-19_03,2025-12-17_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 priorityscore=1501 lowpriorityscore=0 impostorscore=0 spamscore=0 phishscore=0 suspectscore=0 malwarescore=0 clxscore=1015 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2512120000 definitions=main-2512190082 From: Tao Zhang Setting bit i in the TPDA_FLUSH_CR register initiates a flush request for port i, forcing the data to synchronize and be transmitted to the sink device. Signed-off-by: Tao Zhang Reviewed-by: James Clark Co-developed-by: Jie Gan Signed-off-by: Jie Gan --- .../ABI/testing/sysfs-bus-coresight-devices-tpda | 7 ++++ drivers/hwtracing/coresight/coresight-tpda.c | 49 ++++++++++++++++++= ++++ drivers/hwtracing/coresight/coresight-tpda.h | 1 + 3 files changed, 57 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-bus-coresight-devices-tpda b/D= ocumentation/ABI/testing/sysfs-bus-coresight-devices-tpda index a7855922328e..ef2804f87d1e 100644 --- a/Documentation/ABI/testing/sysfs-bus-coresight-devices-tpda +++ b/Documentation/ABI/testing/sysfs-bus-coresight-devices-tpda @@ -41,3 +41,10 @@ Contact: Jinlong Mao , Tao= Zhang /port_flush_req +Date: December 2025 +KernelVersion: 6.19 +Contact: Jinlong Mao , Tao Zhang , Jie Gan +Description: + (RW) Configure the bit i to requests a flush operation of port i on the = TPDA. diff --git a/drivers/hwtracing/coresight/coresight-tpda.c b/drivers/hwtraci= ng/coresight/coresight-tpda.c index d378ff8ad77d..5b4a9e41b067 100644 --- a/drivers/hwtracing/coresight/coresight-tpda.c +++ b/drivers/hwtracing/coresight/coresight-tpda.c @@ -375,6 +375,45 @@ static ssize_t tpda_trig_sysfs_store(struct device *de= v, return ret; } =20 +static ssize_t port_flush_req_show(struct device *dev, + struct device_attribute *attr, + char *buf) +{ + struct tpda_drvdata *drvdata =3D dev_get_drvdata(dev->parent); + unsigned long val; + + if (!drvdata->csdev->refcnt) + return -EINVAL; + + guard(spinlock)(&drvdata->spinlock); + val =3D readl_relaxed(drvdata->base + TPDA_FLUSH_CR); + + return sysfs_emit(buf, "0x%lx\n", val); +} + +static ssize_t port_flush_req_store(struct device *dev, + struct device_attribute *attr, + const char *buf, + size_t size) +{ + struct tpda_drvdata *drvdata =3D dev_get_drvdata(dev->parent); + u32 val; + + if (kstrtou32(buf, 0, &val)) + return -EINVAL; + + if (!drvdata->csdev->refcnt || !val) + return -EINVAL; + + guard(spinlock)(&drvdata->spinlock); + CS_UNLOCK(drvdata->base); + writel_relaxed(val, drvdata->base + TPDA_FLUSH_CR); + CS_LOCK(drvdata->base); + + return size; +} +static DEVICE_ATTR_RW(port_flush_req); + static struct attribute *tpda_global_cr_attrs[] =3D { tpda_trig_sysfs_rw(global_flush_req, FLREQ), tpda_trig_sysfs_rw(freq_ts_enable, FREQTS), @@ -385,13 +424,23 @@ static struct attribute *tpda_global_cr_attrs[] =3D { NULL, }; =20 +static struct attribute *tpda_attrs[] =3D { + &dev_attr_port_flush_req.attr, + NULL, +}; + static struct attribute_group tpda_global_cr_attr_grp =3D { .attrs =3D tpda_global_cr_attrs, .name =3D "global_cr", }; =20 +static struct attribute_group tpda_attr_grp =3D { + .attrs =3D tpda_attrs, +}; + static const struct attribute_group *tpda_attr_grps[] =3D { &tpda_global_cr_attr_grp, + &tpda_attr_grp, NULL, }; =20 diff --git a/drivers/hwtracing/coresight/coresight-tpda.h b/drivers/hwtraci= ng/coresight/coresight-tpda.h index 97e2729c15c9..ec93f9cb9648 100644 --- a/drivers/hwtracing/coresight/coresight-tpda.h +++ b/drivers/hwtracing/coresight/coresight-tpda.h @@ -10,6 +10,7 @@ #define TPDA_Pn_CR(n) (0x004 + (n * 4)) #define TPDA_FPID_CR (0x084) #define TPDA_SYNCR (0x08C) +#define TPDA_FLUSH_CR (0x090) =20 /* Cross trigger Global (all ports) flush request bit */ #define TPDA_CR_FLREQ BIT(0) --=20 2.34.1