diff --git a/drivers/soc/rockchip/rk_fiq_debugger.c b/drivers/soc/rockchip/rk_fiq_debugger.c index f47fb56afb0c..e2c90030840c 100755 --- a/drivers/soc/rockchip/rk_fiq_debugger.c +++ b/drivers/soc/rockchip/rk_fiq_debugger.c @@ -378,8 +378,14 @@ static int rk_fiq_debugger_uart_dev_resume(struct platform_device *pdev) return 0; } -static int fiq_debugger_cpu_resume_fiq(struct notifier_block *nb, - unsigned long action, void *hcpu) +/* + * We don't need to migrate fiq before cpuidle, because EL3 can promise to + * resume all fiq configure. We don't want fiq to break kernel cpu_resume(), + * so that fiq would be disabled in EL3 on purpose when cpu resume. We enable + * it here since everything is okay. + */ +static int fiq_debugger_cpuidle_resume_fiq(struct notifier_block *nb, + unsigned long action, void *hcpu) { switch (action) { case CPU_PM_EXIT: @@ -394,8 +400,13 @@ static int fiq_debugger_cpu_resume_fiq(struct notifier_block *nb, return NOTIFY_OK; } -static int fiq_debugger_cpu_migrate_fiq(struct notifier_block *nb, - unsigned long action, void *hcpu) +/* + * We must migrate fiq before cpu offline, because EL3 doesn't promise to + * resume all fiq configure at this sisutation. Here, we migrate fiq to any + * online cpu. + */ +static int fiq_debugger_cpu_offine_migrate_fiq(struct notifier_block *nb, + unsigned long action, void *hcpu) { int target_cpu, cpu = (long)hcpu; @@ -415,12 +426,12 @@ static int fiq_debugger_cpu_migrate_fiq(struct notifier_block *nb, } static struct notifier_block fiq_debugger_pm_notifier = { - .notifier_call = fiq_debugger_cpu_resume_fiq, + .notifier_call = fiq_debugger_cpuidle_resume_fiq, .priority = 100, }; static struct notifier_block fiq_debugger_cpu_notifier = { - .notifier_call = fiq_debugger_cpu_migrate_fiq, + .notifier_call = fiq_debugger_cpu_offine_migrate_fiq, .priority = 100, };