Commit Graph

1148 Commits

Author SHA1 Message Date
Mark Salter 69add12695 coresight: Make trace ID map spinlock local to the map
JIRA: https://issues.redhat.com/browse/RHEL-21456

commit 988d40a4d4e7d671305bea501562a5d1a1d479fa
Author: James Clark <james.clark@arm.com>
Date: Mon, 22 Jul 2024 11:11:59 +0100

    Reduce contention on the lock by replacing the global lock with one for
    each map.

    Signed-off-by: James Clark <james.clark@arm.com>
    Reviewed-by: Mike Leach <mike.leach@linaro.org>
    Signed-off-by: James Clark <james.clark@linaro.org>
    Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
    Link: https://lore.kernel.org/r/20240722101202.26915-18-james.clark@linaro.org

Signed-off-by: Mark Salter <msalter@redhat.com>
2025-01-04 13:51:34 -05:00
Mark Salter 6fc7b964c2 coresight: Emit sink ID in the HW_ID packets
JIRA: https://issues.redhat.com/browse/RHEL-21456

commit 487eec8da80aef16229d30429f1b26090b1bf0eb
Author: James Clark <james.clark@arm.com>
Date: Mon, 22 Jul 2024 11:11:58 +0100

    For Perf to be able to decode when per-sink trace IDs are used, emit the
    sink that's being written to for each ETM.

    Perf currently errors out if it sees a newer packet version so instead
    of bumping it, add a new minor version field. This can be used to
    signify new versions that have backwards compatible fields. Considering
    this change is only for high core count machines, it doesn't make sense
    to make a breaking change for everyone.

    Signed-off-by: James Clark <james.clark@arm.com>
    Tested-by: Leo Yan <leo.yan@arm.com>
    Reviewed-by: Mike Leach <mike.leach@linaro.org>
    Signed-off-by: James Clark <james.clark@linaro.org>
    Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
    Link: https://lore.kernel.org/r/20240722101202.26915-17-james.clark@linaro.org

Signed-off-by: Mark Salter <msalter@redhat.com>
2025-01-04 13:51:34 -05:00
Mark Salter ac0ee5d033 coresight: Remove pending trace ID release mechanism
JIRA: https://issues.redhat.com/browse/RHEL-21456

commit de0029fdde86092c75472c92e56a962f4edee0f6
Author: James Clark <james.clark@arm.com>
Date: Mon, 22 Jul 2024 11:11:57 +0100

    Pending the release of IDs was a way of managing concurrent sysfs and
    Perf sessions in a single global ID map. Perf may have finished while
    sysfs hadn't, and Perf shouldn't release the IDs in use by sysfs and
    vice versa.

    Now that Perf uses its own exclusive ID maps, pending release doesn't
    result in any different behavior than just releasing all IDs when the
    last Perf session finishes. As part of the per-sink trace ID change, we
    would have still had to make the pending mechanism work on a per-sink
    basis, due to the overlapping ID allocations, so instead of making that
    more complicated, just remove it.

    Signed-off-by: James Clark <james.clark@arm.com>
    Reviewed-by: Mike Leach <mike.leach@linaro.org>
    Signed-off-by: James Clark <james.clark@linaro.org>
    Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
    Link: https://lore.kernel.org/r/20240722101202.26915-16-james.clark@linaro.org

Signed-off-by: Mark Salter <msalter@redhat.com>
2025-01-04 13:51:34 -05:00
Mark Salter f7c83763f1 coresight: Use per-sink trace ID maps for Perf sessions
JIRA: https://issues.redhat.com/browse/RHEL-21456

commit 5ad628a7617607baac53745f8025638b967470a2
Author: James Clark <james.clark@arm.com>
Date: Mon, 22 Jul 2024 11:11:56 +0100

    This will allow sessions with more than CORESIGHT_TRACE_IDS_MAX ETMs
    as long as there are fewer than that many ETMs connected to each sink.

    Each sink owns its own trace ID map, and any Perf session connecting to
    that sink will allocate from it, even if the sink is currently in use by
    other users. This is similar to the existing behavior where the dynamic
    trace IDs are constant as long as there is any concurrent Perf session
    active. It's not completely optimal because slightly more IDs will be
    used than necessary, but the optimal solution involves tracking the PIDs
    of each session and allocating ID maps based on the session owner. This
    is difficult to do with the combination of per-thread and per-cpu modes
    and some scheduling issues. The complexity of this isn't likely to worth
    it because even with multiple users they'd just see a difference in the
    ordering of ID allocations rather than hitting any limits (unless the
    hardware does have too many ETMs connected to one sink).

    Signed-off-by: James Clark <james.clark@arm.com>
    Reviewed-by: Mike Leach <mike.leach@linaro.org>
    Signed-off-by: James Clark <james.clark@linaro.org>
    Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
    Link: https://lore.kernel.org/r/20240722101202.26915-15-james.clark@linaro.org

Signed-off-by: Mark Salter <msalter@redhat.com>
2025-01-04 13:51:34 -05:00
Mark Salter fc635cafff coresight: Make CPU id map a property of a trace ID map
JIRA: https://issues.redhat.com/browse/RHEL-21456

commit d53c8253c7822fbc524adcd950e7c6de6a229c99
Author: James Clark <james.clark@arm.com>
Date: Mon, 22 Jul 2024 11:11:55 +0100

    The global CPU ID mappings won't work for per-sink ID maps so move it to
    the ID map struct. coresight_trace_id_release_all_pending() is hard
    coded to operate on the default map, but once Perf sessions use their
    own maps the pending release mechanism will be deleted. So it doesn't
    need to be extended to accept a trace ID map argument at this point.

    Signed-off-by: James Clark <james.clark@arm.com>
    Reviewed-by: Mike Leach <mike.leach@linaro.org>
    Tested-by: Leo Yan <leo.yan@arm.com>
    Signed-off-by: James Clark <james.clark@linaro.org>
    Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
    Link: https://lore.kernel.org/r/20240722101202.26915-14-james.clark@linaro.org

Signed-off-by: Mark Salter <msalter@redhat.com>
2025-01-04 13:51:34 -05:00
Mark Salter 61d4eace7a coresight: Expose map arguments in trace ID API
JIRA: https://issues.redhat.com/browse/RHEL-21456

commit 7e52877868ae2546ead8ba07cdf1d3e4c9e931f7
Author: James Clark <james.clark@arm.com>
Date: Mon, 22 Jul 2024 11:11:54 +0100

    The trace ID API is currently hard coded to always use the global map.
    Add public versions that allow the map to be passed in so that Perf
    mode can use per-sink maps. Keep the non-map versions so that sysfs
    mode can continue to use the default global map.

    System ID functions are unchanged because they will always use the
    default map.

    Signed-off-by: James Clark <james.clark@arm.com>
    Reviewed-by: Mike Leach <mike.leach@linaro.org>
    Tested-by: Leo Yan <leo.yan@arm.com>
    Signed-off-by: James Clark <james.clark@linaro.org>
    Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
    Link: https://lore.kernel.org/r/20240722101202.26915-13-james.clark@linaro.org

Signed-off-by: Mark Salter <msalter@redhat.com>
2025-01-04 13:51:34 -05:00
Mark Salter 4e3a1c0945 coresight: Move struct coresight_trace_id_map to common header
JIRA: https://issues.redhat.com/browse/RHEL-21456

commit acb0184fe9bca3bb7103dadc76ba9d38c969ca86
Author: James Clark <james.clark@arm.com>
Date: Mon, 22 Jul 2024 11:11:53 +0100

    The trace ID maps will need to be created and stored by the core and
    Perf code so move the definition up to the common header.

    Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
    Reviewed-by: Mike Leach <mike.leach@linaro.org>
    Signed-off-by: James Clark <james.clark@arm.com>
    Tested-by: Leo Yan <leo.yan@arm.com>
    Tested-by: Ganapatrao Kulkarni <gankulkarni@os.amperecomputing.com>
    Signed-off-by: James Clark <james.clark@linaro.org>
    Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
    Link: https://lore.kernel.org/r/20240722101202.26915-12-james.clark@linaro.org

Signed-off-by: Mark Salter <msalter@redhat.com>
2025-01-04 13:51:34 -05:00
Mark Salter 3460849297 coresight: Clarify comments around the PID of the sink owner
JIRA: https://issues.redhat.com/browse/RHEL-21456

commit eda1d11979c03f0104ca59ec4a0478cd52fa20de
Author: James Clark <james.clark@arm.com>
Date: Mon, 22 Jul 2024 11:11:52 +0100

    "Process being monitored" and "pid of the process to monitor" imply that
    this would be the same PID if there were two sessions targeting the same
    process. But this is actually the PID of the process that did the Perf
    event open call, rather than the target of the session. So update the
    comments to make this clearer.

    Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
    Reviewed-by: Mike Leach <mike.leach@linaro.org>
    Signed-off-by: James Clark <james.clark@arm.com>
    Tested-by: Leo Yan <leo.yan@arm.com>
    Tested-by: Ganapatrao Kulkarni <gankulkarni@os.amperecomputing.com>
    Signed-off-by: James Clark <james.clark@linaro.org>
    Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
    Link: https://lore.kernel.org/r/20240722101202.26915-11-james.clark@linaro.org

Signed-off-by: Mark Salter <msalter@redhat.com>
2025-01-04 13:51:34 -05:00
Mark Salter 6850afd7b4 coresight: Remove unused ETM Perf stubs
JIRA: https://issues.redhat.com/browse/RHEL-21456

commit 34172002bdac28dabbb846f191a86454bb226c7a
Author: James Clark <james.clark@arm.com>
Date: Mon, 22 Jul 2024 11:11:51 +0100

    This file is never included anywhere if CONFIG_CORESIGHT is not set so
    they are unused and aren't currently compile tested with any config so
    remove them.

    Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
    Reviewed-by: Mike Leach <mike.leach@linaro.org>
    Signed-off-by: James Clark <james.clark@arm.com>
    Tested-by: Leo Yan <leo.yan@arm.com>
    Tested-by: Ganapatrao Kulkarni <gankulkarni@os.amperecomputing.com>
    Signed-off-by: James Clark <james.clark@linaro.org>
    Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
    Link: https://lore.kernel.org/r/20240722101202.26915-10-james.clark@linaro.org

Signed-off-by: Mark Salter <msalter@redhat.com>
2025-01-04 13:51:34 -05:00
Mark Salter 5315781112 coresight: tmc: sg: Do not leak sg_table
JIRA: https://issues.redhat.com/browse/RHEL-21456

commit c58dc5a1f886f2fcc1133746d0cbaa1fe7fd44ff
Author: Suzuki K Poulose <suzuki.poulose@arm.com>
Date: Tue, 2 Jul 2024 14:28:46 +0100

    Running perf with cs_etm on Juno triggers the following kmemleak warning !

    :~# cat /sys/kernel/debug/kmemleak
     unreferenced object 0xffffff8806b6d720 (size 96):
     comm "perf", pid 562, jiffies 4297810960
     hex dump (first 32 bytes):
     38 d8 13 07 88 ff ff ff 00 d0 9e 85 c0 ff ff ff  8...............
     00 10 00 88 c0 ff ff ff 00 f0 ff f7 ff 00 00 00  ................
     backtrace (crc 1dbf6e00):
     [<ffffffc08107381c>] kmemleak_alloc+0xbc/0xd8
     [<ffffffc0802f9798>] kmalloc_trace_noprof+0x220/0x2e8
     [<ffffffc07bb71948>] tmc_alloc_sg_table+0x48/0x208 [coresight_tmc]
     [<ffffffc07bb71cbc>] tmc_etr_alloc_sg_buf+0xac/0x240 [coresight_tmc]
     [<ffffffc07bb72538>] tmc_alloc_etr_buf.constprop.0+0x1f0/0x260 [coresight_tmc]
     [<ffffffc07bb7280c>] alloc_etr_buf.constprop.0.isra.0+0x74/0xa8 [coresight_tmc]
     [<ffffffc07bb72950>] tmc_alloc_etr_buffer+0x110/0x260 [coresight_tmc]
     [<ffffffc07bb38afc>] etm_setup_aux+0x204/0x3b0 [coresight]
     [<ffffffc08025837c>] rb_alloc_aux+0x20c/0x318
     [<ffffffc08024dd84>] perf_mmap+0x2e4/0x7a0
     [<ffffffc0802cceb0>] mmap_region+0x3b0/0xa08
     [<ffffffc0802cd8a8>] do_mmap+0x3a0/0x500
     [<ffffffc080295328>] vm_mmap_pgoff+0x100/0x1d0
     [<ffffffc0802cadf8>] ksys_mmap_pgoff+0xb8/0x110
     [<ffffffc080020688>] __arm64_sys_mmap+0x38/0x58
     [<ffffffc080028fc0>] invoke_syscall.constprop.0+0x58/0x100

    This due to the fact that we do not free the "sg_table" itself while
    freeing up  the SG table and data pages. Fix this by freeing the sg_table
    in tmc_free_sg_table().

    Fixes: 99443ea19e ("coresight: Add generic TMC sg table framework")
    Cc: Mike Leach <mike.leach@linaro.org>
    Cc: James Clark <james.clark@arm.com>
    Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
    Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
    Link: https://lore.kernel.org/r/20240702132846.1677261-1-suzuki.poulose@arm.com

Signed-off-by: Mark Salter <msalter@redhat.com>
2025-01-04 13:51:33 -05:00
Mark Salter 1b3cd905f7 Coresight: Set correct cs_mode for dummy source to fix disable issue
JIRA: https://issues.redhat.com/browse/RHEL-21456

commit e6b64cda393efd84709ab3df2e42d36d36d7553e
Author: Jie Gan <quic_jiegan@quicinc.com>
Date: Mon, 12 Aug 2024 12:28:44 +0800

    The coresight_disable_source_sysfs function should verify the
    mode of the coresight device before disabling the source.
    However, the mode for the dummy source device is always set to
    CS_MODE_DISABLED, resulting in the check consistently failing.
    As a result, dummy source cannot be properly disabled.

    Configure CS_MODE_SYSFS/CS_MODE_PERF during the enablement.
    Configure CS_MODE_DISABLED during the disablement.

    Fixes: 9d3ba0b6c056 ("Coresight: Add coresight dummy driver")
    Signed-off-by: Jie Gan <quic_jiegan@quicinc.com>
    Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
    Link: https://lore.kernel.org/r/20240812042844.2890115-1-quic_jiegan@quicinc.com

Signed-off-by: Mark Salter <msalter@redhat.com>
2025-01-04 13:51:33 -05:00
Mark Salter 8578ee96c1 Coresight: Set correct cs_mode for TPDM to fix disable issue
JIRA: https://issues.redhat.com/browse/RHEL-21456

commit 14f5fa9b5fcbe2b3d5098893aba6ad62254d2ef6
Author: Jie Gan <quic_jiegan@quicinc.com>
Date: Mon, 12 Aug 2024 12:30:43 +0800

    The coresight_disable_source_sysfs function should verify the
    mode of the coresight device before disabling the source.

    However, the mode for the TPDM device is always set to
    CS_MODE_DISABLED, resulting in the check consistently failing.
    As a result, TPDM cannot be properly disabled.

    Configure CS_MODE_SYSFS/CS_MODE_PERF during the enablement.
    Configure CS_MODE_DISABLED during the disablement.

    Fixes: b3c71626a933 ("Coresight: Add coresight TPDM source driver")
    Signed-off-by: Jie Gan <quic_jiegan@quicinc.com>
    Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
    Link: https://lore.kernel.org/r/20240812043043.2890694-1-quic_jiegan@quicinc.com

Signed-off-by: Mark Salter <msalter@redhat.com>
2025-01-04 13:51:33 -05:00
Mark Salter 440035778d hwtracing: use for_each_endpoint_of_node()
JIRA: https://issues.redhat.com/browse/RHEL-21456

commit 2e5657aa59669698f0f3bf7742d83577a18eb830
Author: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date: Mon, 1 Jul 2024 02:32:35 +0000

    We already have for_each_endpoint_of_node(), don't use
    of_graph_get_next_endpoint() directly. Replace it.

    Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
    Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
    Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
    Reviewed-by: James Clark <james.clark@arm.com>
    Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
    Link: https://lore.kernel.org/r/878qyl970c.wl-kuninori.morimoto.gx@renesas.com

Signed-off-by: Mark Salter <msalter@redhat.com>
2025-01-04 13:51:17 -05:00
Mark Salter e1a91a05d7 coresight: constify the struct device_type usage
JIRA: https://issues.redhat.com/browse/RHEL-21456

commit 4dcc0f95ca2a9738e5e4e3bd7571fd95a9cbf272
Author: "Ricardo B. Marliere" <ricardo@marliere.net>
Date: Mon, 19 Feb 2024 10:43:05 -0300

    Since commit aed65af1cc ("drivers: make device_type const"), the driver
    core can properly handle constant struct device_type. Move the
    coresight_dev_type variable to be a constant structure as well, placing it
    into read-only memory which can not be modified at runtime.

    Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
    Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
    Reviewed-by: James Clark <james.clark@arm.com>
    Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
    Link: https://lore.kernel.org/r/20240219-device_cleanup-coresight-v1-1-4a8a0b816183@marliere.net
    Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>

Signed-off-by: Mark Salter <msalter@redhat.com>
2025-01-04 13:51:17 -05:00
Mark Salter 5540ea7da4 coresight: tmc: Remove duplicated include in coresight-tmc-core.c
JIRA: https://issues.redhat.com/browse/RHEL-21456

commit b9b25c8496019402ecd64ddc5ae56f9bd97b12b2
Author: Yang Li <yang.lee@linux.alibaba.com>
Date: Mon, 6 May 2024 09:11:21 +0800

    The header files linux/acpi.h is included twice in coresight-tmc-core.c,
    so one inclusion of each can be removed.

    Reported-by: Abaci Robot <abaci@linux.alibaba.com>
    Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=8937
    Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
    Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
    Link: https://lore.kernel.org/r/20240506011121.39179-1-yang.lee@linux.alibaba.com

Signed-off-by: Mark Salter <msalter@redhat.com>
2025-01-04 13:51:17 -05:00
Mark Salter a9266d13ea coresight: Fix ref leak when of_coresight_parse_endpoint() fails
JIRA: https://issues.redhat.com/browse/RHEL-21456

commit 7fcb9cb2fe47294e16067c3cfd25332c8662a115
Author: James Clark <james.clark@arm.com>
Date: Wed, 29 May 2024 14:36:26 +0100

    of_graph_get_next_endpoint() releases the reference to the previous
    endpoint on each iteration, but when parsing fails the loop exits
    early meaning the last reference is never dropped.

    Fix it by dropping the refcount in the exit condition.

    Fixes: d375b356e6 ("coresight: Fix support for sparsely populated ports")
    Signed-off-by: James Clark <james.clark@arm.com>
    Reported-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
    Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
    Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
    Link: https://lore.kernel.org/r/20240529133626.90080-1-james.clark@arm.com

Signed-off-by: Mark Salter <msalter@redhat.com>
2025-01-04 13:51:17 -05:00
Mark Salter 2176a56619 coresight: tmc: Enable SG capability on ACPI based SoC-400 TMC ETR devices
JIRA: https://issues.redhat.com/browse/RHEL-21456

commit 8877ef45ef9ec281849870d88039f8dc84cde774
Author: Anshuman Khandual <anshuman.khandual@arm.com>
Date: Thu, 4 Apr 2024 12:59:34 +0530

    This detects and enables the scatter gather capability (SG) on ACPI based
    Soc-400 TMC ETR devices via a new property called 'arm-armhc97c-sg-enable'.
    The updated ACPI spec can be found below, which contains this new property.

    https://developer.arm.com/documentation/den0067/latest/

    This preserves current handling for the property 'arm,scatter-gather' both
    on ACPI and DT based platforms i.e the presence of the property is checked
    instead of the value.

    Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
    Cc: Mike Leach <mike.leach@linaro.org>
    Cc: James Clark <james.clark@arm.com>
    Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
    Cc: coresight@lists.linaro.org
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
    Reviewed-by: James Clark <james.clark@arm.com>
    Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
    Link: https://lore.kernel.org/r/20240404072934.940760-1-anshuman.khandual@arm.com

Signed-off-by: Mark Salter <msalter@redhat.com>
2025-01-04 13:51:17 -05:00
Mark Salter 7d25063dd3 coresight: tpiu: Convert to platform remove callback returning void
JIRA: https://issues.redhat.com/browse/RHEL-21456

commit ba8c06fe7e16ddfd44ece7fabd9af2dc2e6d49e7
Author: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>
Date: Tue, 23 Apr 2024 10:07:02 +0200

    The .remove() callback for a platform driver returns an int which makes
    many driver authors wrongly assume it's possible to do error handling by
    returning an error code. However the value returned is ignored (apart
    from emitting a warning) and this typically results in resource leaks.

    To improve here there is a quest to make the remove callback return
    void. In the first step of this quest all drivers are converted to
    .remove_new(), which already returns void. Eventually after all drivers
    are converted, .remove_new() will be renamed to .remove().

    Trivially convert this driver from always returning zero in the remove
    callback to the void returning variant.

    Fixes: 3d83d4d4904a ("coresight: tpiu: Move ACPI support from AMBA driver to platform driver")
    Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
    Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
    Link: https://lore.kernel.org/r/ad5e0d3ec081444a5ad04a7be277dde3afcb696b.1713858615.git.u.kleine-koenig@pengutronix.de

Signed-off-by: Mark Salter <msalter@redhat.com>
2025-01-04 13:51:17 -05:00
Mark Salter bb9f5d7530 coresight: tmc: Convert to platform remove callback returning void
JIRA: https://issues.redhat.com/browse/RHEL-21456

commit 38a38da447579f683114edb1c8254491b4176853
Author: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>
Date: Tue, 23 Apr 2024 10:07:01 +0200

    The .remove() callback for a platform driver returns an int which makes
    many driver authors wrongly assume it's possible to do error handling by
    returning an error code. However the value returned is ignored (apart
    from emitting a warning) and this typically results in resource leaks.

    To improve here there is a quest to make the remove callback return
    void. In the first step of this quest all drivers are converted to
    .remove_new(), which already returns void. Eventually after all drivers
    are converted, .remove_new() will be renamed to .remove().

    Trivially convert this driver from always returning zero in the remove
    callback to the void returning variant.

    Fixes: 70750e257aab ("coresight: tmc: Move ACPI support from AMBA driver to platform driver")
    Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
    Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
    Link: https://lore.kernel.org/r/3cf26d85a8d45f0efb07e07f3307a1b435ebf61e.1713858615.git.u.kleine-koenig@pengutronix.de

Signed-off-by: Mark Salter <msalter@redhat.com>
2025-01-04 13:51:17 -05:00
Mark Salter 368f91ebe2 coresight: stm: Convert to platform remove callback returning void
JIRA: https://issues.redhat.com/browse/RHEL-21456

commit 981d5f92ca2e33d1b0ba3e3563de52dc9661fb92
Author: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>
Date: Tue, 23 Apr 2024 10:07:00 +0200

    The .remove() callback for a platform driver returns an int which makes
    many driver authors wrongly assume it's possible to do error handling by
    returning an error code. However the value returned is ignored (apart
    from emitting a warning) and this typically results in resource leaks.

    To improve here there is a quest to make the remove callback return
    void. In the first step of this quest all drivers are converted to
    .remove_new(), which already returns void. Eventually after all drivers
    are converted, .remove_new() will be renamed to .remove().

    Trivially convert this driver from always returning zero in the remove
    callback to the void returning variant.

    Fixes: 057256aaacc8 ("coresight: stm: Move ACPI support from AMBA driver to platform driver")
    Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
    Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
    Link: https://lore.kernel.org/r/3fefa60744fc68c9c4b40aeb69e34cda22582c4b.1713858615.git.u.kleine-koenig@pengutronix.de

Signed-off-by: Mark Salter <msalter@redhat.com>
2025-01-04 13:51:17 -05:00
Mark Salter bfffe5e53a coresight: debug: Convert to platform remove callback returning void
JIRA: https://issues.redhat.com/browse/RHEL-21456

commit 971c2b107b5742ef1dfa3a405cd5ee7033502d60
Author: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>
Date: Tue, 23 Apr 2024 10:06:59 +0200

    The .remove() callback for a platform driver returns an int which makes
    many driver authors wrongly assume it's possible to do error handling by
    returning an error code. However the value returned is ignored (apart
    from emitting a warning) and this typically results in resource leaks.

    To improve here there is a quest to make the remove callback return
    void. In the first step of this quest all drivers are converted to
    .remove_new(), which already returns void. Eventually after all drivers
    are converted, .remove_new() will be renamed to .remove().

    Trivially convert this driver from always returning zero in the remove
    callback to the void returning variant.

    Fixes: 965edae4e6a2 ("coresight: debug: Move ACPI support from AMBA driver to platform driver")
    Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
    Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
    Link: https://lore.kernel.org/r/fb3d7db82a2490ace41c51b16ad17ef61549e2f6.1713858615.git.u.kleine-koenig@pengutronix.de

Signed-off-by: Mark Salter <msalter@redhat.com>
2025-01-04 13:51:17 -05:00
Mark Salter 12942df0d3 coresight: stm: Remove duplicate linux/acpi.h header
JIRA: https://issues.redhat.com/browse/RHEL-21456

commit 002026272ba523d2ae62a13b0a9febb0cdaf576e
Author: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Date: Wed, 24 Apr 2024 10:36:05 +0800

    ./drivers/hwtracing/coresight/coresight-stm.c: linux/acpi.h is included more than once.

    Reported-by: Abaci Robot <abaci@linux.alibaba.com>
    Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=8871
    Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
    Reviewed-by: James Clark <james.clark@arm.com>
    Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
    Link: https://lore.kernel.org/r/20240424023605.90489-1-jiapeng.chong@linux.alibaba.com

Signed-off-by: Mark Salter <msalter@redhat.com>
2025-01-04 13:51:17 -05:00
Mark Salter 37d7fcf03d coresight: etm4x: Fix access to resource selector registers
JIRA: https://issues.redhat.com/browse/RHEL-21456

commit d6fc00d0f640d6010b51054aa8b0fd191177dbc9
Author: Suzuki K Poulose <suzuki.poulose@arm.com>
Date: Fri, 12 Apr 2024 15:27:02 +0100

    Resource selector pair 0 is always implemented and reserved. We must not
    touch it, even during save/restore for CPU Idle. Rest of the driver is
    well behaved. Fix the offending ones.

    Reported-by: Yabin Cui <yabinc@google.com>
    Fixes: f188b5e76a ("coresight: etm4x: Save/restore state across CPU low power states")
    Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
    Tested-by: Yabin Cui <yabinc@google.com>
    Reviewed-by: Mike Leach <mike.leach@linaro.org>
    Link: https://lore.kernel.org/r/20240412142702.2882478-5-suzuki.poulose@arm.com

Signed-off-by: Mark Salter <msalter@redhat.com>
2025-01-04 13:51:17 -05:00
Mark Salter b976f61b25 coresight: etm4x: Safe access for TRCQCLTR
JIRA: https://issues.redhat.com/browse/RHEL-21456

commit 46bf8d7cd8530eca607379033b9bc4ac5590a0cd
Author: Suzuki K Poulose <suzuki.poulose@arm.com>
Date: Fri, 12 Apr 2024 15:27:01 +0100

    ETM4x implements TRCQCLTR only when the Q elements are supported
    and the Q element filtering is supported (TRCIDR0.QFILT). Access
    to the register otherwise could be fatal. Fix this by tracking the
    availability, like the others.

    Fixes: f188b5e76a ("coresight: etm4x: Save/restore state across CPU low power states")
    Reported-by: Yabin Cui <yabinc@google.com>
    Reviewed-by: Mike Leach <mike.leach@linaro.org>
    Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
    Tested-by: Yabin Cui <yabinc@google.com>
    Link: https://lore.kernel.org/r/20240412142702.2882478-4-suzuki.poulose@arm.com

Signed-off-by: Mark Salter <msalter@redhat.com>
2025-01-04 13:51:17 -05:00
Mark Salter e96af4c8f9 coresight: etm4x: Do not save/restore Data trace control registers
JIRA: https://issues.redhat.com/browse/RHEL-21456

commit 5eb3a0c2c52368cb9902e9a6ea04888e093c487d
Author: Suzuki K Poulose <suzuki.poulose@arm.com>
Date: Fri, 12 Apr 2024 15:27:00 +0100

    ETM4x doesn't support Data trace on A class CPUs. As such do not access the
    Data trace control registers during CPU idle. This could cause problems for
    ETE. While at it, remove all references to the Data trace control registers.

    Fixes: f188b5e76a ("coresight: etm4x: Save/restore state across CPU low power states")
    Reported-by: Yabin Cui <yabinc@google.com>
    Reviewed-by: Mike Leach <mike.leach@linaro.org>
    Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
    Tested-by: Yabin Cui <yabinc@google.com>
    Link: https://lore.kernel.org/r/20240412142702.2882478-3-suzuki.poulose@arm.com

Signed-off-by: Mark Salter <msalter@redhat.com>
2025-01-04 13:51:16 -05:00
Mark Salter 2579c4a1b6 coresight: etm4x: Do not hardcode IOMEM access for register restore
JIRA: https://issues.redhat.com/browse/RHEL-21456

commit 1e7ba33fa591de1cf60afffcabb45600b3607025
Author: Suzuki K Poulose <suzuki.poulose@arm.com>
Date: Fri, 12 Apr 2024 15:26:59 +0100

    When we restore the register state for ETM4x, while coming back
    from CPU idle, we hardcode IOMEM access. This is wrong and could
    blow up for an ETM with system instructions access (and for ETE).

    Fixes: f5bd523690 ("coresight: etm4x: Convert all register accesses")
    Reported-by: Yabin Cui <yabinc@google.com>
    Reviewed-by: Mike Leach <mike.leach@linaro.org>
    Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
    Tested-by: Yabin Cui <yabinc@google.com>
    Link: https://lore.kernel.org/r/20240412142702.2882478-2-suzuki.poulose@arm.com

Signed-off-by: Mark Salter <msalter@redhat.com>
2025-01-04 13:51:16 -05:00
Mark Salter f0ac801df7 coresight: debug: Move ACPI support from AMBA driver to platform driver
JIRA: https://issues.redhat.com/browse/RHEL-21456

commit 965edae4e6a2bca1f6e56d2c56d992417a53bba4
Author: Anshuman Khandual <anshuman.khandual@arm.com>
Date: Thu, 14 Mar 2024 11:28:43 +0530

    Add support for the cpu debug devices in a new platform driver, which can
    then be used on ACPI based platforms. This change would now allow runtime
    power management for ACPI based systems. The driver would try to enable
    the APB clock if available. But first this renames and then refactors
    debug_probe() and debug_remove(), making sure they can be used both for
    platform and AMBA drivers.

    Cc: Lorenzo Pieralisi <lpieralisi@kernel.org>
    Cc: Sudeep Holla <sudeep.holla@arm.com>
    Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
    Cc: Mike Leach <mike.leach@linaro.org>
    Cc: James Clark <james.clark@arm.com>
    Cc: linux-acpi@vger.kernel.org
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: linux-kernel@vger.kernel.org
    Cc: coresight@lists.linaro.org
    Acked-by: Sudeep Holla <sudeep.holla@arm.com> # For ACPI related changes
    Reviewed-by: James Clark <james.clark@arm.com>
    Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
    Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
    Link: https://lore.kernel.org/r/20240314055843.2625883-12-anshuman.khandual@arm.com

Signed-off-by: Mark Salter <msalter@redhat.com>
2025-01-04 13:51:16 -05:00
Mark Salter 59d81f54f7 coresight: stm: Move ACPI support from AMBA driver to platform driver
JIRA: https://issues.redhat.com/browse/RHEL-21456

commit 057256aaacc862356417a75ceeb1cfa41408dbf0
Author: Anshuman Khandual <anshuman.khandual@arm.com>
Date: Thu, 14 Mar 2024 11:28:42 +0530

    Add support for the stm devices in the platform driver, which can then be
    used on ACPI based platforms. This change would now allow runtime power
    management for ACPI based systems. The driver would try to enable the APB
    clock if available. But first this renames and then refactors stm_probe()
    and stm_remove(), making sure it can be used both for platform and AMBA
    drivers. Also this moves pm_runtime_put() from stm_probe() to the callers.

    Cc: Lorenzo Pieralisi <lpieralisi@kernel.org>
    Cc: Sudeep Holla <sudeep.holla@arm.com>
    Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
    Cc: Mike Leach <mike.leach@linaro.org>
    Cc: James Clark <james.clark@arm.com>
    Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
    Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>
    Cc: linux-acpi@vger.kernel.org
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: linux-kernel@vger.kernel.org
    Cc: coresight@lists.linaro.org
    Cc: linux-stm32@st-md-mailman.stormreply.com
    Tested-by: Sudeep Holla <sudeep.holla@arm.com> # Boot and driver probe only
    Acked-by: Sudeep Holla <sudeep.holla@arm.com> # For ACPI related changes
    Reviewed-by: James Clark <james.clark@arm.com>
    Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
    Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
    Link: https://lore.kernel.org/r/20240314055843.2625883-11-anshuman.khandual@arm.com

Signed-off-by: Mark Salter <msalter@redhat.com>
2025-01-04 13:51:16 -05:00
Mark Salter df6f115ec7 coresight: tmc: Move ACPI support from AMBA driver to platform driver
JIRA: https://issues.redhat.com/browse/RHEL-21456

commit 70750e257aab4cd4d755294ae8b9834214a624bb
Author: Anshuman Khandual <anshuman.khandual@arm.com>
Date: Thu, 14 Mar 2024 11:28:41 +0530

    Add support for the tmc devices in the platform driver, which can then be
    used on ACPI based platforms. This change would now allow runtime power
    management for ACPI based systems. The driver would try to enable the APB
    clock if available. But first this renames and then refactors tmc_probe()
    and tmc_remove(), making sure it can be used both for platform and AMBA
    drivers. This also moves pm_runtime_put() from tmc_probe() to the callers.

    Cc: Lorenzo Pieralisi <lpieralisi@kernel.org>
    Cc: Sudeep Holla <sudeep.holla@arm.com>
    Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
    Cc: Mike Leach <mike.leach@linaro.org>
    Cc: James Clark <james.clark@arm.com>
    Cc: linux-acpi@vger.kernel.org
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: linux-kernel@vger.kernel.org
    Cc: coresight@lists.linaro.org
    Tested-by: Sudeep Holla <sudeep.holla@arm.com> # Boot and driver probe only
    Acked-by: Sudeep Holla <sudeep.holla@arm.com> # For ACPI related changes
    Reviewed-by: James Clark <james.clark@arm.com>
    Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
    Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
    Link: https://lore.kernel.org/r/20240314055843.2625883-10-anshuman.khandual@arm.com

Signed-off-by: Mark Salter <msalter@redhat.com>
2025-01-04 13:51:16 -05:00
Mark Salter 9c9bc86d3b coresight: tpiu: Move ACPI support from AMBA driver to platform driver
JIRA: https://issues.redhat.com/browse/RHEL-21456

commit 3d83d4d4904a47626854b6bba44127d21a7dc713
Author: Anshuman Khandual <anshuman.khandual@arm.com>
Date: Thu, 14 Mar 2024 11:28:40 +0530

    Add support for the tpiu device in the platform driver, which can then be
    used on ACPI based platforms. This change would now allow runtime power
    management for ACPI based systems. The driver would try to enable the APB
    clock if available. But first this renames and then refactors tpiu_probe()
    and tpiu_remove(), making sure it can be used both for platform and AMBA
    drivers. This also moves pm_runtime_put() from tpiu_probe() to the callers.
    While here, this also sorts the included headers in alphabetic order.

    Cc: Lorenzo Pieralisi <lpieralisi@kernel.org>
    Cc: Sudeep Holla <sudeep.holla@arm.com>
    Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
    Cc: Mike Leach <mike.leach@linaro.org>
    Cc: James Clark <james.clark@arm.com>
    Cc: linux-acpi@vger.kernel.org
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: linux-kernel@vger.kernel.org
    Cc: coresight@lists.linaro.org
    Tested-by: Sudeep Holla <sudeep.holla@arm.com> # Boot and driver probe only
    Acked-by: Sudeep Holla <sudeep.holla@arm.com> # For ACPI related changes
    Reviewed-by: James Clark <james.clark@arm.com>
    Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
    Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
    Link: https://lore.kernel.org/r/20240314055843.2625883-9-anshuman.khandual@arm.com

Signed-off-by: Mark Salter <msalter@redhat.com>
2025-01-04 13:51:16 -05:00
Mark Salter d71b7e2e76 coresight: catu: Move ACPI support from AMBA driver to platform driver
JIRA: https://issues.redhat.com/browse/RHEL-21456

commit 23567323857d2073197953bb158413be1aceca8b
Author: Anshuman Khandual <anshuman.khandual@arm.com>
Date: Thu, 14 Mar 2024 11:28:39 +0530

    Add support for the catu devices in a new platform driver, which can then
    be used on ACPI based platforms. This change would now allow runtime power
    management for ACPI based systems. The driver would try to enable the APB
    clock if available. But first this renames and then refactors catu_probe()
    and catu_remove(), making sure it can be used both for platform and AMBA
    drivers. This also moves pm_runtime_put() from catu_probe() to the callers.

    Cc: Lorenzo Pieralisi <lpieralisi@kernel.org>
    Cc: Sudeep Holla <sudeep.holla@arm.com>
    Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
    Cc: Mike Leach <mike.leach@linaro.org>
    Cc: James Clark <james.clark@arm.com>
    Cc: linux-acpi@vger.kernel.org
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: linux-kernel@vger.kernel.org
    Cc: coresight@lists.linaro.org
    Acked-by: Sudeep Holla <sudeep.holla@arm.com> # For ACPI related changes
    Reviewed-by: James Clark <james.clark@arm.com>
    Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
    Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
    Link: https://lore.kernel.org/r/20240314055843.2625883-8-anshuman.khandual@arm.com

Signed-off-by: Mark Salter <msalter@redhat.com>
2025-01-04 13:51:16 -05:00
Mark Salter dec0627673 coresight: funnel: Move ACPI support from AMBA driver to platform driver
JIRA: https://issues.redhat.com/browse/RHEL-21456

commit 8e3227ddfbd7216f14186ec534f43e9dbcde717c
Author: Anshuman Khandual <anshuman.khandual@arm.com>
Date: Thu, 14 Mar 2024 11:28:38 +0530

    Add support for the dynamic funnel device in the platform driver, which can
    then be used on ACPI based platforms. This change would allow runtime power
    management for ACPI based systems.

    The driver would try to enable the APB clock if available. Also, rename the
    code to reflect the fact that it now handles both static and dynamic
    funnels. But first this refactors funnel_probe() making sure it can be used
    both for platform and AMBA drivers, by moving the pm_runtime_put() to the
    callers.

    Cc: Lorenzo Pieralisi <lpieralisi@kernel.org>
    Cc: Sudeep Holla <sudeep.holla@arm.com>
    Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
    Cc: Mike Leach <mike.leach@linaro.org>
    Cc: James Clark <james.clark@arm.com>
    Cc: linux-acpi@vger.kernel.org
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: linux-kernel@vger.kernel.org
    Cc: coresight@lists.linaro.org
    Tested-by: Sudeep Holla <sudeep.holla@arm.com> # Boot and driver probe only
    Acked-by: Sudeep Holla <sudeep.holla@arm.com> # For ACPI related changes
    Reviewed-by: James Clark <james.clark@arm.com>
    Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
    Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
    Link: https://lore.kernel.org/r/20240314055843.2625883-7-anshuman.khandual@arm.com

Signed-off-by: Mark Salter <msalter@redhat.com>
2025-01-04 13:51:16 -05:00
Mark Salter f862c0be63 coresight: replicator: Move ACPI support from AMBA driver to platform driver
JIRA: https://issues.redhat.com/browse/RHEL-21456

commit b448c4c72ca3327232dfb20d0065b693b3fcc2e2
Author: Anshuman Khandual <anshuman.khandual@arm.com>
Date: Thu, 14 Mar 2024 11:28:37 +0530

    Add support for the dynamic replicator device in the platform driver, which
    can then be used on ACPI based platforms. This change would now allow
    runtime power management for replicator devices on ACPI based systems.

    The driver would try to enable the APB clock if available. Also, rename the
    code to reflect the fact that it now handles both static and dynamic
    replicators. But first this refactors replicator_probe() making sure it can
    be used both for platform and AMBA drivers, by moving the pm_runtime_put()
    to the callers.

    Cc: Lorenzo Pieralisi <lpieralisi@kernel.org>
    Cc: Sudeep Holla <sudeep.holla@arm.com>
    Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
    Cc: Mike Leach <mike.leach@linaro.org>
    Cc: James Clark <james.clark@arm.com>
    Cc: linux-acpi@vger.kernel.org
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: linux-kernel@vger.kernel.org
    Cc: coresight@lists.linaro.org
    Tested-by: Sudeep Holla <sudeep.holla@arm.com> # Boot and driver probe only
    Acked-by: Sudeep Holla <sudeep.holla@arm.com> # For ACPI related changes
    Reviewed-by: James Clark <james.clark@arm.com>
    Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
    Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
    Link: https://lore.kernel.org/r/20240314055843.2625883-6-anshuman.khandual@arm.com

Signed-off-by: Mark Salter <msalter@redhat.com>
2025-01-04 13:51:16 -05:00
Mark Salter fb683f1418 coresight: Add helpers registering/removing both AMBA and platform drivers
JIRA: https://issues.redhat.com/browse/RHEL-21456

commit 075b7cd7ad7dec8651a6a6654fa5ebae436ac00f
Author: Anshuman Khandual <anshuman.khandual@arm.com>
Date: Thu, 14 Mar 2024 11:28:36 +0530

    This adds two different helpers i.e coresight_init_driver()/remove_driver()
    enabling coresight devices to register or remove AMBA and platform drivers.
    This changes replicator and funnel devices to use above new helpers.

    Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
    Cc: Mike Leach <mike.leach@linaro.org>
    Cc: James Clark <james.clark@arm.com>
    Cc: Leo Yan <leo.yan@linaro.org>
    Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: linux-kernel@vger.kernel.org
    Cc: coresight@lists.linaro.org
    Reviewed-by: James Clark <james.clark@arm.com>
    Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
    Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
    Link: https://lore.kernel.org/r/20240314055843.2625883-5-anshuman.khandual@arm.com

Signed-off-by: Mark Salter <msalter@redhat.com>
2025-01-04 13:51:16 -05:00
Mark Salter a2aea3a484 coresight: tmc: Extract device properties from AMBA pid based table lookup
JIRA: https://issues.redhat.com/browse/RHEL-21456

commit 3ab210297c31b8fef1cfb2aa3d85b227b9ace09b
Author: Anshuman Khandual <anshuman.khandual@arm.com>
Date: Thu, 14 Mar 2024 11:28:35 +0530

    This extracts device properties from AMBA pid based table lookup. But first
    this modifies tmc_etr_setup_caps() to accept csdev access.

    Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
    Cc: Mike Leach <mike.leach@linaro.org>
    Cc: James Clark <james.clark@arm.com>
    Cc: coresight@lists.linaro.org
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
    Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
    Link: https://lore.kernel.org/r/20240314055843.2625883-4-anshuman.khandual@arm.com

Signed-off-by: Mark Salter <msalter@redhat.com>
2025-01-04 13:51:16 -05:00
Mark Salter e74d805e7f coresight: stm: Extract device name from AMBA pid based table lookup
JIRA: https://issues.redhat.com/browse/RHEL-21456

commit 852e9a32058a73702c016a8be10c60375276e46e
Author: Anshuman Khandual <anshuman.khandual@arm.com>
Date: Thu, 14 Mar 2024 11:28:34 +0530

    Instead of using AMBA private data field, extract the device name from AMBA
    pid based table lookup using new coresight_get_uci_data_from_amba() helper.

    Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
    Cc: Mike Leach <mike.leach@linaro.org>
    Cc: James Clark <james.clark@arm.com>
    Cc: coresight@lists.linaro.org
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-stm32@st-md-mailman.stormreply.com
    Reviewed-by: James Clark <james.clark@arm.com>
    Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
    Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
    Link: https://lore.kernel.org/r/20240314055843.2625883-3-anshuman.khandual@arm.com

Signed-off-by: Mark Salter <msalter@redhat.com>
2025-01-04 13:51:16 -05:00
Mark Salter f5608fe2bc coresight: etm4x: Fix unbalanced pm_runtime_enable()
JIRA: https://issues.redhat.com/browse/RHEL-21456

commit caa41c47dab7e1054f587e592ab21296e3a6781c
Author: Anshuman Khandual <anshuman.khandual@arm.com>
Date: Thu, 14 Mar 2024 11:28:33 +0530

    There is an unbalanced pm_runtime_enable() in etm4_probe_platform_dev()
    when etm4_probe() fails. This problem can be observed via the coresight
    etm4 module's (load -> unload -> load) sequence when etm4_probe() fails
    in etm4_probe_platform_dev().

    [   63.379943] coresight-etm4x 7040000.etm: Unbalanced pm_runtime_enable!
    [   63.393630] coresight-etm4x 7140000.etm: Unbalanced pm_runtime_enable!
    [   63.407455] coresight-etm4x 7240000.etm: Unbalanced pm_runtime_enable!
    [   63.420983] coresight-etm4x 7340000.etm: Unbalanced pm_runtime_enable!
    [   63.420999] coresight-etm4x 7440000.etm: Unbalanced pm_runtime_enable!
    [   63.441209] coresight-etm4x 7540000.etm: Unbalanced pm_runtime_enable!
    [   63.454689] coresight-etm4x 7640000.etm: Unbalanced pm_runtime_enable!
    [   63.474982] coresight-etm4x 7740000.etm: Unbalanced pm_runtime_enable!

    This fixes the above problem - with an explicit pm_runtime_disable() call
    when etm4_probe() fails during etm4_probe_platform_dev().

    Cc: Lorenzo Pieralisi <lpieralisi@kernel.org>
    Cc: Hanjun Guo <guohanjun@huawei.com>
    Cc: Sudeep Holla <sudeep.holla@arm.com>
    Cc: "Rafael J. Wysocki" <rafael@kernel.org>
    Cc: Len Brown <lenb@kernel.org>
    Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
    Cc: Mike Leach <mike.leach@linaro.org>
    Cc: James Clark <james.clark@arm.com>
    Cc: Leo Yan <leo.yan@linaro.org>
    Cc: linux-acpi@vger.kernel.org
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: linux-kernel@vger.kernel.org
    Cc: coresight@lists.linaro.org
    Fixes: 5214b56358 ("coresight: etm4x: Add support for sysreg only devices")
    Reviewed-by: James Clark <james.clark@arm.com>
    Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
    Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
    Link: https://lore.kernel.org/r/20240314055843.2625883-2-anshuman.khandual@arm.com

Signed-off-by: Mark Salter <msalter@redhat.com>
2025-01-04 13:51:16 -05:00
Mark Salter bed3916e9e ARM: 9379/1: coresight: tpda: drop owner assignment
JIRA: https://issues.redhat.com/browse/RHEL-21456

commit aff00427579d4c915ee92553f712e4c632185e6e
Author: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Date: Tue, 2 Apr 2024 10:51:18 +0100

    Amba bus core already sets owner, so driver does not need to.

    Link: https://lore.kernel.org/r/20240326-module-owner-amba-v1-11-4517b091385b@linaro.org

    Acked-by: Suzuki K Poulose <suzuki.poulose@arm.com>
    Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>

Signed-off-by: Mark Salter <msalter@redhat.com>
2025-01-04 13:51:16 -05:00
Mark Salter 78984e7cab ARM: 9378/1: coresight: etm4x: drop owner assignment
JIRA: https://issues.redhat.com/browse/RHEL-21456

commit 8fea6b7ff574dd4e04364de8c2cdfc2f2b7d47c2
Author: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Date: Tue, 2 Apr 2024 10:51:12 +0100

    Amba bus core already sets owner, so driver does not need to.

    Link: https://lore.kernel.org/r/20240326-module-owner-amba-v1-5-4517b091385b@linaro.org

    Acked-by: Suzuki K Poulose <suzuki.poulose@arm.com>
    Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>

Signed-off-by: Mark Salter <msalter@redhat.com>
2025-01-04 13:51:16 -05:00
Mark Salter 94a7c43327 ARM: 9376/1: coresight: tpdm: drop owner assignment
JIRA: https://issues.redhat.com/browse/RHEL-21456

commit 87ef18443e24cac1aaa78ffcf16fce991ed246da
Author: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Date: Tue, 2 Apr 2024 10:51:19 +0100

    Amba bus core already sets owner, so driver does not need to.

    Link: https://lore.kernel.org/r/20240326-module-owner-amba-v1-12-4517b091385b@linaro.org

    Acked-by: Suzuki K Poulose <suzuki.poulose@arm.com>
    Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>

Signed-off-by: Mark Salter <msalter@redhat.com>
2025-01-04 13:51:15 -05:00
Mark Salter a204e6b0d8 ARM: 9375/1: coresight: stm: drop owner assignment
JIRA: https://issues.redhat.com/browse/RHEL-21456

commit 60bf16d824fb5623e5a721ae7d458048b4bcbd0f
Author: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Date: Tue, 2 Apr 2024 10:51:16 +0100

    Amba bus core already sets owner, so driver does not need to.

    Link: https://lore.kernel.org/r/20240326-module-owner-amba-v1-9-4517b091385b@linaro.org

    Acked-by: Suzuki K Poulose <suzuki.poulose@arm.com>
    Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>

Signed-off-by: Mark Salter <msalter@redhat.com>
2025-01-04 13:51:15 -05:00
Mark Salter 17c96f0f86 ARM: 9374/1: coresight: etb10: drop owner assignment
JIRA: https://issues.redhat.com/browse/RHEL-21456

commit a0c50b9bd932139e7f2bc7e8851a446e5e8a4392
Author: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Date: Tue, 2 Apr 2024 10:51:15 +0100

    Amba bus core already sets owner, so driver does not need to.

    Link: https://lore.kernel.org/r/20240326-module-owner-amba-v1-8-4517b091385b@linaro.org

    Acked-by: Suzuki K Poulose <suzuki.poulose@arm.com>
    Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>

Signed-off-by: Mark Salter <msalter@redhat.com>
2025-01-04 13:51:15 -05:00
Mark Salter 888e77c37a ARM: 9373/1: coresight: funnel: drop owner assignment
JIRA: https://issues.redhat.com/browse/RHEL-21456

commit 7ebc2eefdc3c4a913df05fedf784bd0a81daf1cb
Author: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Date: Tue, 2 Apr 2024 10:51:13 +0100

    Amba bus core already sets owner, so driver does not need to.

    Link: https://lore.kernel.org/r/20240326-module-owner-amba-v1-6-4517b091385b@linaro.org

    Acked-by: Suzuki K Poulose <suzuki.poulose@arm.com>
    Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>

Signed-off-by: Mark Salter <msalter@redhat.com>
2025-01-04 13:51:15 -05:00
Mark Salter aa0f5f887d ARM: 9371/1: coresight: cti: drop owner assignment
JIRA: https://issues.redhat.com/browse/RHEL-21456

commit 862acebd11861996dc90a45caacb4b95332841de
Author: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Date: Tue, 2 Apr 2024 10:51:09 +0100

    Amba bus core already sets owner, so driver does not need to.

    Link: https://lore.kernel.org/r/20240326-module-owner-amba-v1-2-4517b091385b@linaro.org

    Acked-by: Suzuki K Poulose <suzuki.poulose@arm.com>
    Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>

Signed-off-by: Mark Salter <msalter@redhat.com>
2025-01-04 13:51:15 -05:00
Mark Salter aa879b5ea9 ARM: 9366/1: coresight: tpiu: drop owner assignment
JIRA: https://issues.redhat.com/browse/RHEL-21456

commit 57c7aa7ef2d7cce9c4d59dc10c162d371e78b9f7
Author: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Date: Tue, 2 Apr 2024 10:51:20 +0100

    Amba bus core already sets owner, so driver does not need to.

    Link: https://lore.kernel.org/r/20240326-module-owner-amba-v1-13-4517b091385b@linaro.org

    Acked-by: Suzuki K Poulose <suzuki.poulose@arm.com>
    Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>

Signed-off-by: Mark Salter <msalter@redhat.com>
2025-01-04 13:51:15 -05:00
Mark Salter 99e3101db2 ARM: 9365/1: coresight: tmc: drop owner assignment
JIRA: https://issues.redhat.com/browse/RHEL-21456

commit a257144055b40cd0e756bb29dbf8eaed9c4b303b
Author: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Date: Tue, 2 Apr 2024 10:51:17 +0100

    Amba bus core already sets owner, so driver does not need to.

    Link: https://lore.kernel.org/r/20240326-module-owner-amba-v1-10-4517b091385b@linaro.org

    Acked-by: Suzuki K Poulose <suzuki.poulose@arm.com>
    Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>

Signed-off-by: Mark Salter <msalter@redhat.com>
2025-01-04 13:51:15 -05:00
Mark Salter 6f80e43839 ARM: 9364/1: coresight: replicator: drop owner assignment
JIRA: https://issues.redhat.com/browse/RHEL-21456

commit 90b5ec20e7204511f70f52eaa3dc7a6e5a6c2bbf
Author: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Date: Tue, 2 Apr 2024 10:51:14 +0100

    Amba bus core already sets owner, so driver does not need to.

    Link: https://lore.kernel.org/r/20240326-module-owner-amba-v1-7-4517b091385b@linaro.org

    Acked-by: Suzuki K Poulose <suzuki.poulose@arm.com>
    Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>

Signed-off-by: Mark Salter <msalter@redhat.com>
2025-01-04 13:51:15 -05:00
Mark Salter ea19590030 ARM: 9363/1: coresight: etm3x: drop owner assignment
JIRA: https://issues.redhat.com/browse/RHEL-21456

commit 152a7a4c4dc10270b7e95fe38527d66bd9dd2887
Author: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Date: Tue, 2 Apr 2024 10:51:11 +0100

    Amba bus core already sets owner, so driver does not need to.

    Link: https://lore.kernel.org/r/20240326-module-owner-amba-v1-4-4517b091385b@linaro.org

    Acked-by: Suzuki K Poulose <suzuki.poulose@arm.com>
    Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>

Signed-off-by: Mark Salter <msalter@redhat.com>
2025-01-04 13:51:15 -05:00
Mark Salter 8e6f92044a ARM: 9362/1: coresight: catu: drop owner assignment
JIRA: https://issues.redhat.com/browse/RHEL-21456

commit 45745c84a7615c436a1a16d8643959a9c2bd72c9
Author: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Date: Tue, 2 Apr 2024 10:51:10 +0100

    Amba bus core already sets owner, so driver does not need to.

    Link: https://lore.kernel.org/r/20240326-module-owner-amba-v1-3-4517b091385b@linaro.org

    Acked-by: Suzuki K Poulose <suzuki.poulose@arm.com>
    Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>

Signed-off-by: Mark Salter <msalter@redhat.com>
2025-01-04 13:51:15 -05:00
Mark Salter 4d28dc14ce coresight-tpda: Change qcom,dsb-element-size to qcom,dsb-elem-bits
JIRA: https://issues.redhat.com/browse/RHEL-21456

commit a4f3057d19ffe1f5a7b9320303471a6725f11379
Author: Mao Jinlong <quic_jinlmao@quicinc.com>
Date: Sun, 18 Feb 2024 01:43:20 -0800

    Change qcom,dsb-element-size to qcom,dsb-elem-bits as the unit is bit.
    When use "-bits" suffix, the type of the property is u32 from
    property-units.yaml, so use fwnode_property_read_u32 to read the
    property.

    Fixes: 57e7235aa1d1 ("coresight-tpda: Add DSB dataset support")
    Signed-off-by: Mao Jinlong <quic_jinlmao@quicinc.com>
    Link: https://lore.kernel.org/r/20240218094322.22470-3-quic_jinlmao@quicinc.com
    Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>

Signed-off-by: Mark Salter <msalter@redhat.com>
2025-01-04 13:51:15 -05:00