Hi Sean,
On Thu, Sep 11, 2025 at 11:33:15AM -0400, Sean Anderson wrote:
> coresight_panic_cb is called with interrupts disabled during panics.
> However, bus_for_each_dev calls bus_to_subsys which takes
> bus_kset->list_lock without disabling IRQs. This will cause a deadlock
> if a panic occurs while one of the other coresight functions that uses
> bus_for_each_dev is running.
The decription is a bit misleading. Even when IRQ is disabled, if an
exception happens, a CPU still can be trapped for handling kernel panic.
> Maintain a separate list of coresight devices to access during a panic.
Rather than maintaining a separate list and introducing a new spinlock,
I would argue if we can simply register panic notifier in TMC ETR and
ETF drviers (see tmc_panic_sync_etr() and tmc_panic_sync_etf()).
If there is no dependency between CoreSight modules in panic sync flow,
it is not necessary to maintain list (and lock) for these modules.
I have not involved in panic patches before, so I would like to know
the maintainers' opinion.
Thanks,
Leo
This series is to fix device registration and unregistration.
The first patch addresses the resource is not released properly for a
failure case during a device registration.
The second patch is to use mutex to protect unregistration flow.
The last three patches are for refactoring. Patch 03 explicitly uses
the parent device handler. Patch 04 separates the success and failure
flows for code readable and easier maintenance. Patch 05 improves the
error handling by invoking specific functions for resource cleanup.
Leo Yan (5):
coresight: Correct sink ID map allocation failure handling
coresight: Protect unregistration with mutex
coresight: Explicitly use the parent device handler
coresight: Separate failure and success flows
coresight: Refine error handling for device registration
drivers/hwtracing/coresight/coresight-core.c | 67 +++++++++++---------
1 file changed, 37 insertions(+), 30 deletions(-)
--
2.34.1
This patchset builds upon Yicong's previous patches [1].
Introducing fix two race issues found by using TMC-ETR and CATU, Two
cleanups found when debugging the issues.
[1] https://lore.kernel.org/linux-arm-kernel/20241202092419.11777-1-yangyicong@…
---
Changes in v3:
- Patches 1: Additional comment for tmc_drvdata::etr_mode. Update
comment for tmc_drvdata::reading with Jonathan's Tag.
- Patches 2: Replace scoped_guard with guard with Jonathan's Tag.
- Patches 2: Fix spinlock to raw_spinlock, and refactor this code based
on Leo's suggested solution.
- Patches 3: change the size's type to ssize_t and use max_t to simplify
the code with Leo's Tag.
Link: https://lore.kernel.org/linux-arm-kernel/20250620075412.952934-1-hejunhao3@…
Changes in v2:
- Updated the commit of patch2.
- Rebase to v6.16-rc1
Junhao He (1):
coresight: tmc: refactor the tmc-etr mode setting to avoid race
conditions
Yicong Yang (2):
coresight: tmc: Add missing doc including reading and etr_mode of
struct tmc_drvdata
coresight: tmc: Decouple the perf buffer allocation from sysfs mode
.../hwtracing/coresight/coresight-tmc-etr.c | 110 ++++++++----------
drivers/hwtracing/coresight/coresight-tmc.h | 2 +
2 files changed, 53 insertions(+), 59 deletions(-)
--
2.33.0
This series refactor the way CPU IDs are retrieved from the device
tree.
Usually, there is a for loop that goes over every single CPU that can be
avoided. This also reduces the amount of NULL pointer checks in drivers.
I have abstracted away that loop and introduced a new function
(of_cpu_node_to_id) for this.
This patchset is a subset of [1], where I removed content and patches
relevant to hyper-threaded cores for DT. Based on the discussion, the
code refactor is still useful, hence this patchset.
[1]
https://lore.kernel.org/all/20250512080715.82-1-alireza.sanaee@huawei.co
Changes since v3:
- Rebased to d69eb204c255c35abd9e8cb621484e8074c75eaa
Changes since v2:
- Addressed Jonathan Cameron's comments.
- Added reviewed-by tags.
- Added a new commit where I suggest simplfing the code in
arch_topology.c to remove the use of cpu_node on failure path.
- Improve documentation.
- Caught a bug in patch 1.
- Commit message fixed for patch 2.
Changes since v1:
- Rebased on top of the latest mainline.
- Addressed Krzysztof Kozlowski's comments -- Hopefully :-)
- Addressed Jonathan Cameron's comments.
Alireza Sanaee (6):
of: add infra for finding CPU id from phandle
arch_topology: drop the use of cpu_node in the pr_info
arch_topology: update CPU map to use of_cpu_phandle_to_id
coresight: cti: Use of_cpu_phandle_to_id for grabbing CPU id
coresight: Use of_cpu_phandle_to_id for grabbing CPU ID
perf/arm-dsu: refactor cpu id retrieval via new API
of_cpu_phandle_to_id
drivers/base/arch_topology.c | 22 ++++-----
.../coresight/coresight-cti-platform.c | 13 +----
.../hwtracing/coresight/coresight-platform.c | 15 +-----
drivers/of/cpu.c | 48 +++++++++++++++++++
drivers/perf/arm_dsu_pmu.c | 7 +--
include/linux/of.h | 9 ++++
6 files changed, 71 insertions(+), 43 deletions(-)
--
2.43.0
On Sat, 06 Sep 2025 07:53:04 +0800, Jie Gan wrote:
> Some TPDM devices support both CMB and DSB datasets, requiring
> the system to enable the port with both corresponding element sizes.
>
> Currently, the logic treats tpdm_read_element_size as successful if
> the CMB element size is retrieved correctly, regardless of whether
> the DSB element size is obtained. This behavior causes issues
> when parsing data from TPDM devices that depend on both element sizes.
>
> [...]
Applied, thanks!
[1/1] coresight: tpda: fix the logic to setup the element size
https://git.kernel.org/coresight/c/fd6974c19eb3
Best regards,
--
Suzuki K Poulose <suzuki.poulose(a)arm.com>
This series refactor the way CPU IDs are retrieved from the device
tree.
Usually, there is a for loop that goes over every single CPU that can be
avoided. This also reduces the amount of NULL pointer checks in drivers.
I have abstracted away that loop and introduced a new function
(of_cpu_node_to_id) for this.
This patchset is a subset of [1], where I removed content and patches
relevant to hyper-threaded cores for DT. Based on the discussion, the
code refactor is still useful, hence this patchset.
[1]
https://lore.kernel.org/all/20250512080715.82-1-alireza.sanaee@huawei.co
Changes since v3:
- Rebased to d69eb204c255c35abd9e8cb621484e8074c75eaa
Changes since v2:
- Addressed Jonathan Cameron's comments.
- Added reviewed-by tags.
- Added a new commit where I suggest simplfing the code in
arch_topology.c to remove the use of cpu_node on failure path.
- Improve documentation.
- Caught a bug in patch 1.
- Commit message fixed for patch 2.
Changes since v1:
- Rebased on top of the latest mainline.
- Addressed Krzysztof Kozlowski's comments -- Hopefully :-)
- Addressed Jonathan Cameron's comments.
Alireza Sanaee (6):
of: add infra for finding CPU id from phandle
arch_topology: drop the use of cpu_node in the pr_info
arch_topology: update CPU map to use of_cpu_phandle_to_id
coresight: cti: Use of_cpu_phandle_to_id for grabbing CPU id
coresight: Use of_cpu_phandle_to_id for grabbing CPU ID
perf/arm-dsu: refactor cpu id retrieval via new API
of_cpu_phandle_to_id
drivers/base/arch_topology.c | 22 ++++-----
.../coresight/coresight-cti-platform.c | 13 +----
.../hwtracing/coresight/coresight-platform.c | 15 +-----
drivers/of/cpu.c | 48 +++++++++++++++++++
drivers/perf/arm_dsu_pmu.c | 7 +--
include/linux/of.h | 9 ++++
6 files changed, 71 insertions(+), 43 deletions(-)
--
2.43.0
When the TRBE driver fails to allocate a buffer, it currently returns
the error code "-ENOMEM". However, the caller etm_setup_aux() only
checks for a NULL pointer, so it misses the error. As a result, the
driver continues and eventually causes a kernel panic.
Fix this by returning a NULL pointer from arm_trbe_alloc_buffer() on
allocation failures. This allows that the callers can properly handle
the failure.
Fixes: 3fbf7f011f24 ("coresight: sink: Add TRBE driver")
Reported-by: Tamas Zsoldos <tamas.zsoldos(a)arm.com>
Signed-off-by: Leo Yan <leo.yan(a)arm.com>
---
Changes in v2:
- Fix TRBE driver instead of changing coresight-etm-perf.c.
- Link to v1: https://lore.kernel.org/r/20250904-cs_etm_auxsetup_fix_error_handling-v1-1-…
---
drivers/hwtracing/coresight/coresight-trbe.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/hwtracing/coresight/coresight-trbe.c b/drivers/hwtracing/coresight/coresight-trbe.c
index 10f3fb401edf6a00b24b38cdaa7c2865e7a191ac..8f9bbef71f236b327d35a288689df9b0dd8ff3f4 100644
--- a/drivers/hwtracing/coresight/coresight-trbe.c
+++ b/drivers/hwtracing/coresight/coresight-trbe.c
@@ -748,12 +748,12 @@ static void *arm_trbe_alloc_buffer(struct coresight_device *csdev,
buf = kzalloc_node(sizeof(*buf), GFP_KERNEL, trbe_alloc_node(event));
if (!buf)
- return ERR_PTR(-ENOMEM);
+ return NULL;
pglist = kcalloc(nr_pages, sizeof(*pglist), GFP_KERNEL);
if (!pglist) {
kfree(buf);
- return ERR_PTR(-ENOMEM);
+ return NULL;
}
for (i = 0; i < nr_pages; i++)
@@ -763,7 +763,7 @@ static void *arm_trbe_alloc_buffer(struct coresight_device *csdev,
if (!buf->trbe_base) {
kfree(pglist);
kfree(buf);
- return ERR_PTR(-ENOMEM);
+ return NULL;
}
buf->trbe_limit = buf->trbe_base + nr_pages * PAGE_SIZE;
buf->trbe_write = buf->trbe_base;
---
base-commit: fa71e9cb4cfa59abb196229667ec84929bdc18fe
change-id: 20250904-cs_etm_auxsetup_fix_error_handling-cb7e07ed9adf
Best regards,
--
Leo Yan <leo.yan(a)arm.com>