aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-10-03 22:43:08 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-10-03 22:43:08 -0400
commit597f03f9d133e9837d00965016170271d4f87dcf (patch)
tree33bdb5c1104d5b466387f4ae98748c5f4ddd29bb /arch/powerpc/platforms
parent999dcbe2414e15e19cdc1f91497d01f262c6e1cf (diff)
parent0bf71e4d02ffec8ab9a6adecca61d3eed74fc99d (diff)
Merge branch 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull CPU hotplug updates from Thomas Gleixner: "Yet another batch of cpu hotplug core updates and conversions: - Provide core infrastructure for multi instance drivers so the drivers do not have to keep custom lists. - Convert custom lists to the new infrastructure. The block-mq custom list conversion comes through the block tree and makes the diffstat tip over to more lines removed than added. - Handle unbalanced hotplug enable/disable calls more gracefully. - Remove the obsolete CPU_STARTING/DYING notifier support. - Convert another batch of notifier users. The relayfs changes which conflicted with the conversion have been shipped to me by Andrew. The remaining lot is targeted for 4.10 so that we finally can remove the rest of the notifiers" * 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (46 commits) cpufreq: Fix up conversion to hotplug state machine blk/mq: Reserve hotplug states for block multiqueue x86/apic/uv: Convert to hotplug state machine s390/mm/pfault: Convert to hotplug state machine mips/loongson/smp: Convert to hotplug state machine mips/octeon/smp: Convert to hotplug state machine fault-injection/cpu: Convert to hotplug state machine padata: Convert to hotplug state machine cpufreq: Convert to hotplug state machine ACPI/processor: Convert to hotplug state machine virtio scsi: Convert to hotplug state machine oprofile/timer: Convert to hotplug state machine block/softirq: Convert to hotplug state machine lib/irq_poll: Convert to hotplug state machine x86/microcode: Convert to hotplug state machine sh/SH-X3 SMP: Convert to hotplug state machine ia64/mca: Convert to hotplug state machine ARM/OMAP/wakeupgen: Convert to hotplug state machine ARM/shmobile: Convert to hotplug state machine arm64/FP/SIMD: Convert to hotplug state machine ...
Diffstat (limited to 'arch/powerpc/platforms')
-rw-r--r--arch/powerpc/platforms/powermac/smp.c50
1 files changed, 25 insertions, 25 deletions
diff --git a/arch/powerpc/platforms/powermac/smp.c b/arch/powerpc/platforms/powermac/smp.c
index 834868b9fdc9..366e4f510fcf 100644
--- a/arch/powerpc/platforms/powermac/smp.c
+++ b/arch/powerpc/platforms/powermac/smp.c
@@ -852,37 +852,33 @@ static void smp_core99_setup_cpu(int cpu_nr)
852 852
853#ifdef CONFIG_PPC64 853#ifdef CONFIG_PPC64
854#ifdef CONFIG_HOTPLUG_CPU 854#ifdef CONFIG_HOTPLUG_CPU
855static int smp_core99_cpu_notify(struct notifier_block *self, 855static unsigned int smp_core99_host_open;
856 unsigned long action, void *hcpu) 856
857static int smp_core99_cpu_prepare(unsigned int cpu)
857{ 858{
858 int rc; 859 int rc;
859 860
860 switch(action & ~CPU_TASKS_FROZEN) { 861 /* Open i2c bus if it was used for tb sync */
861 case CPU_UP_PREPARE: 862 if (pmac_tb_clock_chip_host && !smp_core99_host_open) {
862 /* Open i2c bus if it was used for tb sync */ 863 rc = pmac_i2c_open(pmac_tb_clock_chip_host, 1);
863 if (pmac_tb_clock_chip_host) { 864 if (rc) {
864 rc = pmac_i2c_open(pmac_tb_clock_chip_host, 1); 865 pr_err("Failed to open i2c bus for time sync\n");
865 if (rc) { 866 return notifier_from_errno(rc);
866 pr_err("Failed to open i2c bus for time sync\n");
867 return notifier_from_errno(rc);
868 }
869 } 867 }
870 break; 868 smp_core99_host_open = 1;
871 case CPU_ONLINE:
872 case CPU_UP_CANCELED:
873 /* Close i2c bus if it was used for tb sync */
874 if (pmac_tb_clock_chip_host)
875 pmac_i2c_close(pmac_tb_clock_chip_host);
876 break;
877 default:
878 break;
879 } 869 }
880 return NOTIFY_OK; 870 return 0;
881} 871}
882 872
883static struct notifier_block smp_core99_cpu_nb = { 873static int smp_core99_cpu_online(unsigned int cpu)
884 .notifier_call = smp_core99_cpu_notify, 874{
885}; 875 /* Close i2c bus if it was used for tb sync */
876 if (pmac_tb_clock_chip_host && smp_core99_host_open) {
877 pmac_i2c_close(pmac_tb_clock_chip_host);
878 smp_core99_host_open = 0;
879 }
880 return 0;
881}
886#endif /* CONFIG_HOTPLUG_CPU */ 882#endif /* CONFIG_HOTPLUG_CPU */
887 883
888static void __init smp_core99_bringup_done(void) 884static void __init smp_core99_bringup_done(void)
@@ -902,7 +898,11 @@ static void __init smp_core99_bringup_done(void)
902 g5_phy_disable_cpu1(); 898 g5_phy_disable_cpu1();
903 } 899 }
904#ifdef CONFIG_HOTPLUG_CPU 900#ifdef CONFIG_HOTPLUG_CPU
905 register_cpu_notifier(&smp_core99_cpu_nb); 901 cpuhp_setup_state_nocalls(CPUHP_POWERPC_PMAC_PREPARE,
902 "powerpc/pmac:prepare", smp_core99_cpu_prepare,
903 NULL);
904 cpuhp_setup_state_nocalls(CPUHP_AP_ONLINE_DYN, "powerpc/pmac:online",
905 smp_core99_cpu_online, NULL);
906#endif 906#endif
907 907
908 if (ppc_md.progress) 908 if (ppc_md.progress)