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 CFB93340A4A for ; Fri, 19 Dec 2025 12:32:30 +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=1766147552; cv=none; b=Zc7cC/5xo3/6Yi9g5w3wzvm28O573VD2mgdB7cce0M+8h+u3YB8soJ/IucWZ9r54yw2WnVozZpmOgiA37yrfVKslI4GDdyVtcLiFIz0FYPnF3G7a7w3xXw/IX00CupVIGcfFshklk5+04shudSJuNBITU8LZkuAdnkw0Rqj0ftg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766147552; c=relaxed/simple; bh=wMwsqPxiGZwlhOq8/39SdzNTlJBswhtvaa1Tno+cKK0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=XrgXc7BrxbBK2B25PQfKw8hxt9zA75yGNh2Nd5/2YPqBuVf3HzBSHI6DBuDxub+YftLYZTXrTiZf/MvqvHDpQSJZVuTVa3mBywVxmnaunnPZhrHRTY/311Q46je7gJyoY6hWjbqEwdZ/qkztwYY9Fyu1z43hW4nQMO8bMbYMv8k= 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=hctqU2hb; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=kafeD0Tp; 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="hctqU2hb"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="kafeD0Tp" 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 5BJBglmo1771837 for ; Fri, 19 Dec 2025 12:32:30 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= hxHpN+kau7XrRpGD5rceoc4dUpfUE8obwuBKrm0Q/0A=; b=hctqU2hbzNiziNF4 s8QJiHEsnt637Fo728r/0YCERcDPtXijpUwni059Y48mb3IBKVk9rshDL2iQXA0f ZzkKERRLTicJEv99uD59o9b2HEbrMp3MaroRhl9Hsrrx+Aoa9jT9H/90cIUKDgCr jUZMH7JEDJ0kf4CkVMLLbIfkPkbpHWMwPMunSVAhcOqZDD9MbRNGDsU3kOg+41z2 qHnRD9CvQ9OjlqZd36jFis98Ft22PicEgUeQEt+ulYgT3FnfXEHgUJCUmfTftxGt vejVjvqcapHBV4/9pJsxWE+HMbMNpu1id+AoR5LHe3Ekpgza7uoPoMfXB91sN34x GSIxmQ== Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4b4r2bjmtc-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 19 Dec 2025 12:32:29 +0000 (GMT) Received: by mail-pj1-f70.google.com with SMTP id 98e67ed59e1d1-34c904a1168so3455011a91.1 for ; Fri, 19 Dec 2025 04:32:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1766147549; x=1766752349; 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=hxHpN+kau7XrRpGD5rceoc4dUpfUE8obwuBKrm0Q/0A=; b=kafeD0TpeGObemAip31PfLurj45juva9d7jCb3PruyoP+uMTa4n0p/Rjj5P+xYKX1/ bldGqHwlt6cbnnbenOOCBc3BTFjfKpYlxKNy64qj7vZqTb46kULd9xSw4vLHVBj4m/GB tNVuIcxjuLZUuid5pM2qzJNK8zPHmBV96PafwZUsCdsa14iUhzsVsAmmV5epm8RJE66q ZFb+t2i2k5XL2HdOn0e23Wl/D2C4AWdm7VY6km8Pqu7m5yNmEqgwkgNn+5v6Ww40zzLM pd2munTEFA+2fEkrgWC71B9QW1jT7Srg6REBFm/ljDVvapB/OWmORddHBK4H3JT4P+L5 PFZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766147549; x=1766752349; 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=hxHpN+kau7XrRpGD5rceoc4dUpfUE8obwuBKrm0Q/0A=; b=eTk4opN9ZXRdOM7RcCfJHfW9sR/Z/gjbo0cnOAr7KgMEG8kU9xDeAj9047U6TlwJS8 ovPgduG2DOHDa9cEwRjTwzsCdPuDBK8aArMagGvduzs+HuTmCHQcuxRA9R1J6dwts9yN Ng1b/mkHtJO7fdtmTDz3MwepueKyKTlpYr8n5e0w4BnuXJjxbAgiukv/Wa1S4mfF+a9d zZbQd3RPtmiMfJri0aJ1j5/gjItgMEQW10yJO7aQLTaw8S6GdqCDY9cYf8rH71R0tsqn OESi0+2Czxxjw1cZ8ssvgKmLE2QqF5suoKKfTFBQsuRJ4Ao+cqy9uP3ml6YzRyGaizjH SwZg== X-Forwarded-Encrypted: i=1; AJvYcCXjpovFzOahXE28ov90ko5XMB+LWbyZLqsbYzbQXhDASBcKq0vWVI2QnIIEluCXsnPcPFXz/BuZLQrctD4=@vger.kernel.org X-Gm-Message-State: AOJu0YyjefFmn8r3XeP+2bt+qNcqK5RwfmuAO2oDb2XHiFR25teyAYLh wTuGEiCZ5BIbmQgHujdAb8XTv1g80HsSx2HDcTWuWBqYHGa4o5g+dcY0Bn1J2LvItfuQFR43QuI dedLKmH0smrj3+MNBqRhKtZIgfH4OmoYCchLecjygxT169XlU2px2U7ZZ7DdFZHo4jEUnOnjYw5 xvBg== X-Gm-Gg: AY/fxX5zvGTJKzBVb4oArfjywxQbJLidMyXLB3sEu96nuzUfNV14exkPVM4eWjFjznt CfoSV8JpKMnEkU23FHn2D/RQmv2W8KnM243/jn4Af8F62lcBhLh9mEjHja/JeieQ+o6K2NYFYPr 9c4qgyvkDscTljaNAP4N9sPg5dJnpciwf+3FQTtzExNZ4+S7pMaeyrCwlPU/8k18q++A+R/HOJN yd0tDwKJsXrs3gK16BCjciUf6GF8GP8SJqwaTnfUpEM1O68Y48cvm9b5Zd2Yxl+32aEiG31NkR4 LbpRnUndBfbQhCiy2JzhT79BAouJ00hOEKvndFgy/WyBMDug2fkEaFj0NH0CA19ThT8oXzBD64K Tr42kxhZo/V1NSxp7RPW4ZIJF0rfhdHvkFR4G3rypqbJlcZ4hf6XYu7MpA4+VlpvJ/88oPNmNzv 4= X-Received: by 2002:a17:90b:2dc6:b0:340:bfcd:6af8 with SMTP id 98e67ed59e1d1-34e921370camr2120370a91.4.1766147548699; Fri, 19 Dec 2025 04:32:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IE5WcginvI/EXY/d2mIbBxPxVBYC5DbZJCgImRp6Ae+Ac8yYDIzUleSa7cA08IkCLWAgKOl5w== X-Received: by 2002:a17:90b:2dc6:b0:340:bfcd:6af8 with SMTP id 98e67ed59e1d1-34e921370camr2120352a91.4.1766147548181; Fri, 19 Dec 2025 04:32:28 -0800 (PST) Received: from [10.133.33.111] (tpe-colo-wan-fw-bordernet.qualcomm.com. [103.229.16.4]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-34e70dbc9d6sm5197547a91.10.2025.12.19.04.32.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 19 Dec 2025 04:32:21 -0800 (PST) Message-ID: <2aa33df9-de5c-4db2-bc7e-28b15adda099@oss.qualcomm.com> Date: Fri, 19 Dec 2025 20:32:14 +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 v5 3/3] 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: <20251219-add_sysfs_nodes_to_configure_tpda-v5-0-ca93ddfe9d30@oss.qualcomm.com> <20251219-add_sysfs_nodes_to_configure_tpda-v5-3-ca93ddfe9d30@oss.qualcomm.com> Content-Language: en-US From: Jie Gan In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Proofpoint-GUID: xXQVL-ntoeDUoz6WaJ0sJnGQ1CPA4ZAb X-Proofpoint-ORIG-GUID: xXQVL-ntoeDUoz6WaJ0sJnGQ1CPA4ZAb X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMjE5MDEwNCBTYWx0ZWRfX0FxmC+hC8RAa OFeBZ2NJhnSjpUC8mGm8PyBsLyxSL54PIyO3l9x98XJ4ydPE9MM36J7LoUfI/OHGlSOlUdXbI1f G+hzJTv1BTKQlfm29MY7mXSp1avSIeb3OlIGpWg/fTM+lmnMCB4WGyGsXvp4eSRwPhhimTwRpkt 0JHeOqMFZ2PchNcmeiZNtZQnLv1/bTRemETEEJt7IZ0zlffGgf76/DRdcu/wFvttcSqWn0BKu4f pmjl54DSB3MefxNS/Gg6Puu6v9yBkHo90mKETOT0ufJzsBNOhz7D371en/3+UG/WSjupgn8H7ix lwmvamqfjljZtBeZQ9DzCz7kOS6EsUGYfMLW3XrM0XjOjf55IGslwXNxC+7gaosOyIWEfiGY/RM orDuvQpiE4+8/wlyMpp9F0JADBYAdBg095QjWZgAv7WXNbR0uA5dK1jKzY8B5HUKO31AsYxpGhM oKggHKhq0mXJiiwhoBA== X-Authority-Analysis: v=2.4 cv=WYwBqkhX c=1 sm=1 tr=0 ts=694545dd cx=c_pps a=0uOsjrqzRL749jD1oC5vDA==: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=mQ_c8vxmzFEMiUWkPHU9:22 a=cvBusfyB2V15izCimMoJ:22 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 lowpriorityscore=0 bulkscore=0 impostorscore=0 priorityscore=1501 clxscore=1015 phishscore=0 adultscore=0 suspectscore=0 spamscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2512120000 definitions=main-2512190104 On 12/19/2025 6:33 PM, Suzuki K Poulose wrote: > On 19/12/2025 10:04, 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       | 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/Documentation/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 >   Description: >>           (RW) Configure the CMB/MCMB channel mode for all enabled ports. >>           Value 0 means raw channel mapping mode. Value 1 means >> channel pair marking mode. >> + >> +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. >> diff --git a/drivers/hwtracing/coresight/coresight-tpda.c b/drivers/ >> hwtracing/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 *dev, >>       return ret; >>   } >> +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_global_cr_attrs[] = { >>       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[] = { >>       NULL, >>   }; >> +static struct attribute *tpda_attrs[] = { >> +    &dev_attr_port_flush_req.attr, >> +    NULL, >> +}; >> + > > But why ? Why can't this be a part of the tpda_global_cr_attrs[] ? > For that matter, why is tpda_global_cr_attrs named as such and why not > tpda_attrs ? > will move all attributes to tpda_attrs[]. Thanks, Jie > Suzuki > >>   static struct attribute_group tpda_global_cr_attr_grp = { >>       .attrs    = tpda_global_cr_attrs, >>       .name    = "global_cr", >>   }; >> +static struct attribute_group tpda_attr_grp = { >> +    .attrs    = tpda_attrs, >> +}; >> + >>   static const struct attribute_group *tpda_attr_grps[] = { >>       &tpda_global_cr_attr_grp, >> +    &tpda_attr_grp, >>       NULL, >>   }; >> diff --git a/drivers/hwtracing/coresight/coresight-tpda.h b/drivers/ >> hwtracing/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) >>   /* Cross trigger Global (all ports) flush request bit */ >>   #define TPDA_CR_FLREQ        BIT(0) >> >