1. 08 2月, 2021 2 次提交
  2. 12 1月, 2021 1 次提交
    • A
      coresight: remove broken __exit annotations · 8ffe693a
      Arnd Bergmann 提交于
      stable inclusion
      from stable-5.10.4
      commit 939b32e18e8b6fd2435f1d02709ec872d795124f
      bugzilla: 46903
      
      --------------------------------
      
      [ Upstream commit 45fe7bef ]
      
      Functions that are annotated __exit are discarded for built-in drivers,
      but the .remove callback in a device driver must still be kept around
      to allow bind/unbind operations.
      
      There is now a linker warning for the discarded symbol references:
      
      `tmc_remove' referenced in section `.data' of drivers/hwtracing/coresight/coresight-tmc-core.o: defined in discarded section `.exit.text' of drivers/hwtracing/coresight/coresight-tmc-core.o
      `tpiu_remove' referenced in section `.data' of drivers/hwtracing/coresight/coresight-tpiu.o: defined in discarded section `.exit.text' of drivers/hwtracing/coresight/coresight-tpiu.o
      `etb_remove' referenced in section `.data' of drivers/hwtracing/coresight/coresight-etb10.o: defined in discarded section `.exit.text' of drivers/hwtracing/coresight/coresight-etb10.o
      `static_funnel_remove' referenced in section `.data' of drivers/hwtracing/coresight/coresight-funnel.o: defined in discarded section `.exit.text' of drivers/hwtracing/coresight/coresight-funnel.o
      `dynamic_funnel_remove' referenced in section `.data' of drivers/hwtracing/coresight/coresight-funnel.o: defined in discarded section `.exit.text' of drivers/hwtracing/coresight/coresight-funnel.o
      `static_replicator_remove' referenced in section `.data' of drivers/hwtracing/coresight/coresight-replicator.o: defined in discarded section `.exit.text' of drivers/hwtracing/coresight/coresight-replicator.o
      `dynamic_replicator_remove' referenced in section `.data' of drivers/hwtracing/coresight/coresight-replicator.o: defined in discarded section `.exit.text' of drivers/hwtracing/coresight/coresight-replicator.o
      `catu_remove' referenced in section `.data' of drivers/hwtracing/coresight/coresight-catu.o: defined in discarded section `.exit.text' of drivers/hwtracing/coresight/coresight-catu.o
      
      Remove all those annotations.
      
      Fixes: 8b0cf826 ("coresight: stm: Allow to build coresight-stm as a module")
      Reviewed-by: NStephen Boyd <swboyd@chromium.org>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NMathieu Poirier <mathieu.poirier@linaro.org>
      Link: https://lore.kernel.org/r/20201208182651.1597945-3-mathieu.poirier@linaro.orgSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      Signed-off-by: NChen Jun <chenjun102@huawei.com>
      Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
      8ffe693a
  3. 07 1月, 2021 9 次提交
  4. 30 10月, 2020 2 次提交
    • S
      coresight: cti: Initialize dynamic sysfs attributes · 80624263
      Suzuki K Poulose 提交于
      With LOCKDEP enabled, CTI driver triggers the following splat due
      to uninitialized lock class for dynamically allocated attribute
      objects.
      
      [    5.372901] coresight etm0: CPU0: ETM v4.0 initialized
      [    5.376694] coresight etm1: CPU1: ETM v4.0 initialized
      [    5.380785] coresight etm2: CPU2: ETM v4.0 initialized
      [    5.385851] coresight etm3: CPU3: ETM v4.0 initialized
      [    5.389808] BUG: key ffff00000564a798 has not been registered!
      [    5.392456] ------------[ cut here ]------------
      [    5.398195] DEBUG_LOCKS_WARN_ON(1)
      [    5.398233] WARNING: CPU: 1 PID: 32 at kernel/locking/lockdep.c:4623 lockdep_init_map_waits+0x14c/0x260
      [    5.406149] Modules linked in:
      [    5.415411] CPU: 1 PID: 32 Comm: kworker/1:1 Not tainted 5.9.0-12034-gbbe85027 #51
      [    5.418553] Hardware name: Qualcomm Technologies, Inc. APQ 8016 SBC (DT)
      [    5.426453] Workqueue: events amba_deferred_retry_func
      [    5.433299] pstate: 40000005 (nZcv daif -PAN -UAO -TCO BTYPE=--)
      [    5.438252] pc : lockdep_init_map_waits+0x14c/0x260
      [    5.444410] lr : lockdep_init_map_waits+0x14c/0x260
      [    5.449007] sp : ffff800012bbb720
      ...
      
      [    5.531561] Call trace:
      [    5.536847]  lockdep_init_map_waits+0x14c/0x260
      [    5.539027]  __kernfs_create_file+0xa8/0x1c8
      [    5.543539]  sysfs_add_file_mode_ns+0xd0/0x208
      [    5.548054]  internal_create_group+0x118/0x3c8
      [    5.552307]  internal_create_groups+0x58/0xb8
      [    5.556733]  sysfs_create_groups+0x2c/0x38
      [    5.561160]  device_add+0x2d8/0x768
      [    5.565148]  device_register+0x28/0x38
      [    5.568537]  coresight_register+0xf8/0x320
      [    5.572358]  cti_probe+0x1b0/0x3f0
      
      ...
      
      Fix this by initializing the attributes when they are allocated.
      
      Fixes: 3c5597e3 ("coresight: cti: Add connection information to sysfs")
      Reported-by: NLeo Yan <leo.yan@linaro.org>
      Tested-by: NLeo Yan <leo.yan@linaro.org>
      Cc: Mike Leach <mike.leach@linaro.org>
      Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
      Signed-off-by: NSuzuki K Poulose <suzuki.poulose@arm.com>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NMathieu Poirier <mathieu.poirier@linaro.org>
      Link: https://lore.kernel.org/r/20201029164559.1268531-2-mathieu.poirier@linaro.orgSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      80624263
    • M
      coresight: Fix uninitialised pointer bug in etm_setup_aux() · 39a7661d
      Mike Leach 提交于
      Commit [bb1860ef] changed the sink handling code introducing an
      uninitialised pointer bug. This results in the default sink selection
      failing.
      
      Prior to commit:
      
      static void etm_setup_aux(...)
      
      <snip>
              struct coresight_device *sink;
      <snip>
      
              /* First get the selected sink from user space. */
              if (event->attr.config2) {
                      id = (u32)event->attr.config2;
                      sink = coresight_get_sink_by_id(id);
              } else {
                      sink = coresight_get_enabled_sink(true);
              }
      <ctd>
      
      *sink always initialised - possibly to NULL which triggers the
      automatic sink selection.
      
      After commit:
      
      static void etm_setup_aux(...)
      
      <snip>
              struct coresight_device *sink;
      <snip>
      
              /* First get the selected sink from user space. */
              if (event->attr.config2) {
                      id = (u32)event->attr.config2;
                      sink = coresight_get_sink_by_id(id);
              }
      <ctd>
      
      *sink pointer uninitialised when not providing a sink on the perf command
      line. This breaks later checks to enable automatic sink selection.
      
      Fixes: bb1860ef ("coresight: etm: perf: Sink selection using sysfs is deprecated")
      Signed-off-by: NMike Leach <mike.leach@linaro.org>
      Signed-off-by: NMathieu Poirier <mathieu.poirier@linaro.org>
      Link: https://lore.kernel.org/r/20201029164559.1268531-3-mathieu.poirier@linaro.orgSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      39a7661d
  5. 29 10月, 2020 1 次提交
  6. 05 10月, 2020 5 次提交
  7. 29 9月, 2020 20 次提交