|
@@ -852,37 +852,33 @@ static void smp_core99_setup_cpu(int cpu_nr)
|
|
|
|
|
|
#ifdef CONFIG_PPC64
|
|
|
#ifdef CONFIG_HOTPLUG_CPU
|
|
|
-static int smp_core99_cpu_notify(struct notifier_block *self,
|
|
|
- unsigned long action, void *hcpu)
|
|
|
+static unsigned int smp_core99_host_open;
|
|
|
+
|
|
|
+static int smp_core99_cpu_prepare(unsigned int cpu)
|
|
|
{
|
|
|
int rc;
|
|
|
|
|
|
- switch(action & ~CPU_TASKS_FROZEN) {
|
|
|
- case CPU_UP_PREPARE:
|
|
|
- /* Open i2c bus if it was used for tb sync */
|
|
|
- if (pmac_tb_clock_chip_host) {
|
|
|
- rc = pmac_i2c_open(pmac_tb_clock_chip_host, 1);
|
|
|
- if (rc) {
|
|
|
- pr_err("Failed to open i2c bus for time sync\n");
|
|
|
- return notifier_from_errno(rc);
|
|
|
- }
|
|
|
+ /* Open i2c bus if it was used for tb sync */
|
|
|
+ if (pmac_tb_clock_chip_host && !smp_core99_host_open) {
|
|
|
+ rc = pmac_i2c_open(pmac_tb_clock_chip_host, 1);
|
|
|
+ if (rc) {
|
|
|
+ pr_err("Failed to open i2c bus for time sync\n");
|
|
|
+ return notifier_from_errno(rc);
|
|
|
}
|
|
|
- break;
|
|
|
- case CPU_ONLINE:
|
|
|
- case CPU_UP_CANCELED:
|
|
|
- /* Close i2c bus if it was used for tb sync */
|
|
|
- if (pmac_tb_clock_chip_host)
|
|
|
- pmac_i2c_close(pmac_tb_clock_chip_host);
|
|
|
- break;
|
|
|
- default:
|
|
|
- break;
|
|
|
+ smp_core99_host_open = 1;
|
|
|
}
|
|
|
- return NOTIFY_OK;
|
|
|
+ return 0;
|
|
|
}
|
|
|
|
|
|
-static struct notifier_block smp_core99_cpu_nb = {
|
|
|
- .notifier_call = smp_core99_cpu_notify,
|
|
|
-};
|
|
|
+static int smp_core99_cpu_online(unsigned int cpu)
|
|
|
+{
|
|
|
+ /* Close i2c bus if it was used for tb sync */
|
|
|
+ if (pmac_tb_clock_chip_host && smp_core99_host_open) {
|
|
|
+ pmac_i2c_close(pmac_tb_clock_chip_host);
|
|
|
+ smp_core99_host_open = 0;
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
#endif /* CONFIG_HOTPLUG_CPU */
|
|
|
|
|
|
static void __init smp_core99_bringup_done(void)
|
|
@@ -902,7 +898,11 @@ static void __init smp_core99_bringup_done(void)
|
|
|
g5_phy_disable_cpu1();
|
|
|
}
|
|
|
#ifdef CONFIG_HOTPLUG_CPU
|
|
|
- register_cpu_notifier(&smp_core99_cpu_nb);
|
|
|
+ cpuhp_setup_state_nocalls(CPUHP_POWERPC_PMAC_PREPARE,
|
|
|
+ "powerpc/pmac:prepare", smp_core99_cpu_prepare,
|
|
|
+ NULL);
|
|
|
+ cpuhp_setup_state_nocalls(CPUHP_AP_ONLINE_DYN, "powerpc/pmac:online",
|
|
|
+ smp_core99_cpu_online, NULL);
|
|
|
#endif
|
|
|
|
|
|
if (ppc_md.progress)
|