1. 04 Apr, 2022 2 commits
    • Dmitry Baryshkov's avatar
      cpufreq: qcom-hw: fix the race between LMH worker and cpuhp · 5e4f009d
      Dmitry Baryshkov authored
      The driver would disable the worker when cpu is being put offline, but
      it happens closer to the end of cpufreq_offline(). The function
      qcom_lmh_dcvs_poll() can be running in parallel with this, when
      policy->cpus already has been updated. Read policy->related_cpus
      instead.
      
      [   37.122433] ------------[ cut here ]------------
      [   37.127225] WARNING: CPU: 0 PID: 187 at drivers/base/arch_topology.c:180 topology_update_thermal_pressure+0xec/0x100
      [   37.138098] Modules linked in:
      [   37.141279] CPU: 0 PID: 187 Comm: kworker/0:3 Tainted: G S                5.17.0-rc6-00389-g37c83d0b8710-dirty #713
      [   37.158306] Workqueue: events qcom_lmh_dcvs_poll
      [   37.163095] pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
      [   37.170278] pc : topology_update_thermal_pressure+0xec/0x100
      [   37.176131] lr : topology_update_thermal_pressure+0x20/0x100
      [   37.181977] sp : ffff800009b6bce0
      [   37.185402] x29: ffff800009b6bce0 x28: ffffd87abe92b000 x27: ffff04bd7292e205
      [   37.192792] x26: ffffd87abe930af8 x25: ffffd87abe94e4c8 x24: 0000000000000000
      [   37.200180] x23: ffff04bb01177018 x22: ffff04bb011770c0 x21: ffff04bb01177000
      [   37.207567] x20: ffff04bb0a419000 x19: 00000000000c4e00 x18: 0000000000000000
      [   37.214954] x17: 000000040044ffff x16: 004000b2b5503510 x15: 0000006aaa1326d2
      [   37.222333] x14: 0000000000000232 x13: 0000000000000001 x12: 0000000000000040
      [   37.229718] x11: ffff04bb00400000 x10: 968f57bd39f701c8 x9 : ffff04bb0acc8674
      [   37.237095] x8 : fefefefefefefeff x7 : 0000000000000018 x6 : ffffd87abd90092c
      [   37.244478] x5 : 0000000000000016 x4 : 0000000000000000 x3 : 0000000000000100
      [   37.251852] x2 : ffff04bb0a419020 x1 : 0000000000000100 x0 : 0000000000000100
      [   37.259235] Call trace:
      [   37.261771]  topology_update_thermal_pressure+0xec/0x100
      [   37.267266]  qcom_lmh_dcvs_poll+0xbc/0x154
      [   37.271505]  process_one_work+0x288/0x69c
      [   37.275654]  worker_thread+0x74/0x470
      [   37.279450]  kthread+0xfc/0x100
      [   37.282712]  ret_from_fork+0x10/0x20
      [   37.286417] irq event stamp: 74
      [   37.289664] hardirqs last  enabled at (73): [<ffffd87abdd78af4>] _raw_spin_unlock_irq+0x44/0x80
      [   37.298632] hardirqs last disabled at (74): [<ffffd87abdd71fc0>] __schedule+0x710/0xa10
      [   37.306885] softirqs last  enabled at (58): [<ffffd87abcc90410>] _stext+0x410/0x588
      [   37.314778] softirqs last disabled at (51): [<ffffd87abcd1bf68>] __irq_exit_rcu+0x158/0x174
      [   37.323386] ---[ end trace 0000000000000000 ]---
      
      Fixes: 275157b3 ("cpufreq: qcom-cpufreq-hw: Add dcvs interrupt support")
      Signed-off-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
      Reviewed-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
      Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      5e4f009d
    • Dmitry Baryshkov's avatar
      cpufreq: qcom-hw: drop affinity hint before freeing the IRQ · be5985b3
      Dmitry Baryshkov authored
      Drop affinity hint before freeing the throttling IRQ to fix the
      following trace:
      
      [  185.114773] ------------[ cut here ]------------
      [  185.119517] WARNING: CPU: 7 PID: 43 at kernel/irq/manage.c:1887 free_irq+0x3a4/0x3dc
      [  185.127474] Modules linked in:
      [  185.130618] CPU: 7 PID: 43 Comm: cpuhp/7 Tainted: G S      W         5.17.0-rc6-00386-g67382a5b705d-dirty #690
      [  185.147125] pstate: 604000c5 (nZCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
      [  185.154269] pc : free_irq+0x3a4/0x3dc
      [  185.158031] lr : free_irq+0x33c/0x3dc
      [  185.161792] sp : ffff80000841bc90
      [  185.165195] x29: ffff80000841bc90 x28: ffffa6edc5c3d000 x27: ffff6d93729e5908
      [  185.172515] x26: 0000000000000000 x25: ffff6d910109fc00 x24: ffff6d91011490e0
      [  185.179838] x23: ffff6d9101149218 x22: 0000000000000080 x21: 0000000000000000
      [  185.187163] x20: ffff6d9101149000 x19: ffff6d910ab61500 x18: ffffffffffffffff
      [  185.194487] x17: 2e35202020202020 x16: 2020202020202020 x15: ffff80008841b9a7
      [  185.201805] x14: 00000000000003c9 x13: 0000000000000001 x12: 0000000000000040
      [  185.209135] x11: ffff6d91005aab58 x10: ffff6d91005aab5a x9 : ffffc6a5ad1c5408
      [  185.216455] x8 : ffff6d91005adb88 x7 : 0000000000000000 x6 : ffffc6a5ab5a91f4
      [  185.223776] x5 : 0000000000000000 x4 : ffff6d91011490a8 x3 : ffffc6a5ad266108
      [  185.231098] x2 : 0000000013033204 x1 : ffff6d9101149000 x0 : ffff6d910a9cc000
      [  185.238421] Call trace:
      [  185.240932]  free_irq+0x3a4/0x3dc
      [  185.244334]  qcom_cpufreq_hw_cpu_exit+0x78/0xcc
      [  185.248985]  cpufreq_offline.isra.0+0x228/0x270
      [  185.253639]  cpuhp_cpufreq_offline+0x10/0x20
      [  185.258027]  cpuhp_invoke_callback+0x16c/0x2b0
      [  185.262592]  cpuhp_thread_fun+0x190/0x250
      [  185.266710]  smpboot_thread_fn+0x12c/0x230
      [  185.270914]  kthread+0xfc/0x100
      [  185.274145]  ret_from_fork+0x10/0x20
      [  185.277820] irq event stamp: 212
      [  185.281136] hardirqs last  enabled at (211): [<ffffc6a5ac57973c>] _raw_spin_unlock_irqrestore+0x8c/0xa0
      [  185.290775] hardirqs last disabled at (212): [<ffffc6a5ac572100>] __schedule+0x710/0xa10
      [  185.299081] softirqs last  enabled at (0): [<ffffc6a5ab50f7b0>] copy_process+0x7d0/0x1a14
      [  185.307475] softirqs last disabled at (0): [<0000000000000000>] 0x0
      
      Fixes: 3ed6dfbd ("cpufreq: qcom-hw: Set CPU affinity of dcvsh interrupts")
      Tested-by: default avatarVladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
      Reviewed-by: default avatarVladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
      Reviewed-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
      Signed-off-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
      Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      be5985b3
  2. 03 Apr, 2022 8 commits
  3. 02 Apr, 2022 30 commits