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 E61411DF970 for ; Tue, 23 Dec 2025 02:16:41 +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=1766456203; cv=none; b=rBkYnRnF9yPxZAzl1Nw3Q6QnlXwuqTqiI3YdvLy8LIrpLF6v4KOa9U+CBwg+GXrkzUw9hInrl6yfhSX1ZiwV+wo3dwIU1tbPt0mJZnX+HrnqLprTc3rUKwYqp5+Xun4BMnZTaCgKb91cP8CtcYXqQVz0uwg+hpMuYaz0lQZ058U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766456203; c=relaxed/simple; bh=u8OKu+mWUdXC18qs0t2vdxbonl0ceJ2+OxLHXRaRGfc=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=FssLwEWAiyrDQdfOQspZ0lwRQqfJJ8ym6U77B3OKwD0VEpEouswT7dhcp0F3j9N6C5xcusWgCqvWioIl64qIrZOLVWwjE6UvH0kKlNoXK4PizOgno79NYXYZ1sgypKGaCz2kFTXZNPQEez48GDZ7ff52peZvuTSAgCAi+dUM6I4= 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=TynbB+1p; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Z7Cd2qlq; 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="TynbB+1p"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Z7Cd2qlq" Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 5BMECAXN1569012 for ; Tue, 23 Dec 2025 02:16:41 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= OAGEBzhF/yKM+ObibcBG8MNheJoaTXjhoRXLmTtewT4=; b=TynbB+1pu7f4RaPL 1otAERzdSlAsKy8fzpH0v3yGVKSkisw0O0SNKmjKyWlJ/y2nbKbNxF8mvsIQSSdL gujFzzw4SRYAf1XJmpD6pABZxJPkm549RPheh1xHmPZCDoNr544xXjAuCioVljXk yIRPzJTjyXFeYR3OzfKuiK96OYpMreyPQQSsgELbLLRzIPjMdInjoxXPCB6n21tG w+FQWcCo6pgN7kU6RpsK+y9HPSj4d1QIVJIRT9CGDsafxbeE6uDnL7xpnYYHq4OQ m2le/ZqrkgdUz4YzZYsIQyAQD9aHmAZRLRgGlNf2c2gJOSt6NFK7IgyoetyR7tdB e0wrdw== 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 4b76yy1t3j-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 23 Dec 2025 02:16:41 +0000 (GMT) Received: by mail-pl1-f200.google.com with SMTP id d9443c01a7336-2a31087af17so65093345ad.1 for ; Mon, 22 Dec 2025 18:16:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1766456200; x=1767061000; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=OAGEBzhF/yKM+ObibcBG8MNheJoaTXjhoRXLmTtewT4=; b=Z7Cd2qlqGz0FB9njT1U0Q6hFeOdjNnZlh/D9KUoy++UWZBkIPhvSncEAQMLg7lnY32 rN1I3yMpGEEjW3Rp6+1e16FUfJ4sTgfQ753WeqtmCzq2rySDxIQ++7/PxJDcwtG/YSv7 8pW4rLeVR7ld+HWLWT8md27+eCdEWW3Q5OoIXX0yrX/mM0OPi2FjAEAR+cHTKdiTF0zi Hv1MKa5LDofOLdaypX7dDT99QI6v/IrxIHN5Q3uZ+rZUHLuADv+8ZHjmyEQQ6qEf5gwu JcFKujaFqKEr0IDsxzizXdLanHuXwWa877a4kFgFgkSLo2ZckCu1pEx0v40f+LpbNzGu 7Rqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766456200; x=1767061000; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=OAGEBzhF/yKM+ObibcBG8MNheJoaTXjhoRXLmTtewT4=; b=JaBfYbNEuCx2Jlz/7aP7oqx7s7LYJJEggOi615ARTB5pzitxQwNgL/mMyi79xmB0ba NpSmIDNprno70+rUl4QMNXQZP2hlBhlBLAH1hYNuh1Pcb8qqrZW+x7/xC3ZVspNdFf7i TVBlj9+/Mh/xcXSZihna1HiRWXO2OzvqVZdJb0UxTTXiaa3hPbjs7oDoYStFKFHmejpb yeDBSTjbwx89JYPha30xNycXGYPB9hr4nXh8qUnpJz/eMrKqlIaXXFXbBP9PTXRc5yg0 I9QNsfHXzKbtA9f7raCszq6iiBvpBzlm+1UBPCdalj40yC+6yDlX/YKEA0Rqa+NZX3ek mh9w== X-Forwarded-Encrypted: i=1; AJvYcCWF9vbJn5ArCJIh8xQ37ER+Q2PoZkTeVIEEu9j1zcyEoeqVBFKVfMfVmKaK9HANNlLU9GY8HAz50ub7xO8=@vger.kernel.org X-Gm-Message-State: AOJu0YzS0W22W2uFUghJcM7xRPLTLoUJU9BrtZkdUMFo6YkSvt9FYu9x DqSaOm9g8aTLvqy99stkzmezHki1hnsZgJuuyV+zh8b3N5WXkMBDbSS7zitt7nqgXOmeNMTNIL1 JI86NCNRsLX5DuXBN6P7l2A2F38f6WOlHBN2FYXG/S4vJHleaBkbnn7QMkxCsiXAoBTBKzO6SDm pJzQ== X-Gm-Gg: AY/fxX587eAEzTMKY/G3KDXK8ZnosDGJrXDKun8mZoeLxzqTW1uVCvYdwGckvPzFqiG +oV9paCjEh8QyVgHkRR9rpGDMOFXXTN7e9vCVSklFu/bWWCm3dAgjTosk3p7XyGmtCVF4oZ+Boc Wj+eozcJbCCzmOjz4ibwcGqcQfV0tcxc973HARKsbca2Lzgmht69XJJd412qNpoafG1+7mW1UPQ FsE5/b/suFsZ4Jhzzqn96cE+jzZrxCUrlTgObN0+EQ9ww9zqtOEYsPUpa/VNQWmn2P4JM9OKrNT JbjmVWbgW1E25jA/H9TPeKqbW1MFXI8bWCD/A8jezL0gtzc2QFM9pgHGiSh/cTPQF7a/WZ4BjCm Fd0XaJEQOzq126l0KXn1vNNDikH5JYGe4XtHs1wnyYxboyA1L9wp3aCH4w3KTK2c06/2UepLsFz c= X-Received: by 2002:a17:902:e885:b0:295:557e:7476 with SMTP id d9443c01a7336-2a2f2202fcfmr152554245ad.7.1766456200240; Mon, 22 Dec 2025 18:16:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IEVBRgfThPoFR7Ln8zAfm9AsxxuJCcTFpPemwjttS5fNMquFHI6a2ecuCIBUl/uvqPdsyZ8gQ== X-Received: by 2002:a17:902:e885:b0:295:557e:7476 with SMTP id d9443c01a7336-2a2f2202fcfmr152553975ad.7.1766456199713; Mon, 22 Dec 2025 18:16:39 -0800 (PST) Received: from [10.133.33.169] (tpe-colo-wan-fw-bordernet.qualcomm.com. [103.229.16.4]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2a2f3d74bbbsm110349625ad.94.2025.12.22.18.16.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 22 Dec 2025 18:16:39 -0800 (PST) Message-ID: Date: Tue, 23 Dec 2025 10:16:36 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v6 4/4] coresight: tpda: add sysfs node to flush specific port 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, Tao Zhang References: <20251222-add_sysfs_nodes_to_configure_tpda-v6-0-b27143d45c86@oss.qualcomm.com> <20251222-add_sysfs_nodes_to_configure_tpda-v6-4-b27143d45c86@oss.qualcomm.com> <9899b6c2-2bdf-41b8-9156-dcf1b611da39@arm.com> Content-Language: en-US From: Jie Gan In-Reply-To: <9899b6c2-2bdf-41b8-9156-dcf1b611da39@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMjIzMDAxNyBTYWx0ZWRfX8IhGZaPFp517 BlE1yP5+aF+RKOwI+zc4gpolKRwQPuiuhfPKzTBnlRXP3ceouxxSlYsDTc9LWZsnpmVxp1Sc/2L DzrhspzyLoeTPTxGEUrIq0Rh9N2QPKdPprWWyiECPWlN9EpaH1n7AqefoAkqtDaWFRCWSjU+bSr AqfpvvkP90iagcN18SBCms6zFceABMZ9D9zxegGCK4LllkvV4Ot7r9q5Hl0UDWEt2Gw2VYYIgrO HJTtNEtjzNhwaU7BTrFuzHkdoykf5c+bLeocPByRivffDixacQ/yMvnsz8j7gcuZTsirNOmIi7g EbXHdUsikmL1HnMb3qcg8s+R3e1S6Bhf/QHZAaB/B0+lY965OUta7j11A601ZvlbOGPGjbh2GL8 nGjLRIph2q24AdMjNH/8YEPIkG3EK1buLTDKRJ+qpcQIzAVd53vAmFDRz1911NrBHDAP5MIvJWV bvhQ/UCQDNxUTKJ6n4Q== X-Authority-Analysis: v=2.4 cv=Zb0Q98VA c=1 sm=1 tr=0 ts=6949fb89 cx=c_pps a=IZJwPbhc+fLeJZngyXXI0A==: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=LklF7o-fHLUnHnnKXNoA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=uG9DUKGECoFWVXl0Dc02:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-ORIG-GUID: DRLVSoZFjD-6-Gdzp_vRpNeVLbYY3lzN X-Proofpoint-GUID: DRLVSoZFjD-6-Gdzp_vRpNeVLbYY3lzN 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-22_04,2025-12-22_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 priorityscore=1501 malwarescore=0 impostorscore=0 phishscore=0 spamscore=0 bulkscore=0 adultscore=0 suspectscore=0 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2512120000 definitions=main-2512230017 On 12/22/2025 9:12 PM, Suzuki K Poulose wrote: > On 22/12/2025 06:02, Jie Gan wrote: >> 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       | 40 ++++++++++++ >> ++++++++++ >>   drivers/hwtracing/coresight/coresight-tpda.h       |  1 + >>   3 files changed, 48 insertions(+) >> >> diff --git a/Documentation/ABI/testing/sysfs-bus-coresight-devices- >> tpda b/Documentation/ABI/testing/sysfs-bus-coresight-devices-tpda >> index d359d90dca72..df8f03d4b573 100644 >> --- a/Documentation/ABI/testing/sysfs-bus-coresight-devices-tpda >> +++ b/Documentation/ABI/testing/sysfs-bus-coresight-devices-tpda >> @@ -51,3 +51,10 @@ Description: >>           mode 0 - COUNT[11:0] value represents the approximate number >> of bytes moved between two ASYNC packet requests >>           mode 1 - the bits COUNT[11:7] are used as a power of 2. for >> example, we could insert an async packet every 8K >>                    data by writing a value 13 to the COUNT[11:7] field. >> + >> +What:        /sys/bus/coresight/devices//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. > > Does this have similar semantics as the "global_flush_req"  for "Read" ? Yes, global_flush_req triggers all ports at once, whereas this node initiates a flush request for specific port(s). For reading, we can check whether the flush request has completed. Thanks, Jie > i.e., the bit stays set until the request completes ? Otherwise, why > isn't this Write only ? > > I don't see the point of "Reading" this value back. > > Suzuki > >> diff --git a/drivers/hwtracing/coresight/coresight-tpda.c b/drivers/ >> hwtracing/coresight/coresight-tpda.c >> index 7baa8a0965d3..f79fea4fbb2c 100644 >> --- a/drivers/hwtracing/coresight/coresight-tpda.c >> +++ b/drivers/hwtracing/coresight/coresight-tpda.c >> @@ -430,9 +430,49 @@ static ssize_t syncr_mode_store(struct device *dev, >>   } >>   static DEVICE_ATTR_RW(syncr_mode); >> +static ssize_t port_flush_req_show(struct device *dev, >> +                   struct device_attribute *attr, >> +                   char *buf) >> +{ >> +    struct tpda_drvdata *drvdata = dev_get_drvdata(dev->parent); >> +    unsigned long val; >> + >> +    if (!drvdata->csdev->refcnt) >> +        return -EINVAL; >> + >> +    guard(spinlock)(&drvdata->spinlock); >> +    val = 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 = 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_attrs[] = { >>       &dev_attr_global_flush_req.attr, >>       &dev_attr_syncr_mode.attr, >> +    &dev_attr_port_flush_req.attr, >>       tpda_trig_sysfs_rw(freq_ts_enable, FREQTS), >>       tpda_trig_sysfs_rw(trig_freq_enable, FRIE), >>       tpda_trig_sysfs_rw(trig_flag_ts_enable, FLRIE), >> diff --git a/drivers/hwtracing/coresight/coresight-tpda.h b/drivers/ >> hwtracing/coresight/coresight-tpda.h >> index 1d2de50bb9f9..ef1ce2ce36a9 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) >>   /* Cross trigger global (all ports) flush request bit */ >>   #define TPDA_CR_FLREQ        BIT(0) >> >