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 F18B13C0A1F for ; Tue, 28 Jul 2026 10:02:18 +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=1785232940; cv=none; b=oVPL/hftzFrBvG8+7COPmDuTQLHGA0n/OvHFI/g0TB+4FtJaePxsiiCdk7F0e0xJkR4O3KOqWDt0ZbUQmipvSltxV5vFF+B48ohvKTy1HXXlgX2rK3MZRSCeo2GJ8mILOAzesYQmY2ihCQc0QavBZthVPu6Z6l235+qqhNX6D+E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785232940; c=relaxed/simple; bh=sJecNHnhg7jcEdgs+KSTOJ8mVsaS3TK4Z1L7xVB22B8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=jCyo4W+z2Cf2/zm18W5ogDqjF5FsUYi5mi8kVxRRsUDT5E53YC1c3w1ENhJPUCn2TIEVYfec1urQDwCepEVz99llbKfiw6gUdKiAcRGTtRSOJ/nLEmP/hr69c6OYVBvvPcsGUvBsXRUk6DVWUGoj91lJM04mWLpZoUN8zcodj9c= 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=pVighgtt; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Wv7gWqTK; 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="pVighgtt"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Wv7gWqTK" 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 66S81xxS2071291 for ; Tue, 28 Jul 2026 10:02:18 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= /q8BVZ8Oyy0TLea4iTe37ZB7CqCxY1Gat0C1aMgrasI=; b=pVighgttaIihWzPh XX0EF1NA/5+Fb1M3SfVT7/7RnpF+UbI7tFc6TwhL6GJpI7IYwTS2p7p4G3LrFxhR V9cxLbgmM11GPc9TiIzHQVzA9jLnf3jmvvlVbHPb/+TphOe/xppKPLrBQl0k3MYh kUiml7kXSH71QR1Oz/BcdECFJk8/oaF+e36Esh6/XbJI1NwVN+PLDF+zyE9Vibbo sdB2VK0g0NHZOgIYEdNU1Q2hg0ANtJXSe9PNH1WjTINiCX5PmTc/It7XOgH6tGN6 NvNb6sACn8nUVdoK5eA0TTTGxJaIoaACixWXhhM9B0VXpwshIf7TIWWliL9ewpoY sMjClQ== Received: from mail-pj1-f72.google.com (mail-pj1-f72.google.com [209.85.216.72]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fpqxjgn97-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 28 Jul 2026 10:02:18 +0000 (GMT) Received: by mail-pj1-f72.google.com with SMTP id 98e67ed59e1d1-38e667368f0so6004917a91.2 for ; Tue, 28 Jul 2026 03:02:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1785232937; x=1785837737; darn=vger.kernel.org; h=content-transfer-encoding:content-type: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 :content-type; bh=/q8BVZ8Oyy0TLea4iTe37ZB7CqCxY1Gat0C1aMgrasI=; b=Wv7gWqTK+oaX+gKccC2VxPUs/aiMffvpM/pZYhpYCDdkVwY7xxYfylX2sYI5Neamq1 S+k/+PhbLmTbhw4w4RUFiQp2IsJMOBGJz+aZ8Wgwp3YzYesHnqUrueH9DOA3q+TuB1HZ 4lBzoJySVGzl2filNwog11O9Aml4vPdzERrLjtIuS64BDGmQXMUT98P08jwzhCUthz2I v7f3jrg2ckHiuqn9vothfI957+wnhnBR81s/HDZiU/hh08Ryk72sAp4ksFTd9c53WCqD t5ukTheju6jVXElx1O0aM3wdY/7Fg+6CsVl5DUHfL5aXx3gMxYNLoIOyBUonSeBtAM7B OhAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785232937; x=1785837737; h=content-transfer-encoding:content-type: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:content-type; bh=/q8BVZ8Oyy0TLea4iTe37ZB7CqCxY1Gat0C1aMgrasI=; b=U5jaTSTz4O9U320ToVtigLI5/IIS1KvhxX0aFxrqnm2p88y1xGC4JIgnin70C9cMFv MIoxa7Rss3ew0hAgO+NQrQ3G63N9ijNE2BJQ6wyj2W71tvY51iYxtfMNollWtX1XkNoN YWoXRIaHaYv1fePHE75VmsKBrU4T9SD/qg+Tp/d+NFpHr/xBIZCe41vSxqurteNUrc5f oP+blegMJYfESqbpjc9RqVZCYOOSqyXF8vO6Ucm8huK3NWpf6DYjZyenDbcS4w/vgnU9 9NNNdx9xlf0xwYy5+h7KWQTYnVXaUCJ29UoJds+Ngx952eleFyFllASXl628YTNuedIl zQzQ== X-Forwarded-Encrypted: i=1; AHgh+RozRZN4WyTaCYL3LrKKffQG30HScPsJlEblBe+JuaH7/M9pvzV4dHG2ipK+MU9iXG9wpARM0m9PsHNW@vger.kernel.org X-Gm-Message-State: AOJu0YxTeZVlJGC/u0Qpz/YyOKjTcHdAlIO1mdwZEQnatGZv1a2X+uuY PZ++3F/qxnWfL0UDhDUWvnvAYdfVwK6uKEua31cSqT/vIVwfLd4pS3Pjhb6fdDSILhgUmyq9XoZ BJBY7Ro0BrIDkQYPntZoi3eBk+qplBIWuyj053kgAJWBT7OSdCW0DxJMXxPJZUiSU X-Gm-Gg: AR+sD1212UilfJKv4q0c+vO9QjpVc5tDbcGqumIgWWC3a1HZMnObVuOAPt3flbZqYgF t59ixB/f78GiIfj52ZM0yxk2C6GTSMr7HswnugJXBCUujYQonmSij6jCG+Sce5CI+LZ3Tl/IOp4 iYeahN5B2kztwcH8JTppMb6KUcmvrgTuGKwfyNRNJzFhUWmJGzggC4kdRZVLMfwIHrqSY7u8RlX +o/hTF4jhc7Fa0dME9I7SJF2/zClJHiAxUbYA5PPiqzHHVi4pRzGCPO3ahOVgdDhQjQTlvaVXs6 VvYS2lPqKeqXj+jNQrq4Hvp2eGflLuxNa8yka5IRS6hhuGYChHoAxxGCwVKqVA6LpyUp1zA/iJN CsTTkEnabbacta2XHYlpi X-Received: by 2002:a17:90b:2247:b0:38f:c71:2342 with SMTP id 98e67ed59e1d1-38f6a484f9fmr1766557a91.31.1785232937179; Tue, 28 Jul 2026 03:02:17 -0700 (PDT) X-Received: by 2002:a17:90b:2247:b0:38f:c71:2342 with SMTP id 98e67ed59e1d1-38f6a484f9fmr1766504a91.31.1785232936573; Tue, 28 Jul 2026 03:02:16 -0700 (PDT) Received: from [10.64.68.243] ([114.94.8.21]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-38f08b06b23sm4646061a91.4.2026.07.28.03.02.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 28 Jul 2026 03:02:16 -0700 (PDT) Message-ID: Date: Tue, 28 Jul 2026 18:02:08 +0800 Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v19 0/7] coresight: ctcu: Enable byte-cntr function for TMC ETR To: Suzuki K Poulose , Mike Leach , James Clark , Leo Yan , Alexander Shishkin , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Tingwei Zhang , Bjorn Andersson , Konrad Dybcio , Yuanfang Zhang , Mao Jinlong 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, Konrad Dybcio , Krzysztof Kozlowski References: <20260625-enable-byte-cntr-for-ctcu-v19-0-8fbbf22e8381@oss.qualcomm.com> Content-Language: en-US From: Jie Gan In-Reply-To: <20260625-enable-byte-cntr-for-ctcu-v19-0-8fbbf22e8381@oss.qualcomm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Proofpoint-GUID: FK5QPxMTLL0bOW5zvm1egLZMsOEV9qbc X-Authority-Analysis: v=2.4 cv=MORQXsZl c=1 sm=1 tr=0 ts=6a687e2a cx=c_pps a=RP+M6JBNLl+fLTcSJhASfg==:117 a=Uz3yg00KUFJ2y2WijEJ4bw==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_K5XuSEh1TEqbUxoQ0s3:22 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=COk6AnOGAAAA:8 a=fIDE6rAyyWgLbRZLtlIA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=iS9zxrgQBfv6-_F4QbHw:22 a=TjNXssC_j7lpFel5tvFf:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwNzI4MDA4NyBTYWx0ZWRfXy1SsD3EXRFTo 5DSa2hHxwDV/FOO27ykdVkm1aMTgz9HGT+CyYRfrHrm+P9LlTMG/MnyqXcmUoLIPSlB1wpMch77 IczztUsLS+Uh5sj7Ni+8oocTZ6hnV4w= X-Proofpoint-ORIG-GUID: FK5QPxMTLL0bOW5zvm1egLZMsOEV9qbc X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzI4MDA4NyBTYWx0ZWRfX2pRI95Ypnj88 kcSCXzPgThzwY5hBOC7QKoLTl8e751WU3YWP8/0ZQlrITeWRtNzgXqNFIJv56EnDnaRp0d0XmdP n1PEeVVaMsWc8lLTKrDPUCvJWHhIqwfu97BXNRVtSkiTe8XduizGfiZJgMN+X5M3hinTDRcx7Vg vViP14oi9QMjPzxh4S2HKEUrspC26iISN5mPdmGQlY1QH3wQEAvuOrcbjfZU3UXxiwLYdMtpMoy UifDu7tZ5Nr3mifR9KNNPW4OegEKzYj/OHQM+GOALjLNaHRRN5dd0OZO4OwTQOBoAxBf0y+k6vi VjV1Fwc5HtVfgpUiVxkyk2l192cq1h5NcsddOmJGJ0npCKI1UH9LJVOEW4V0RCkMyTkhqac1Eis jyWM8r+LEsK/vcz11SP1wRQwtd7m6QXrmp0+DtbCtNRqhpu2X6HAK+eX3H/5ji8QUdZEFAHj/Mo 3GbwMzoGlJMTnE/NIjw== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-28_02,2026-07-27_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 clxscore=1015 suspectscore=0 impostorscore=0 bulkscore=0 malwarescore=0 priorityscore=1501 spamscore=0 phishscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607280087 On 6/25/2026 6:45 PM, Jie Gan wrote: > The byte-cntr function provided by the CTCU device is used to count the > trace data entering the ETR. An interrupt is triggered if the data size > exceeds the threshold set in the BYTECNTRVAL register. The interrupt > handler counts the number of triggered interruptions. > > Based on this concept, the irq_cnt can be used to determine whether > the etr_buf is full. The ETR device will be disabled when the active > etr_buf is nearly full or a timeout occurs. The nearly full buffer will > be switched to background after synced. A new buffer will be picked from > the etr_buf_list, then restart the ETR device. > > The byte-cntr reading functions can access data from the synced and > deactivated buffer, transferring trace data from the etr_buf to userspace > without stopping the ETR device. > > The byte-cntr read operation has integrated with the file node tmc_etr, > for example: > /dev/tmc_etr0 > /dev/tmc_etr1 > > There are two scenarios for the tmc_etr file node with byte-cntr function: > 1. BYTECNTRVAL register is configured and byte-cntr is enabled -> byte-cntr read > 2. BYTECNTRVAL register is reset or byte-cntr is disabled -> original behavior > > Shell commands to enable byte-cntr reading for etr0: > echo 1 > /sys/bus/coresight/devices/ctcu0/irq_enabled0 > echo 1 > /sys/bus/coresight/devices/tmc_etr0/enable_sink > echo 1 > /sys/bus/coresight/devices/etm0/enable_source > cat /dev/tmc_etr0 > > Reset the BYTECNTR register for etr0: > echo 0 > /sys/bus/coresight/devices/ctcu0/irq_enabled0 > Gentle ping. Appreciate your time in reviewing this patch series. > --- > Changes in v19: > 1. coresight: tmc: add create/clean functions for etr_buf_list: > - Simplified the kernel-doc "Locking:" note on tmc_create_etr_buf_list() > and tmc_clean_etr_buf_list() to state only the required contract > (caller must guarantee exclusive access to drvdata->etr_buf_list), > dropping the over-specific call-path details. > - Lock the required code block in create/clean functions. > 2. coresight: ctcu: enable byte-cntr for TMC ETR devices: > - Fixed a stale reading-state / double-free when irq_enabled was > cleared between prepare and unprepare: the byte-cntr read_unprepare > would return an error and tmc_read_unprepare_etr() would fall back > to the normal unprepare path, freeing drvdata->sysfs_buf while it > was still owned by the byte-cntr buffer list. irq_enabled_store() > now returns -EBUSY while byte_cntr_data->reading is set, so the flag > can no longer change mid-session, and tmc_read_unprepare_byte_cntr() > additionally guards on byte_cntr_data->reading. > - Moved enable_irq_wake()/disable_irq_wake() out of the > byte_cntr_data->spin_lock critical section in > tmc_read_prepare_byte_cntr()/tmc_read_unprepare_byte_cntr(). > irq_set_irq_wake() may sleep on slow-bus irqchips, so it must not > be called under a raw spinlock. The threshold IRQ is already > disabled by the in-lock register write before disable_irq_wake() on > the unprepare path, so no wake event can race in the gap. > - Added a comment on the byte_cntr_sysfs_ops pointer documenting the > single-CTCU-instance-per-system assumption. > - Link to v18: https://lore.kernel.org/r/20260507-enable-byte-cntr-for-ctcu-v18-0-2b2d590463a3@oss.qualcomm.com > > Changes in v18: > 1. add a NULL check for the in_conns instance in patch 1. > 2. fix a bug in patch 2: the tmc_alloc_etr_buf never return NULL and the > previous check for the return value is incorrect. > 3. add more kernel_doc description for tmc_clean_etr_buf_list function > in patch 2 > - Link to v17: https://lore.kernel.org/r/20260421-enable-byte-cntr-for-ctcu-v17-0-9cf36ff55fc0@oss.qualcomm.com > > Changes in v17: > 1. fix race issue during allocat buffer. > 2. fix user after free issue observed when remove module. > - Link to v16: https://lore.kernel.org/r/20260323-enable-byte-cntr-for-ctcu-v16-0-7a413d211b8d@oss.qualcomm.com > > Changes in v16: > 1. Remove lock/unlock processes in patch "coresight: tmc: add create/clean > functions for etr_buf_list" because we are allocating/freeing memory. > - Link to v15: https://lore.kernel.org/r/20260313-enable-byte-cntr-for-ctcu-v15-0-1777f14ed319@oss.qualcomm.com > > Changes in v15: > 1. add lockdep_assert_held in patch "coresight: tmc: add create/clean > functions for etr_buf_list" > 2. optimize tmc_clean_etr_buf_list function > 3. optimize the patch "enable byte-cntr for TMC ETR devices" according > to Suzuki's comments > - call byte_cntr_sysfs_ops from etr_sysfs_ops > - optimize the lock usage in all functions > - remove the buf_node parameter in etr_drvdata, move it to > byte_cntr_data > - move the tmc_reset_sysfs_buf function to tmc-etr.c > - add a read flag to struct etr_buf_node to allow updating pos while > traversing etr_buf_list during data reads. > Link to v14: https://lore.kernel.org/r/20260309-enable-byte-cntr-for-ctcu-v14-0-c08823e5a8e6@oss.qualcomm.com > > Changes in V14: > 1. Drop the patch: integrate byte-cntr's sysfs_ops with tmc sysfs file_ops > 2. Replace tmc_sysfs_ops with byte_cntr_sysfs_ops in byte_cntr_start > function and restore etr_sysfs_ops in byte_cntr_unprepare function. > 3. Remove redundant checks in byte‑cntr functions. > Link to V13: https://lore.kernel.org/all/20260223-enable-byte-cntr-for-ctcu-v13-0-9cb44178b250@oss.qualcomm.com/ > > Changes in v13: > 1. initilize the byte_cntr_data->raw_spin_lock before using. > 2. replace kzalloc with kzalloc_obj. > Link to V12: https://lore.kernel.org/all/20260203-enable-byte-cntr-for-ctcu-v12-0-7bf81b86b70e@oss.qualcomm.com/ > > Changes in v12: > 1. Add a new function for retrieving the CTCU's coresight_dev instead of > refactor the existing function. > Link to v11: https://lore.kernel.org/r/20260126-enable-byte-cntr-for-ctcu-v11-0-c0af66ba15cf@oss.qualcomm.com > > Changes in v11: > 1. Correct the description in patch1 for the function coresight_get_in_port. > 2. Renaming the sysfs_ops to tmc_sysfs_ops per Suzuki's suggestion. > Link to v10: https://lore.kernel.org/r/20260122-enable-byte-cntr-for-ctcu-v10-0-22978e3c169f@oss.qualcomm.com > > Changes in v10: > 1. fix a free memory issue that is reported by robot for patch 2. > Link to v9: https://lore.kernel.org/r/20251224-enable-byte-cntr-for-ctcu-v9-0-886c4496fed4@oss.qualcomm.com > > Changes in v9: > 1. Drop the patch: add a new API to retrieve the helper device > 2. Add a new patch to refactor the tmc_etr_get_catu_device function, > making it generic to support all types of helper devices associated with ETR. > 3. Optimizing the code for creating irq_threshold sysfs node. > 4. Remove interrupt-name property and obtain the IRQ based on the > in-port number. > Link to v8: https://lore.kernel.org/r/20251211-enable-byte-cntr-for-ctcu-v8-0-3e12ff313191@oss.qualcomm.com > > Changes in V8: > 1. Optimizing the patch 1 and patch 2 according to Suzuki's comments. > 2. Combine the patch 3 and patch 4 together. > 3. Rename the interrupt-name to prevent confusion, for example:etr0->etrirq0. > Link to V7 - https://lore.kernel.org/all/20251013-enable-byte-cntr-for-ctcu-v7-0-e1e8f41e15dd@oss.qualcomm.com/ > > Changes in V7: > 1. rebased on tag next-20251010 > 2. updated info for sysfs node document > Link to V6 - https://lore.kernel.org/all/20250908-enable-byte-cntr-for-tmc-v6-0-1db9e621441a@oss.qualcomm.com/ > > Changes in V6: > 1. rebased on next-20250905. > 2. fixed the issue that the dtsi file has re-named from sa8775p.dtsi to > lemans.dtsi. > 3. fixed some minor issues about comments. > Link to V5 - https://lore.kernel.org/all/20250812083731.549-1-jie.gan@oss.qualcomm.com/ > > Changes in V5: > 1. Add Mike's reviewed-by tag for patchset 1,2,5. > 2. Remove the function pointer added to helper_ops according to Mike's > comment, it also results the patchset has been removed. > 3. Optimizing the paired create/clean functions for etr_buf_list. > 4. Remove the unneeded parameter "reading" from the etr_buf_node. > Link to V4 - https://lore.kernel.org/all/20250725100806.1157-1-jie.gan@oss.qualcomm.com/ > > Changes in V4: > 1. Rename the function to coresight_get_in_port_dest regarding to Mike's > comment (patch 1/10). > 2. Add lock to protect the connections regarding to Mike's comment > (patch 2/10). > 3. Move all byte-cntr functions to coresight-ctcu-byte-cntr file. > 4. Add tmc_read_ops to wrap all read operations for TMC device. > 5. Add a function in helper_ops to check whether the byte-cntr is > enabkled. > 6. Call byte-cntr's read_ops if byte-cntr is enabled when reading data > from the sysfs node. > Link to V3 resend - https://lore.kernel.org/all/20250714063109.591-1-jie.gan@oss.qualcomm.com/ > > Changes in V3 resend: > 1. rebased on next-20250711. > Link to V3 - https://lore.kernel.org/all/20250624060438.7469-1-jie.gan@oss.qualcomm.com/ > > Changes in V3: > 1. The previous solution has been deprecated. > 2. Add a etr_buf_list to manage allcated etr buffers. > 3. Add a logic to switch buffer for ETR. > 4. Add read functions to read trace data from synced etr buffer. > Link to V2 - https://lore.kernel.org/all/20250410013330.3609482-1-jie.gan@oss.qualcomm.com/ > > Changes in V2: > 1. Removed the independent file node /dev/byte_cntr. > 2. Integrated the byte-cntr's file operations with current ETR file > node. > 3. Optimized the driver code of the CTCU that associated with byte-cntr. > 4. Add kernel document for the export API tmc_etr_get_rwp_offset. > 5. Optimized the way to read the rwp_offset according to Mike's > suggestion. > 6. Removed the dependency of the dts patch. > Link to V1 - https://lore.kernel.org/all/20250310090407.2069489-1-quic_jiegan@quicinc.com/ > > Signed-off-by: Jie Gan > > --- > Jie Gan (7): > coresight: core: refactor ctcu_get_active_port and make it generic > coresight: tmc: add create/clean functions for etr_buf_list > coresight: tmc: introduce tmc_sysfs_ops to wrap sysfs read operations > coresight: etr: add a new function to retrieve the CTCU device > dt-bindings: arm: add an interrupt property for Coresight CTCU > coresight: ctcu: enable byte-cntr for TMC ETR devices > arm64: dts: qcom: lemans: add interrupts to CTCU device > > .../ABI/testing/sysfs-bus-coresight-devices-ctcu | 9 + > .../bindings/arm/qcom,coresight-ctcu.yaml | 10 + > arch/arm64/boot/dts/qcom/lemans.dtsi | 3 + > drivers/hwtracing/coresight/Makefile | 2 +- > drivers/hwtracing/coresight/coresight-core.c | 27 ++ > .../hwtracing/coresight/coresight-ctcu-byte-cntr.c | 327 +++++++++++++++++++++ > drivers/hwtracing/coresight/coresight-ctcu-core.c | 146 +++++++-- > drivers/hwtracing/coresight/coresight-ctcu.h | 81 ++++- > drivers/hwtracing/coresight/coresight-priv.h | 2 + > drivers/hwtracing/coresight/coresight-tmc-core.c | 55 ++-- > drivers/hwtracing/coresight/coresight-tmc-etr.c | 265 ++++++++++++++++- > drivers/hwtracing/coresight/coresight-tmc.h | 42 +++ > 12 files changed, 896 insertions(+), 73 deletions(-) > --- > base-commit: 4e5dfb7c84012007c3c7061126491bbc92d71bf1 > change-id: 20260309-enable-byte-cntr-for-ctcu-ff86e6198b7f > > Best regards,