Skip to content

arch: Fix CPU on/off race condition and prevent device hang#7170

Open
ewoodev wants to merge 1 commit intoSamsung:masterfrom
ewoodev:WORK-260224_fix_cpu_onoff
Open

arch: Fix CPU on/off race condition and prevent device hang#7170
ewoodev wants to merge 1 commit intoSamsung:masterfrom
ewoodev:WORK-260224_fix_cpu_onoff

Conversation

@ewoodev
Copy link
Contributor

@ewoodev ewoodev commented Feb 24, 2026

When up_cpu_die is called via SGI3 but up_cpu_on fails, the system currently returns an error. This causes the scheduler to perceive the CPU as alive when it is actually dead. If up_cpu_off is called again in this state, the CPU receiving SGI3 is in die state, resulting in a deadlock.

Therefore, when up_cpu_down fails, up_cpu_on must be called again to reactivate the CPU.

Additionally, calling up_cpu_on twice leads to psci_cpu_on being invoked twice, which can cause device hang. To prevent this, psci_affinity_info is now used to check CPU state before calling psci_cpu_on.

When up_cpu_die is called via SGI3 but up_cpu_on fails, the system currently
returns an error. This causes the scheduler to perceive the CPU as alive when
it is actually dead. If up_cpu_off is called again in this state, the CPU
receiving SGI3 is in die state, resulting in a deadlock.

Therefore, when up_cpu_down fails, up_cpu_on must be called again to reactivate
the CPU.

Additionally, calling up_cpu_on twice leads to psci_cpu_on being invoked twice,
which can cause device hang. To prevent this, psci_affinity_info is now used to
check CPU state before calling psci_cpu_on.

Signed-off-by: eunwoo.nam <eunwoo.nam@samsung.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant