--- zzzz-none-000/linux-4.19.183/drivers/firmware/psci.c 2021-03-24 10:07:39.000000000 +0000 +++ bcm63-7530ax-756/linux-4.19.183/drivers/firmware/psci.c 2023-06-28 08:54:19.000000000 +0000 @@ -46,6 +46,11 @@ #define PSCI_FN_NATIVE(version, name) PSCI_##version##_FN_##name #endif +#if defined(CONFIG_BCM_KF_ATF) +void __weak pmc_spin_lock(void) {} +void __weak pmc_spin_unlock(void) {} +#endif + /* * The CPU any Trusted OS is resident on. The trusted OS may reject CPU_OFF * calls to its resident CPU, so we must avoid issuing those. We never migrate @@ -180,8 +185,14 @@ int err; u32 fn; +#if defined(CONFIG_BCM_KF_ATF) + pmc_spin_lock(); +#endif fn = psci_function_id[PSCI_FN_CPU_ON]; err = invoke_psci_fn(fn, cpuid, entry_point, 0); +#if defined(CONFIG_BCM_KF_ATF) + pmc_spin_unlock(); +#endif return psci_to_linux_errno(err); }