From e6d758f352dcd93d4a724132df21dccb5f259b81 Mon Sep 17 00:00:00 2001 From: Joseph Chen Date: Thu, 3 May 2018 09:14:37 +0800 Subject: [PATCH] soc: rockchip: fiq debugger: rename notify callbacks 1. rename callbacks to make them more clearly to be understood; 2. add description for intention; Change-Id: Ic0e28aa98793495c01f531331e9d5dc816ee0820 Signed-off-by: Joseph Chen --- drivers/soc/rockchip/rk_fiq_debugger.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) 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, };