1. 29 10月, 2022 3 次提交
  2. 25 10月, 2022 2 次提交
  3. 24 10月, 2022 2 次提交
    • G
      Revert "coresight: cti: Fix hang in cti_disable_hw()" · d76308f0
      Greg Kroah-Hartman 提交于
      This reverts commit 665c157e.
      
      It causes reported build warnings:
      
      drivers/hwtracing/coresight/coresight-cti-core.c: In functio
      n 'cti_enable_hw':
      drivers/hwtracing/coresight/coresight-cti-core.c:93:24: warning: unused variable 'dev' [-Wunused-variable]
         93 |         struct device *dev = &drvdata->csdev->dev;
            |                        ^~~
      drivers/hwtracing/coresight/coresight-cti-core.c: In function 'cti_disable_hw':
      drivers/hwtracing/coresight/coresight-cti-core.c:154:24: warning: unused variable 'dev' [-Wunused-variable]
        154 |         struct device *dev = &drvdata->csdev->dev;
            |                        ^~~
      Reported-by: NStephen Rothwell <sfr@canb.auug.org.au>
      Cc: Aishwarya TCV <Aishwarya.TCV@arm.com>
      Cc: Cristian Marussi <Cristian.Marussi@arm.com>
      Cc: Suzuki Poulose <Suzuki.Poulose@arm.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Mike Leach <mike.leach@linaro.org>
      Cc: Mike Leach <mike.leach@linaro.org>
      Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
      Fixes: 665c157e ("coresight: cti: Fix hang in cti_disable_hw()")
      Link: https://lore.kernel.org/r/20221024135752.2b83af97@canb.auug.org.auSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d76308f0
    • G
      Merge tag 'iio-fixes-for-6.1a' of... · 39114b88
      Greg Kroah-Hartman 提交于
      Merge tag 'iio-fixes-for-6.1a' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into char-misc-linus
      
      Jonathan writes:
        "1st set of IIO fixes for the 6.1 cycle.
      
         Usual bunch of driver fixes + one set of fixes for driver bugs
         introduced by a core change to how buffer attributes are handled.
      
         - buffer attributes
           * Remove usage of IIO_CONST_ATTR() for buffer attributes in all drivers
             where this occurred as that broke wrapping code need to duplicate these
             for multiple buffer support. The minimal fix is moving to
             IIO_DEVICE_ATTR_RO() with separate _show() routines.  A cleanup of
             this code, preventing similar issues in future will follow next merge
             window.
         - tools/iio
           * Wrong handling of number of digits in the number 0.
         - adi,ltc2983
           * Avoid reallocating channels on each wake up from sleep by moving
             that step out of the ltc2983_setup() function.
         - microchip,mcp3911
           * Wrong ID bits + masking in debug prints.
           * Fix ARRAY_SIZE() vs sizeof() mix up.
           * Handle NULL return on trigger allocation failure correctly.
         - st,stm32-adc:
           * Ensure we initialize sampling time even when optional property not
             provided in DT. Internal channels require a minimum value that will
             not otherwise be set.
         - taos,tsl2583
           * Fix a double call of iio_device_unregister() via device managed and
             un-managed paths."
      
      * tag 'iio-fixes-for-6.1a' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio:
        iio: bmc150-accel-core: Fix unsafe buffer attributes
        iio: adxl367: Fix unsafe buffer attributes
        iio: adxl372: Fix unsafe buffer attributes
        iio: at91-sama5d2_adc: Fix unsafe buffer attributes
        iio: temperature: ltc2983: allocate iio channels once
        tools: iio: iio_utils: fix digit calculation
        iio: adc: stm32-adc: fix channel sampling time init
        iio: adc: mcp3911: mask out device ID in debug prints
        iio: adc: mcp3911: use correct id bits
        iio: adc: mcp3911: return proper error code on failure to allocate trigger
        iio: adc: mcp3911: fix sizeof() vs ARRAY_SIZE() bug
        iio: light: tsl2583: Fix module unloading
      39114b88
  4. 22 10月, 2022 1 次提交
  5. 21 10月, 2022 2 次提交
    • J
      coresight: cti: Fix hang in cti_disable_hw() · 665c157e
      James Clark 提交于
      cti_enable_hw() and cti_disable_hw() are called from an atomic context
      so shouldn't use runtime PM because it can result in a sleep when
      communicating with firmware.
      
      Since commit 3c665633 ("Revert "firmware: arm_scmi: Add clock
      management to the SCMI power domain""), this causes a hang on Juno when
      running the Perf Coresight tests or running this command:
      
        perf record -e cs_etm//u -- ls
      
      This was also missed until the revert commit because pm_runtime_put()
      was called with the wrong device until commit 692c9a49 ("coresight:
      cti: Correct the parameter for pm_runtime_put")
      
      With lock and scheduler debugging enabled the following is output:
      
         coresight cti_sys0: cti_enable_hw -- dev:cti_sys0  parent: 20020000.cti
         BUG: sleeping function called from invalid context at drivers/base/power/runtime.c:1151
         in_atomic(): 1, irqs_disabled(): 128, non_block: 0, pid: 330, name: perf-exec
         preempt_count: 2, expected: 0
         RCU nest depth: 0, expected: 0
         INFO: lockdep is turned off.
         irq event stamp: 0
         hardirqs last  enabled at (0): [<0000000000000000>] 0x0
         hardirqs last disabled at (0): [<ffff80000822b394>] copy_process+0xa0c/0x1948
         softirqs last  enabled at (0): [<ffff80000822b394>] copy_process+0xa0c/0x1948
         softirqs last disabled at (0): [<0000000000000000>] 0x0
         CPU: 3 PID: 330 Comm: perf-exec Not tainted 6.0.0-00053-g042116d99298 #7
         Hardware name: ARM LTD ARM Juno Development Platform/ARM Juno Development Platform, BIOS EDK II Sep 13 2022
         Call trace:
          dump_backtrace+0x134/0x140
          show_stack+0x20/0x58
          dump_stack_lvl+0x8c/0xb8
          dump_stack+0x18/0x34
          __might_resched+0x180/0x228
          __might_sleep+0x50/0x88
          __pm_runtime_resume+0xac/0xb0
          cti_enable+0x44/0x120
          coresight_control_assoc_ectdev+0xc0/0x150
          coresight_enable_path+0xb4/0x288
          etm_event_start+0x138/0x170
          etm_event_add+0x48/0x70
          event_sched_in.isra.122+0xb4/0x280
          merge_sched_in+0x1fc/0x3d0
          visit_groups_merge.constprop.137+0x16c/0x4b0
          ctx_sched_in+0x114/0x1f0
          perf_event_sched_in+0x60/0x90
          ctx_resched+0x68/0xb0
          perf_event_exec+0x138/0x508
          begin_new_exec+0x52c/0xd40
          load_elf_binary+0x6b8/0x17d0
          bprm_execve+0x360/0x7f8
          do_execveat_common.isra.47+0x218/0x238
          __arm64_sys_execve+0x48/0x60
          invoke_syscall+0x4c/0x110
          el0_svc_common.constprop.4+0xfc/0x120
          do_el0_svc+0x34/0xc0
          el0_svc+0x40/0x98
          el0t_64_sync_handler+0x98/0xc0
          el0t_64_sync+0x170/0x174
      
      Fix the issue by removing the runtime PM calls completely. They are not
      needed here because it must have already been done when building the
      path for a trace.
      
      Fixes: 835d722b ("coresight: cti: Initial CoreSight CTI Driver")
      Reported-by: NAishwarya TCV <Aishwarya.TCV@arm.com>
      Reported-by: NCristian Marussi <Cristian.Marussi@arm.com>
      Suggested-by: NSuzuki Poulose <Suzuki.Poulose@arm.com>
      Signed-off-by: NJames Clark <james.clark@arm.com>
      Reviewed-by: NMike Leach <mike.leach@linaro.org>
      Tested-by: NMike Leach <mike.leach@linaro.org>
      Signed-off-by: NSuzuki K Poulose <suzuki.poulose@arm.com>
      Link: https://lore.kernel.org/r/20221005131452.1506328-1-james.clark@arm.com
      665c157e
    • S
      coresight: Fix possible deadlock with lock dependency · 23722fb4
      Sudeep Holla 提交于
      With lockdeps enabled, we get the following warning:
      
      ======================================================
      WARNING: possible circular locking dependency detected
      ------------------------------------------------------
      kworker/u12:1/53 is trying to acquire lock:
      ffff80000adce220 (coresight_mutex){+.+.}-{4:4}, at: coresight_set_assoc_ectdev_mutex+0x3c/0x5c
      but task is already holding lock:
      ffff80000add1f60 (ect_mutex){+.+.}-{4:4}, at: cti_probe+0x318/0x394
      
      which lock already depends on the new lock.
      the existing dependency chain (in reverse order) is:
      
      -> #1 (ect_mutex){+.+.}-{4:4}:
             __mutex_lock_common+0xd8/0xe60
             mutex_lock_nested+0x44/0x50
             cti_add_assoc_to_csdev+0x4c/0x184
             coresight_register+0x2f0/0x314
             tmc_probe+0x33c/0x414
      
      -> #0 (coresight_mutex){+.+.}-{4:4}:
             __lock_acquire+0x1a20/0x32d0
             lock_acquire+0x160/0x308
             __mutex_lock_common+0xd8/0xe60
             mutex_lock_nested+0x44/0x50
             coresight_set_assoc_ectdev_mutex+0x3c/0x5c
             cti_update_conn_xrefs+0x6c/0xf8
             cti_probe+0x33c/0x394
      
      other info that might help us debug this:
       Possible unsafe locking scenario:
             CPU0                    CPU1
             ----                    ----
        lock(ect_mutex);
                                     lock(coresight_mutex);
                                     lock(ect_mutex);
        lock(coresight_mutex);
       *** DEADLOCK ***
      
      4 locks held by kworker/u12:1/53:
       #0: ((wq_completion)events_unbound){+.+.}-{0:0}, at: process_one_work+0x1fc/0x63c
       #1: (deferred_probe_work){+.+.}-{0:0}, at: process_one_work+0x228/0x63c
       #2: (&dev->mutex){....}-{4:4}, at: __device_attach+0x48/0x1a8
       #3: (ect_mutex){+.+.}-{4:4}, at: cti_probe+0x318/0x394
      
      To fix the same, call cti_add_assoc_to_csdev without the holding
      coresight_mutex and confine the locking while setting the associated
      ect / cti device using coresight_set_assoc_ectdev_mutex().
      
      Fixes: 177af828 ("coresight: cti: Enable CTI associated with devices")
      Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
      Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
      Cc: Mike Leach <mike.leach@linaro.org>
      Cc: Leo Yan <leo.yan@linaro.org>
      Signed-off-by: NSudeep Holla <sudeep.holla@arm.com>
      Reviewed-by: NMike Leach <mike.leach@linaro.org>
      Signed-off-by: NSuzuki K Poulose <suzuki.poulose@arm.com>
      Link: https://lore.kernel.org/r/20220721130329.3787211-1-sudeep.holla@arm.com
      23722fb4
  6. 17 10月, 2022 21 次提交
  7. 16 10月, 2022 5 次提交
  8. 15 10月, 2022 4 次提交