1. 28 11月, 2020 1 次提交
  2. 29 10月, 2020 1 次提交
  3. 29 9月, 2020 9 次提交
  4. 18 9月, 2020 1 次提交
  5. 21 7月, 2020 1 次提交
  6. 19 5月, 2020 4 次提交
  7. 21 3月, 2020 3 次提交
  8. 05 11月, 2019 2 次提交
    • Y
      coresight: Serialize enabling/disabling a link device. · edda32da
      Yabin Cui 提交于
      When tracing etm data of multiple threads on multiple cpus through perf
      interface, some link devices are shared between paths of different cpus.
      It creates race conditions when different cpus wants to enable/disable
      the same link device at the same time.
      
      Example 1:
      Two cpus want to enable different ports of a coresight funnel, thus
      calling the funnel enable operation at the same time. But the funnel
      enable operation isn't reentrantable.
      
      Example 2:
      For an enabled coresight dynamic replicator with refcnt=1, one cpu wants
      to disable it, while another cpu wants to enable it. Ideally we still have
      an enabled replicator with refcnt=1 at the end. But in reality the result
      is uncertain.
      
      Since coresight devices claim themselves when enabled for self-hosted
      usage, the race conditions above usually make the link devices not usable
      after many cycles.
      
      To fix the race conditions, this patch uses spinlocks to serialize
      enabling/disabling link devices.
      
      Fixes: a06ae860 ("coresight: add CoreSight core layer framework")
      Signed-off-by: NYabin Cui <yabinc@google.com>
      Signed-off-by: NMathieu Poirier <mathieu.poirier@linaro.org>
      Cc: stable <stable@vger.kernel.org> # 5.3
      Link: https://lore.kernel.org/r/20191104181251.26732-14-mathieu.poirier@linaro.orgSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      edda32da
    • A
      coresight: etm4x: Save/restore state across CPU low power states · f188b5e7
      Andrew Murray 提交于
      Some hardware will ignore bit TRCPDCR.PU which is used to signal
      to hardware that power should not be removed from the trace unit.
      Let's mitigate against this by conditionally saving and restoring
      the trace unit state when the CPU enters low power states.
      
      This patchset introduces a firmware property named
      'arm,coresight-loses-context-with-cpu' - when this is present the
      hardware state will be conditionally saved and restored.
      
      A module parameter 'pm_save_enable' is also introduced which can
      be configured to override the firmware property. This can be set
      to never allow save/restore or to conditionally allow it (only for
      self-hosted). The default value is determined by firmware.
      
      We avoid saving the hardware state when self-hosted coresight isn't
      in use to reduce PM latency - we can't determine this by reading the
      claim tags (TRCCLAIMCLR) as these are 'trace' registers which need
      power and clocking, something we can't easily provide in the PM
      context. Therefore we rely on the existing drvdata->mode internal
      state that is set when self-hosted coresight is used (and powered).
      Signed-off-by: NAndrew Murray <andrew.murray@arm.com>
      Reviewed-by: NSuzuki K Poulose <suzuki.poulose@arm.com>
      Signed-off-by: NMathieu Poirier <mathieu.poirier@linaro.org>
      Link: https://lore.kernel.org/r/20191104181251.26732-2-mathieu.poirier@linaro.orgSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f188b5e7
  9. 30 7月, 2019 1 次提交
  10. 24 6月, 2019 1 次提交
    • S
      bus_find_device: Unify the match callback with class_find_device · 418e3ea1
      Suzuki K Poulose 提交于
      There is an arbitrary difference between the prototypes of
      bus_find_device() and class_find_device() preventing their callers
      from passing the same pair of data and match() arguments to both of
      them, which is the const qualifier used in the prototype of
      class_find_device().  If that qualifier is also used in the
      bus_find_device() prototype, it will be possible to pass the same
      match() callback function to both bus_find_device() and
      class_find_device(), which will allow some optimizations to be made in
      order to avoid code duplication going forward.  Also with that, constify
      the "data" parameter as it is passed as a const to the match function.
      
      For this reason, change the prototype of bus_find_device() to match
      the prototype of class_find_device() and adjust its callers to use the
      const qualifier in accordance with the new prototype of it.
      
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andrew Lunn <andrew@lunn.ch>
      Cc: Andreas Noever <andreas.noever@gmail.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Cc: Corey Minyard <minyard@acm.org>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: David Kershner <david.kershner@unisys.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Felipe Balbi <balbi@kernel.org>
      Cc: Frank Rowand <frowand.list@gmail.com>
      Cc: Grygorii Strashko <grygorii.strashko@ti.com>
      Cc: Harald Freudenberger <freude@linux.ibm.com>
      Cc: Hartmut Knaack <knaack.h@gmx.de>
      Cc: Heiko Stuebner <heiko@sntech.de>
      Cc: Jason Gunthorpe <jgg@ziepe.ca>
      Cc: Jonathan Cameron <jic23@kernel.org>
      Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>
      Cc: Len Brown <lenb@kernel.org>
      Cc: Mark Brown <broonie@kernel.org>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Michael Jamet <michael.jamet@intel.com>
      Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
      Cc: Peter Oberparleiter <oberpar@linux.ibm.com>
      Cc: Sebastian Ott <sebott@linux.ibm.com>
      Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
      Cc: Yehezkel Bernat <YehezkelShB@gmail.com>
      Cc: rafael@kernel.org
      Acked-by: NCorey Minyard <minyard@acm.org>
      Acked-by: NDavid Kershner <david.kershner@unisys.com>
      Acked-by: NMark Brown <broonie@kernel.org>
      Acked-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
      Acked-by: Wolfram Sang <wsa@the-dreams.de> # for the I2C parts
      Acked-by: NRob Herring <robh@kernel.org>
      Signed-off-by: NSuzuki K Poulose <suzuki.poulose@arm.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      418e3ea1
  11. 20 6月, 2019 6 次提交
  12. 26 4月, 2019 3 次提交
  13. 08 2月, 2019 2 次提交
  14. 06 2月, 2019 2 次提交
    • M
      coresight: Use event attributes for sink selection · 22644392
      Mathieu Poirier 提交于
      This patch uses the information conveyed by perf_event::attr::config2
      to select a sink to use for the session.  That way a sink can easily be
      selected to be used by more than one source, something that isn't currently
      possible with the sysfs implementation.
      Signed-off-by: NMathieu Poirier <mathieu.poirier@linaro.org>
      Reviewed-by: NSuzuki K Poulose <suzuki.poulose@arm.com>
      Acked-by: NPeter Zijlstra <peterz@infradead.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-s390@vger.kernel.org
      Link: http://lkml.kernel.org/r/20190131184714.20388-4-mathieu.poirier@linaro.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      22644392
    • M
      coresight: perf: Add "sinks" group to PMU directory · bb8e370b
      Mathieu Poirier 提交于
      Add a "sinks" directory entry so that users can see all the sinks
      available in the system in a single place.  Individual sink are added
      as they are registered with the coresight bus.
      
      Committer tests:
      
      Test built on a ubuntu 18.04 container with a cross build environment to
      arm64, the new field is there, need to find a machine with this feature
      to do further testing in the future.
      
        root@d15263e5734a:/git/perf# grep CORESIGHT /tmp/build/v5.0-rc2+/.config
        CONFIG_CORESIGHT=y
        CONFIG_CORESIGHT_LINKS_AND_SINKS=y
        CONFIG_CORESIGHT_LINK_AND_SINK_TMC=y
        CONFIG_CORESIGHT_CATU=y
        CONFIG_CORESIGHT_SINK_TPIU=y
        CONFIG_CORESIGHT_SINK_ETBV10=y
        CONFIG_CORESIGHT_SOURCE_ETM4X=y
        CONFIG_CORESIGHT_DYNAMIC_REPLICATOR=y
        CONFIG_CORESIGHT_STM=y
        CONFIG_CORESIGHT_CPU_DEBUG=m
        root@d15263e5734a:/git/perf#
        root@d15263e5734a:/git/perf# file /tmp/build/v5.0-rc2+/drivers/hwtracing/coresight/*.o
        .../coresight/coresight-catu.o:               ELF 64-bit MSB relocatable, ARM aarch64, version 1 (SYSV), not stripped
        .../coresight/coresight-cpu-debug.mod.o:      ELF 64-bit MSB relocatable, ARM aarch64, version 1 (SYSV), not stripped
        .../coresight/coresight-cpu-debug.o:          ELF 64-bit MSB relocatable, ARM aarch64, version 1 (SYSV), not stripped
        .../coresight/coresight-dynamic-replicator.o: ELF 64-bit MSB relocatable, ARM aarch64, version 1 (SYSV), not stripped
        .../coresight/coresight-etb10.o:              ELF 64-bit MSB relocatable, ARM aarch64, version 1 (SYSV), not stripped
        .../coresight/coresight-etm-perf.o:           ELF 64-bit MSB relocatable, ARM aarch64, version 1 (SYSV), not stripped
        .../coresight/coresight-etm4x-sysfs.o:        ELF 64-bit MSB relocatable, ARM aarch64, version 1 (SYSV), not stripped
        .../coresight/coresight-etm4x.o:              ELF 64-bit MSB relocatable, ARM aarch64, version 1 (SYSV), not stripped
        .../coresight/coresight-funnel.o:             ELF 64-bit MSB relocatable, ARM aarch64, version 1 (SYSV), not stripped
        .../coresight/coresight-replicator.o:         ELF 64-bit MSB relocatable, ARM aarch64, version 1 (SYSV), not stripped
        .../coresight/coresight-stm.o:                ELF 64-bit MSB relocatable, ARM aarch64, version 1 (SYSV), not stripped
        .../coresight/coresight-tmc-etf.o:            ELF 64-bit MSB relocatable, ARM aarch64, version 1 (SYSV), not stripped
        .../coresight/coresight-tmc-etr.o:            ELF 64-bit MSB relocatable, ARM aarch64, version 1 (SYSV), not stripped
        .../coresight/coresight-tmc.o:                ELF 64-bit MSB relocatable, ARM aarch64, version 1 (SYSV), not stripped
        .../coresight/coresight-tpiu.o:               ELF 64-bit MSB relocatable, ARM aarch64, version 1 (SYSV), not stripped
        .../coresight/coresight.o:                    ELF 64-bit MSB relocatable, ARM aarch64, version 1 (SYSV), not stripped
        .../coresight/of_coresight.o:                 ELF 64-bit MSB relocatable, ARM aarch64, version 1 (SYSV), not stripped
        root@d15263e5734a:/git/perf#
      
        root@d15263e5734a:/git/perf# pahole -C coresight_device /tmp/build/v5.0-rc2+/drivers/hwtracing/coresight/coresight.o
        struct coresight_device {
                struct coresight_connection * conns;             /*     0     8 */
                int                        nr_inport;            /*     8     4 */
                int                        nr_outport;           /*    12     4 */
                enum coresight_dev_type    type;                 /*    16     4 */
                union coresight_dev_subtype subtype;             /*    20     8 */
      
                /* XXX 4 bytes hole, try to pack */
      
                const struct coresight_ops  * ops;               /*    32     8 */
                struct device              dev;                  /*    40  1408 */
      
                /* XXX last struct has 7 bytes of padding */
      
                /* --- cacheline 22 boundary (1408 bytes) was 40 bytes ago --- */
                atomic_t *                 refcnt;               /*  1448     8 */
                bool                       orphan;               /*  1456     1 */
                bool                       enable;               /*  1457     1 */
                bool                       activated;            /*  1458     1 */
      
                /* XXX 5 bytes hole, try to pack */
      
                struct dev_ext_attribute * ea;                   /*  1464     8 */
      
                /* size: 1472, cachelines: 23, members: 12 */
                /* sum members: 1463, holes: 2, sum holes: 9 */
                /* paddings: 1, sum paddings: 7 */
        };
        root@d15263e5734a:/git/perf#
      Signed-off-by: NMathieu Poirier <mathieu.poirier@linaro.org>
      Reviewed-by: NSuzuki K Poulose <suzuki.poulose@arm.com>
      Acked-by: NPeter Zijlstra <peterz@infradead.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-s390@vger.kernel.org
      Link: http://lkml.kernel.org/r/20190131184714.20388-3-mathieu.poirier@linaro.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      bb8e370b
  15. 26 9月, 2018 3 次提交
    • S
      coresight: Add support for CLAIM tag protocol · 2478a6ae
      Suzuki K Poulose 提交于
      Coresight architecture defines CLAIM tags for a device to negotiate
      control of the components (external agent vs self-hosted). Each device
      has a pair of registers (CLAIMSET & CLAIMCLR) for managing the CLAIM
      tags. However, the protocol for the CLAIM tags is IMPLEMENTATION DEFINED.
      PSCI has recommendations for the use of the CLAIM tags to negotiate
      controls for external agent vs self-hosted use. This patch implements
      the recommended protocol by PSCI.
      
      The claim/disclaim operations are performed from the device specific
      drivers. The disadvantage is that the calls are sprinkled in each driver,
      but this makes the operation much simpler.
      
      Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
      Signed-off-by: NSuzuki K Poulose <suzuki.poulose@arm.com>
      Signed-off-by: NMathieu Poirier <mathieu.poirier@linaro.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2478a6ae
    • S
      coresight: Handle failures in enabling a trace path · b9866bb1
      Suzuki K Poulose 提交于
      coresight_enable_path() enables the components in a trace
      path from a given source to a sink, excluding the source.
      The operation is performed in the reverse order; the sink
      first and then backwards in the list. However, if we encounter
      an error in enabling any of the component, we simply disable
      all the components in the given path irrespective of whether
      we enabled some of the components in the enable iteration.
      This could interfere with another trace session if one of the
      link devices is turned off (e.g, TMC-ETF). So, we need to
      make sure that we only disable those components which were
      actually enabled from the iteration.
      
      This patch achieves the same by refactoring the coresight_disable_path
      to accept a "node" to start from in the forward order, which can
      then be used from the error path of coresight_enable_path().
      With this change, we don't issue a disable call back for a component
      which didn't get enabled. This change of behavior triggers
      a bug in coresight_enable_link(), where we leave the refcount
      on the device and will prevent the device from being enabled
      forever. So, we also drop the refcount in the coresight_enable_link()
      if the operation failed.
      
      Also, with the refactoring, we always start after the first node (which
      is the "SOURCE" device) for disabling the entire path. This implies,
      we must not find a "SOURCE" in the middle of the path. Hence, added
      a WARN_ON() to make sure the paths we get are sane, rather than
      simply ignoring them.
      
      Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
      Signed-off-by: NSuzuki K Poulose <suzuki.poulose@arm.com>
      Signed-off-by: NMathieu Poirier <mathieu.poirier@linaro.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b9866bb1
    • S
      coresight: perf: Remove set_buffer call back · 3d6e8935
      Suzuki K Poulose 提交于
      In coresight perf mode, we need to prepare the sink before
      starting a session, which is done via set_buffer call back.
      We then proceed to enable the tracing. If we fail to start
      the session successfully, we leave the sink configuration
      unchanged.  In order to make the operation atomic and to
      avoid yet another call back to clear the buffer, we get
      rid of the "set_buffer" call back and pass the buffer details
      via enable() call back to the sink.
      
      Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
      Signed-off-by: NSuzuki K Poulose <suzuki.poulose@arm.com>
      Signed-off-by: NMathieu Poirier <mathieu.poirier@linaro.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3d6e8935