<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/include/linux/coresight.h, branch v6.18.21</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.18.21</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.18.21'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2025-12-18T13:02:56+00:00</updated>
<entry>
<title>coresight: Change device mode to atomic type</title>
<updated>2025-12-18T13:02:56+00:00</updated>
<author>
<name>Leo Yan</name>
<email>leo.yan@arm.com</email>
</author>
<published>2025-11-11T18:58:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4305e94270fab6cdba356e446b816acaa854526f'/>
<id>urn:sha1:4305e94270fab6cdba356e446b816acaa854526f</id>
<content type='text'>
[ Upstream commit 693d1eaca940f277af24c74873ef2313816ff444 ]

The device mode is defined as local type. This type cannot promise
SMP-safe access.

Change to atomic type and impose relax ordering, which ensures the
SMP-safe synchronisation and the ordering between the mode setting and
relevant operations.

Fixes: 22fd532eaa0c ("coresight: etm3x: adding operation mode for etm_enable()")
Reviewed-by: Mike Leach &lt;mike.leach@linaro.org&gt;
Tested-by: James Clark &lt;james.clark@linaro.org&gt;
Signed-off-by: Leo Yan &lt;leo.yan@arm.com&gt;
Signed-off-by: Suzuki K Poulose &lt;suzuki.poulose@arm.com&gt;
Link: https://lore.kernel.org/r/20251111-arm_coresight_power_management_fix-v6-1-f55553b6c8b3@arm.com
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>coresight: tmc: add the handle of the event to the path</title>
<updated>2025-12-18T13:02:54+00:00</updated>
<author>
<name>Carl Worth</name>
<email>carl@os.amperecomputing.com</email>
</author>
<published>2025-09-25T10:42:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d0c9effd82f2c19b92acd07d357fac5f392d549a'/>
<id>urn:sha1:d0c9effd82f2c19b92acd07d357fac5f392d549a</id>
<content type='text'>
[ Upstream commit aaa5abcc9d44d2c8484f779ab46d242d774cabcb ]

The handle is essential for retrieving the AUX_EVENT of each CPU and is
required in perf mode. It has been added to the coresight_path so that
dependent devices can access it from the path when needed.

The existing bug can be reproduced with:
perf record -e cs_etm//k -C 0-9 dd if=/dev/zero of=/dev/null

Showing an oops as follows:
Unable to handle kernel paging request at virtual address 000f6e84934ed19e

Call trace:
 tmc_etr_get_buffer+0x30/0x80 [coresight_tmc] (P)
 catu_enable_hw+0xbc/0x3d0 [coresight_catu]
 catu_enable+0x70/0xe0 [coresight_catu]
 coresight_enable_path+0xb0/0x258 [coresight]

Fixes: 080ee83cc361 ("Coresight: Change functions to accept the coresight_path")
Signed-off-by: Carl Worth &lt;carl@os.amperecomputing.com&gt;
Reviewed-by: Leo Yan &lt;leo.yan@arm.com&gt;
Co-developed-by: Jie Gan &lt;jie.gan@oss.qualcomm.com&gt;
Signed-off-by: Jie Gan &lt;jie.gan@oss.qualcomm.com&gt;
Signed-off-by: Suzuki K Poulose &lt;suzuki.poulose@arm.com&gt;
Link: https://lore.kernel.org/r/20250925-fix_helper_data-v2-1-edd8a07c1646@oss.qualcomm.com
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>coresight: Consolidate clock enabling</title>
<updated>2025-09-23T13:14:12+00:00</updated>
<author>
<name>Leo Yan</name>
<email>leo.yan@arm.com</email>
</author>
<published>2025-07-31T12:23:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=fbe7514a7912959e384acf108931ac1bfbb16466'/>
<id>urn:sha1:fbe7514a7912959e384acf108931ac1bfbb16466</id>
<content type='text'>
CoreSight drivers enable pclk and atclk conditionally. For example,
pclk is only enabled in the static probe, while atclk is an optional
clock that it is enabled for both dynamic and static probes, if it is
present. In the current CoreSight drivers, these two clocks are
initialized separately.  This causes complex and duplicate codes.

CoreSight drivers are refined so that clocks are initialized in one go.
For this purpose, this commit renames coresight_get_enable_apb_pclk() to
coresight_get_enable_clocks() and encapsulates clock initialization
logic:

 - If a clock is initialized successfully, its clock pointer is assigned
   to the double pointer passed as an argument.
 - For ACPI devices, clocks are controlled by firmware, directly bail
   out.
 - Skip enabling pclk for an AMBA device.
 - If atclk is not found, the corresponding double pointer is set to
   NULL. The function returns Success (0) to guide callers can proceed
   with no error.
 - Otherwise, an error number is returned for failures.

The function became complex, move it from the header to the CoreSight
core layer and the symbol is exported. Added comments for recording
details.

Suggested-by: Suzuki K Poulose &lt;suzuki.poulose@arm.com&gt;
Reviewed-by: Anshuman Khandual &lt;anshuman.khandual@arm.com&gt;
Reviewed-by: Yeoreum Yun &lt;yeoreum.yun@arm.com&gt;
Tested-by: James Clark &lt;james.clark@linaro.org&gt;
Signed-off-by: Leo Yan &lt;leo.yan@arm.com&gt;
Signed-off-by: Suzuki K Poulose &lt;suzuki.poulose@arm.com&gt;
Link: https://lore.kernel.org/r/20250731-arm_cs_fix_clock_v4-v6-7-1dfe10bb3f6f@arm.com
</content>
</entry>
<entry>
<title>coresight: Avoid enable programming clock duplicately</title>
<updated>2025-09-23T13:14:12+00:00</updated>
<author>
<name>Leo Yan</name>
<email>leo.yan@arm.com</email>
</author>
<published>2025-07-31T12:23:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d091c6312561821f216ced63a7ad17c946b6d335'/>
<id>urn:sha1:d091c6312561821f216ced63a7ad17c946b6d335</id>
<content type='text'>
The programming clock is enabled by AMBA bus driver before a dynamic
probe. As a result, a CoreSight driver may redundantly enable the same
clock.

To avoid this, add a check for device type and skip enabling the
programming clock for AMBA devices. The returned NULL pointer will be
tolerated by the drivers.

Fixes: 73d779a03a76 ("coresight: etm4x: Change etm4_platform_driver driver for MMIO devices")
Reviewed-by: Anshuman Khandual &lt;anshuman.khandual@arm.com&gt;
Reviewed-by: Yeoreum Yun &lt;yeoreum.yun@arm.com&gt;
Tested-by: James Clark &lt;james.clark@linaro.org&gt;
Signed-off-by: Leo Yan &lt;leo.yan@arm.com&gt;
Signed-off-by: Suzuki K Poulose &lt;suzuki.poulose@arm.com&gt;
Link: https://lore.kernel.org/r/20250731-arm_cs_fix_clock_v4-v6-6-1dfe10bb3f6f@arm.com
</content>
</entry>
<entry>
<title>coresight: Appropriately disable programming clocks</title>
<updated>2025-09-23T13:14:12+00:00</updated>
<author>
<name>Leo Yan</name>
<email>leo.yan@arm.com</email>
</author>
<published>2025-07-31T12:23:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1abc1b212effe920f4729353880c8e03f1d76b4b'/>
<id>urn:sha1:1abc1b212effe920f4729353880c8e03f1d76b4b</id>
<content type='text'>
Some CoreSight components have programming clocks (pclk) and are enabled
using clk_get() and clk_prepare_enable().  However, in many cases, these
clocks are not disabled when modules exit and only released by clk_put().

To fix the issue, this commit refactors programming clock by replacing
clk_get() and clk_prepare_enable() with devm_clk_get_optional_enabled()
for enabling APB clock. If the "apb_pclk" clock is not found, a NULL
pointer is returned, and the function proceeds to attempt enabling the
"apb" clock.

Since ACPI platforms rely on firmware to manage clocks, returning a NULL
pointer in this case leaves clock management to the firmware rather than
the driver. This effectively avoids a clock imbalance issue during
module removal - where the clock could be disabled twice: once during
the ACPI runtime suspend and again during the devm resource release.

Callers are updated to reuse the returned error value.

With the change, programming clocks are managed as resources in driver
model layer, allowing clock cleanup to be handled automatically.  As a
result, manual cleanup operations are no longer needed and are removed
from the Coresight drivers.

Fixes: 73d779a03a76 ("coresight: etm4x: Change etm4_platform_driver driver for MMIO devices")
Reviewed-by: Yeoreum Yun &lt;yeoreum.yun@arm.com&gt;
Tested-by: James Clark &lt;james.clark@linaro.org&gt;
Signed-off-by: Leo Yan &lt;leo.yan@arm.com&gt;
Signed-off-by: Suzuki K Poulose &lt;suzuki.poulose@arm.com&gt;
Link: https://lore.kernel.org/r/20250731-arm_cs_fix_clock_v4-v6-4-1dfe10bb3f6f@arm.com
</content>
</entry>
<entry>
<title>coresight: Introduce pause and resume APIs for source</title>
<updated>2025-05-14T10:56:17+00:00</updated>
<author>
<name>Leo Yan</name>
<email>leo.yan@arm.com</email>
</author>
<published>2025-04-01T18:07:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5fa96c83b81e50833274f3b450ee9a8c0b2172bc'/>
<id>urn:sha1:5fa96c83b81e50833274f3b450ee9a8c0b2172bc</id>
<content type='text'>
Introduce APIs for pausing and resuming trace source and export as GPL
symbols.

Signed-off-by: Leo Yan &lt;leo.yan@arm.com&gt;
Reviewed-by: Mike Leach &lt;mike.leach@linaro.org&gt;
Reviewed-by: James Clark &lt;james.clark@linaro.org&gt;
Signed-off-by: Suzuki K Poulose &lt;suzuki.poulose@arm.com&gt;
Link: https://lore.kernel.org/r/20250401180708.385396-3-leo.yan@arm.com
</content>
</entry>
<entry>
<title>coresight: Remove extern from function declarations</title>
<updated>2025-04-30T13:58:19+00:00</updated>
<author>
<name>James Clark</name>
<email>james.clark@linaro.org</email>
</author>
<published>2025-03-25T11:58:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e6e6b692865d333d79d25c761c53b19e73e9653f'/>
<id>urn:sha1:e6e6b692865d333d79d25c761c53b19e73e9653f</id>
<content type='text'>
Function declarations are extern by default so remove the extra noise
and inconsistency.

Reviewed-by: Leo Yan &lt;leo.yan@arm.com&gt;
Reviewed-by: Yeoreum Yun &lt;yeoreum.yun@arm.com&gt;
Signed-off-by: James Clark &lt;james.clark@linaro.org&gt;
Signed-off-by: Suzuki K Poulose &lt;suzuki.poulose@arm.com&gt;
Link: https://lore.kernel.org/r/20250325-james-coresight-claim-tags-v4-7-dfbd3822b2e5@linaro.org
</content>
</entry>
<entry>
<title>coresight: Convert tag clear function to take a struct csdev_access</title>
<updated>2025-04-30T13:58:18+00:00</updated>
<author>
<name>James Clark</name>
<email>james.clark@linaro.org</email>
</author>
<published>2025-03-25T11:58:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=fc7fed6f77f94f2fd9a7557020503e146eb0ce38'/>
<id>urn:sha1:fc7fed6f77f94f2fd9a7557020503e146eb0ce38</id>
<content type='text'>
The self hosted claim tag will be reset on device probe in a later
commit. We'll want to do this before coresight_register() is called so
won't have a coresight_device and have to use csdev_access instead.

Also make them public and create locked and unlocked versions for
later use.

These look functions look like they set the whole tags register as one
value, but they only set and clear the self hosted bit using a SET/CLR
bits mechanism so also rename the functions to reflect this better.

Reviewed-by: Leo Yan &lt;leo.yan@arm.com&gt;
Reviewed-by: Yeoreum Yun &lt;yeoreum.yun@arm.com&gt;
Signed-off-by: James Clark &lt;james.clark@linaro.org&gt;
Signed-off-by: Suzuki K Poulose &lt;suzuki.poulose@arm.com&gt;
Link: https://lore.kernel.org/r/20250325-james-coresight-claim-tags-v4-1-dfbd3822b2e5@linaro.org
</content>
</entry>
<entry>
<title>coresight: Fixes device's owner field for registered using coresight_init_driver()</title>
<updated>2025-04-29T17:47:37+00:00</updated>
<author>
<name>Junhao He</name>
<email>hejunhao3@huawei.com</email>
</author>
<published>2024-09-18T03:53:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9f52aecc952ddf307571517d5c91136c8c4e87c9'/>
<id>urn:sha1:9f52aecc952ddf307571517d5c91136c8c4e87c9</id>
<content type='text'>
The coresight_init_driver() of the coresight-core module is called from
the sub coresgiht device (such as tmc/stm/funnle/...) module. It calls
amba_driver_register() and Platform_driver_register(), which are macro
functions that use the coresight-core's module to initialize the caller's
owner field.  Therefore, when the sub coresight device calls
coresight_init_driver(), an incorrect THIS_MODULE value is captured.

The sub coesgiht modules can be removed while their callbacks are
running, resulting in a general protection failure.

Add module parameter to coresight_init_driver() so can be called
with the module of the callback.

Fixes: 075b7cd7ad7d ("coresight: Add helpers registering/removing both AMBA and platform drivers")
Signed-off-by: Junhao He &lt;hejunhao3@huawei.com&gt;
Signed-off-by: Suzuki K Poulose &lt;suzuki.poulose@arm.com&gt;
Link: https://lore.kernel.org/r/20240918035327.9710-1-hejunhao3@huawei.com
</content>
</entry>
<entry>
<title>coresight: change coresight_trace_id_map's lock type to raw_spinlock_t</title>
<updated>2025-03-10T10:40:25+00:00</updated>
<author>
<name>Yeoreum Yun</name>
<email>yeoreum.yun@arm.com</email>
</author>
<published>2025-03-06T12:11:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4cf364ca57d851e192ce02e98d314d22fa514895'/>
<id>urn:sha1:4cf364ca57d851e192ce02e98d314d22fa514895</id>
<content type='text'>
coresight_trace_id_map-&gt;lock can be acquired while coresight devices'
drvdata_lock.

But the drvdata_lock can be raw_spinlock_t (i.e) coresight-etm4x.

To address this, change type of coresight_trace_id_map-&gt;lock to
raw_spinlock_t

Signed-off-by: Yeoreum Yun &lt;yeoreum.yun@arm.com&gt;
Reviewed-by: James Clark &lt;james.clark@linaro.org&gt;
Reviewed-by: Mike Leach &lt;mike.leach@linaro.org&gt;
Signed-off-by: Suzuki K Poulose &lt;suzuki.poulose@arm.com&gt;
Link: https://lore.kernel.org/r/20250306121110.1647948-4-yeoreum.yun@arm.com
</content>
</entry>
</feed>
