Commit Graph

11 Commits

Author SHA1 Message Date
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 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
Mark Salter 611def6eea coresight-tpda: Add support to configure CMB element
JIRA: https://issues.redhat.com/browse/RHEL-21456

commit e6d7f5252f73cf21d3676de794916204524f51b5
Author: Tao Zhang <quic_taozha@quicinc.com>
Date: Sun, 4 Feb 2024 13:30:36 +0800

    Read the CMB element size from the device tree. Set the register
    bit that controls the CMB element size of the corresponding port.

    Reviewed-by: James Clark <james.clark@arm.com>
    Signed-off-by: Tao Zhang <quic_taozha@quicinc.com>
    Signed-off-by: Mao Jinlong <quic_jinlmao@quicinc.com>
    Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
    Link: https://lore.kernel.org/r/1707024641-22460-6-git-send-email-quic_taozha@quicinc.com

Signed-off-by: Mark Salter <msalter@redhat.com>
2025-01-04 13:51:14 -05:00
Mark Salter 84759040e0 coresight: Remove atomic type from refcnt
JIRA: https://issues.redhat.com/browse/RHEL-21456

commit 4545b38ef004a586295750ea49a505b6396a7c90
Author: James Clark <james.clark@arm.com>
Date: Mon, 29 Jan 2024 15:40:38 +0000

    Refcnt is only ever accessed from either inside the coresight_mutex, or
    the device's spinlock, making the atomic type and atomic_dec_return()
    calls confusing and unnecessary. The only point of synchronisation
    outside of these two types of locks is already done with a compare and
    swap on 'mode', which a comment has been added for.

    There was one instance of refcnt being used outside of a lock in TPIU,
    but that can easily be fixed by making it the same as all the other
    devices and adding a spinlock. Potentially in the future all the
    refcounting and locking can be moved up into the core code, and all the
    mostly duplicate code from the individual devices can be removed.

    Signed-off-by: James Clark <james.clark@arm.com>
    Link: https://lore.kernel.org/r/20240129154050.569566-8-james.clark@arm.com
    Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>

Signed-off-by: Mark Salter <msalter@redhat.com>
2025-01-04 13:51:14 -05:00
Mark Salter 79695cbc59 coresight: Remove the 'enable' field.
JIRA: https://issues.redhat.com/browse/RHEL-21456

commit d5e83f97eb5669bfdd894ec980083f65517df2fb
Author: James Clark <james.clark@arm.com>
Date: Mon, 29 Jan 2024 15:40:36 +0000

    'enable', which probably should have been 'enabled', is only ever read
    in the core code in relation to controlling sources, and specifically
    only sources in sysfs mode. Confusingly it's not labelled as such and
    relying on it can be a source of bugs like the one fixed by
    commit 078dbba3f0c9 ("coresight: Fix crash when Perf and sysfs modes are
    used concurrently").

    Most importantly, it can only be used when the coresight_mutex is held
    which is only done when enabling and disabling paths in sysfs mode, and
    not Perf mode. So to prevent its usage spreading and leaking out to
    other devices, remove it.

    It's use is equivalent to checking if the mode is currently sysfs, as
    due to the coresight_mutex lock, mode == CS_MODE_SYSFS can only become
    true or untrue when that lock is held, and when mode == CS_MODE_SYSFS
    the device is both enabled and in sysfs mode.

    The one place it was used outside of the core code is in TPDA, but that
    pattern is more appropriately represented using refcounts inside the
    device's own spinlock.

    Signed-off-by: James Clark <james.clark@arm.com>
    Link: https://lore.kernel.org/r/20240129154050.569566-6-james.clark@arm.com
    Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>

Signed-off-by: Mark Salter <msalter@redhat.com>
2025-01-04 13:51:14 -05:00
Mark Salter 388fd0d469 coresight: Fix uninitialized struct warnings
JIRA: https://issues.redhat.com/browse/RHEL-21456

commit 8a519235c3c37663e54e37a89d05a86c0a2c90c8
Author: James Clark <james.clark@arm.com>
Date: Thu, 23 Nov 2023 12:04:56 +0000

    These warnings would be hit with the following W=1 build change so
    initialize all structs properly.

    Signed-off-by: James Clark <james.clark@arm.com>
    Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
    Link: https://lore.kernel.org/r/20231123120459.287578-2-james.clark@arm.com

Signed-off-by: Mark Salter <msalter@redhat.com>
2025-01-04 13:51:13 -05:00
Mark Salter e68917a292 coresight-tpda: Add DSB dataset support
JIRA: https://issues.redhat.com/browse/RHEL-21456

commit 57e7235aa1d11d4ea8a25dfdc009b3ee463763af
Author: Tao Zhang <quic_taozha@quicinc.com>
Date: Thu, 28 Sep 2023 14:29:37 +0800

    Read the DSB element size from the device tree. Set the register
    bit that controls the DSB element size of the corresponding port.

    Signed-off-by: Tao Zhang <quic_taozha@quicinc.com>
    Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
    Link: https://lore.kernel.org/r/1695882586-10306-5-git-send-email-quic_taozha@quicinc.com

Signed-off-by: Mark Salter <msalter@redhat.com>
2025-01-04 13:51:12 -05:00
Mark Salter b8951cf340 coresight: Make refcount a property of the connection
JIRA: https://issues.redhat.com/browse/RHEL-21456

commit ae7f2b5a7b569f8ede4af9e215515e5a0b824edd
Author: James Clark <james.clark@arm.com>
Date: Tue, 25 Apr 2023 15:35:37 +0100

    This removes the need to do an additional lookup for the total number
    of ports used and also removes the need to allocate an array of
    refcounts which is just another representation of a connection array.

    This was only used for link type devices, for regular devices a single
    refcount on the coresight device is used.

    There is a both an input and output refcount in case two link type
    devices are connected together so that they don't overwrite each other's
    counts.

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

Signed-off-by: Mark Salter <msalter@redhat.com>
2025-01-04 13:51:09 -05:00
Mark Salter e7b661eaa2 coresight: tpda: fix return value check in tpda_probe()
JIRA: https://issues.redhat.com/browse/RHEL-21456

commit c88a15d9dd7dfabe2a13473fd1f9c4b9cd1b62c9
Author: Yang Yingliang <yangyingliang@huawei.com>
Date: Sun, 29 Jan 2023 16:42:46 +0800

    devm_ioremap_resource() never returns NULL pointer, it
    will return ERR_PTR() when it fails, so replace the check
    with IS_ERR().

    Fixes: 5b7916625c01 ("Coresight: Add TPDA link driver")
    Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
    [ Fix return value to the PTR_ERR(base) ]
    Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
    Link: https://lore.kernel.org/r/20230129084246.537694-1-yangyingliang@huawei.com

Signed-off-by: Mark Salter <msalter@redhat.com>
2025-01-04 13:51:08 -05:00
Mark Salter 1ae59b644e Coresight: tpda/tpdm: remove incorrect __exit annotation
JIRA: https://issues.redhat.com/browse/RHEL-21456

commit 0c1ccc158bbc4d14fe1a52e99f3933f34f309dac
Author: Arnd Bergmann <arnd@arndb.de>
Date: Thu, 26 Jan 2023 17:35:14 +0100

    'remove' callbacks get called whenever a device is unbound from
    the driver, which can get triggered from user space.

    Putting it into the __exit section means that the function gets
    dropped in for built-in drivers, as pointed out by this build
    warning:

    `tpda_remove' referenced in section `.data' of drivers/hwtracing/coresight/coresight-tpda.o: defined in discarded section `.exit.text' of drivers/hwtracing/coresight/coresight-tpda.o
    `tpdm_remove' referenced in section `.data' of drivers/hwtracing/coresight/coresight-tpdm.o: defined in discarded section `.exit.text' of drivers/hwtracing/coresight/coresight-tpdm.o

    Fixes: 5b7916625c01 ("Coresight: Add TPDA link driver")
    Fixes: b3c71626a933 ("Coresight: Add coresight TPDM source driver")
    Signed-off-by: Arnd Bergmann <arnd@arndb.de>
    Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
    Link: https://lore.kernel.org/r/20230126163530.3495413-1-arnd@kernel.org

Signed-off-by: Mark Salter <msalter@redhat.com>
2025-01-04 13:51:08 -05:00
Mark Salter af49b18e8d Coresight: Add TPDA link driver
JIRA: https://issues.redhat.com/browse/RHEL-21456

commit 5b7916625c017ef1bbea4092835740f9161ab7c9
Author: Mao Jinlong <quic_jinlmao@quicinc.com>
Date: Tue, 17 Jan 2023 06:57:05 -0800

    TPDA(Trace, Profiling and Diagnostics Aggregator) is
    to provide packetization, funneling and timestamping of
    TPDM data. Multiple monitors are connected to different
    input ports of TPDA.This change is to add tpda
    enable/disable/probe functions for coresight tpda driver.

     - - - -         - - - -        - - - -
    | TPDM 0|      | TPDM 1 |     | TPDM 2|
     - - - -         - - - -        - - - -
        |               |             |
        |_ _ _ _ _ _    |     _ _ _ _ |
                    |   |    |
                    |   |    |
               ------------------
              |        TPDA      |
               ------------------

    Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
    Signed-off-by: Tao Zhang <quic_taozha@quicinc.com>
    Signed-off-by: Mao Jinlong <quic_jinlmao@quicinc.com>
    Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
    Link: https://lore.kernel.org/r/20230120095301.30792-2-quic_jinlmao@quicinc.com

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