linux/drivers/soc
HariBabu Gattem daed80ed07 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>
2023-11-15 15:02:25 +01:00
..
amlogic pmdomain: amlogic: Move Kconfig options to the pmdomain subsystem 2023-09-20 10:08:45 +02:00
apple pmdomain: apple: Move Kconfig option to the pmdomain subsystem 2023-09-20 10:08:49 +02:00
aspeed soc/aspeed: Convert to platform remove callback returning void 2023-10-13 15:04:12 +10:30
atmel soc: microchip: Explicitly include correct DT includes 2023-07-29 16:54:29 +03:00
bcm SoC driver updates for 6.7 2023-11-01 14:46:51 -10:00
canaan soc: canaan: Make K210_SYSCTL depend on CLK_K210 2023-03-15 14:22:53 +00:00
dove soc: dove: add missing of_node_put 2023-09-20 11:28:02 +02:00
fsl powerpc updates for 6.7 2023-11-03 10:07:39 -10:00
fujitsu soc/fujitsu: a64fx-diag: Convert to platform remove callback returning void 2023-10-14 23:27:01 +02:00
gemini
hisilicon SoC driver updates for 6.7 2023-11-01 14:46:51 -10:00
imx - Move Kconfig files into the pmdomain subsystem 2023-11-01 13:09:46 -10:00
ixp4xx soc/ixp4xx: ixp4xx-qmgr: Convert to platform remove callback returning void 2023-10-14 23:27:13 +02:00
lantiq
litex soc/litex: litex_soc_ctrl: Convert to platform remove callback returning void 2023-10-14 23:27:17 +02:00
loongson Convert drivers/soc to struct platform_driver::remove_new() 2023-10-16 22:51:31 +02:00
mediatek SoC driver updates for 6.7 2023-11-01 14:46:51 -10:00
microchip soc/microchip: mpfs-sys-controller: Convert to platform remove callback returning void 2023-09-25 11:17:09 +01:00
nuvoton soc: nuvoton: Add SoC info driver for WPCM450 2023-02-01 17:11:36 +01:00
pxa soc/pxa: ssp: Convert to platform remove callback returning void 2023-10-14 23:27:34 +02:00
qcom SoC driver updates for 6.7 2023-11-01 14:46:51 -10:00
renesas SoC driver updates for 6.7 2023-11-01 14:46:51 -10:00
rockchip SoC driver updates for 6.7 2023-11-01 14:46:51 -10:00
samsung SoC driver updates for 6.7 2023-11-01 14:46:51 -10:00
sifive soc: sifive: replace SOC_FOO with ARCH_FOO 2023-09-18 10:33:32 +01:00
sunxi pmdomain: sunxi: Move Kconfig option to the pmdomain subsystem 2023-10-04 23:41:56 +02:00
tegra SoC driver updates for 6.7 2023-11-01 14:46:51 -10:00
ti SoC driver updates for 6.7 2023-11-01 14:46:51 -10:00
ux500 ARM: ux500: do not directly dereference __iomem 2022-11-08 21:13:56 +01:00
versatile
xilinx soc: xilinx: Fix for call trace due to the usage of smp_processor_id() 2023-11-15 15:02:25 +01:00
Kconfig pmdomain: starfive: Move Kconfig file to the pmdomain subsystem 2023-10-04 23:41:56 +02:00
Makefile HiSilicon driver updates for v6.6 2023-08-12 12:10:46 +02:00