diff options
author | HariBabu Gattem <haribabu.gattem@xilinx.com> | 2023-10-26 22:56:22 -0700 |
---|---|---|
committer | Michal Simek <michal.simek@amd.com> | 2023-11-15 15:02:25 +0100 |
commit | daed80ed07580e5adc0e6d8bc79933a35154135a (patch) | |
tree | 1c2b6ff25ed7291973cb63f3c441fc8d7e8c43f9 /tools/perf/scripts/python/export-to-sqlite.py | |
parent | f1013d8405af0f4fe1812b5901cbac9ce4d1fb6f (diff) |
soc: xilinx: Fix for call trace due to the usage of smp_processor_id()
When preemption is enabled in kernel and if any task which can be
preempted should not use smp_processor_id() directly, since CPU
switch can happen at any time, the previous value of cpu_id
differs with current cpu_id. As a result we see the below call trace
during xlnx_event_manager_probe.
[ 6.140197] dump_backtrace+0x0/0x190
[ 6.143884] show_stack+0x18/0x40
[ 6.147220] dump_stack_lvl+0x7c/0xa0
[ 6.150907] dump_stack+0x18/0x34
[ 6.154241] check_preemption_disabled+0x124/0x134
[ 6.159068] debug_smp_processor_id+0x20/0x2c
[ 6.163453] xlnx_event_manager_probe+0x48/0x250
To protect cpu_id, It is recommended to use get_cpu()/put_cpu()
to disable preemption, get the cpu_id and enable preemption respectively.
(For Reference, Documentation/locking/preempt-locking.rst and
Documentation/kernel-hacking/hacking.rst)
Use preempt_disable()/smp_processor_id()/preempt_enable()
API's to achieve the same.
Signed-off-by: HariBabu Gattem <haribabu.gattem@xilinx.com>
Signed-off-by: Jay Buddhabhatti <jay.buddhabhatti@amd.com>
Link: https://lore.kernel.org/r/20231027055622.21544-1-jay.buddhabhatti@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
Diffstat (limited to 'tools/perf/scripts/python/export-to-sqlite.py')
0 files changed, 0 insertions, 0 deletions