mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/8] coresight: Fix device registration and unregistration
@ 2026-01-26 13:52 Leo Yan
  2026-01-26 13:52 ` [PATCH v2 1/8] coresight: Fix memory leak in coresight_alloc_device_name() Leo Yan
                   ` (7 more replies)
  0 siblings, 8 replies; 11+ messages in thread
From: Leo Yan @ 2026-01-26 13:52 UTC (permalink / raw)
  To: Suzuki K Poulose, Mike Leach, James Clark, Alexander Shishkin,
	Greg Kroah-Hartman, Mathieu Poirier, Mao Jinlong
  Cc: coresight, linux-arm-kernel, linux-kernel, Leo Yan

This series is to fix and refactor CoreSight device registration and
unregistration, it can be divided into three small parts:

  Patches 01-03: Three fixes for memory leak, device reference and mutex
                 protection.
  Patches 04-05: Move connection cleanup operations into
                 coresight_remove_conns().
  Patches 06-08: Refactor error handling in coresight_register().

This series is verified on Juno board with kmemleak detector.

For kmemleak verifying:

  echo clear > /sys/kernel/debug/kmemleak
  insmod coresight modules
  rmmod coresight modules
  echo scan > /sys/kernel/debug/kmemleak

The result shows no memory leak during a cycle of device registration
and unregistration.

---
Changes in v2:
- Refined the commit log in patch 06 (Suzuki).
- Unified to call coresight_unregister() for error handling (Suzuki).
- Refactor connection and sysfs group release.
- Link to v1: https://lore.kernel.org/linux-arm-kernel/20250512154108.23920-1-leo.yan@arm.com/

To: Suzuki K Poulose <suzuki.poulose@arm.com>
To: Mike Leach <mike.leach@linaro.org>
To: James Clark <james.clark@linaro.org>
To: Alexander Shishkin <alexander.shishkin@linux.intel.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Mathieu Poirier <mathieu.poirier@linaro.org>
To: Mao Jinlong <quic_jinlmao@quicinc.com>
Cc: coresight@lists.linaro.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Leo Yan <leo.yan@arm.com>

---
Leo Yan (8):
      coresight: Fix memory leak in coresight_alloc_device_name()
      coresight: Get parent device reference after sink ID map allocation
      coresight: Protect unregistration with mutex
      coresight: Refactor output connection sysfs link cleanup
      coresight: Refactor sysfs connection group cleanup
      coresight: Move sink validation into etm_perf_add_symlink_sink()
      coresight: Do not mix success path with failure handling
      coresight: Unify error handling in coresight_register()

 drivers/hwtracing/coresight/coresight-core.c     | 105 +++++++++++------------
 drivers/hwtracing/coresight/coresight-etm-perf.c |   5 +-
 drivers/hwtracing/coresight/coresight-platform.c |   2 +-
 drivers/hwtracing/coresight/coresight-priv.h     |   3 +-
 4 files changed, 56 insertions(+), 59 deletions(-)
---
base-commit: eebe8dbd8630f51cf70b1f68a440cd3d7f7a914d
change-id: 20260120-arm_coresight_refactor_dev_register-f16c069db41d

Best regards,
-- 
Leo Yan <leo.yan@arm.com>


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2026-01-26 16:18 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-26 13:52 [PATCH v2 0/8] coresight: Fix device registration and unregistration Leo Yan
2026-01-26 13:52 ` [PATCH v2 1/8] coresight: Fix memory leak in coresight_alloc_device_name() Leo Yan
2026-01-26 15:48   ` Suzuki K Poulose
2026-01-26 16:18     ` Leo Yan
2026-01-26 13:52 ` [PATCH v2 2/8] coresight: Get parent device reference after sink ID map allocation Leo Yan
2026-01-26 13:52 ` [PATCH v2 3/8] coresight: Protect unregistration with mutex Leo Yan
2026-01-26 13:52 ` [PATCH v2 4/8] coresight: Refactor output connection sysfs link cleanup Leo Yan
2026-01-26 13:52 ` [PATCH v2 5/8] coresight: Refactor sysfs connection group cleanup Leo Yan
2026-01-26 13:52 ` [PATCH v2 6/8] coresight: Move sink validation into etm_perf_add_symlink_sink() Leo Yan
2026-01-26 13:52 ` [PATCH v2 7/8] coresight: Do not mix success path with failure handling Leo Yan
2026-01-26 13:52 ` [PATCH v2 8/8] coresight: Unify error handling in coresight_register() Leo Yan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®