aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/topology.c
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2010-10-25 10:10:52 -0400
committerMartin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com>2010-10-25 10:10:21 -0400
commit9186d7a9cfd75e51ac4db4a40e0a558371988bd2 (patch)
treedf0dcb04bd32105734ac736e9ceb1900065dd66a /arch/s390/kernel/topology.c
parent14375bc4eb8dd0fb0e765390650564c35bb31068 (diff)
[S390] topology: clean up facility detection
Move cpu topology facility detection to early setup code where it should be. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/kernel/topology.c')
-rw-r--r--arch/s390/kernel/topology.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/arch/s390/kernel/topology.c b/arch/s390/kernel/topology.c
index 91fb66baa50b..69004411a93d 100644
--- a/arch/s390/kernel/topology.c
+++ b/arch/s390/kernel/topology.c
@@ -66,7 +66,6 @@ struct mask_info {
66static int topology_enabled = 1; 66static int topology_enabled = 1;
67static void topology_work_fn(struct work_struct *work); 67static void topology_work_fn(struct work_struct *work);
68static struct tl_info *tl_info; 68static struct tl_info *tl_info;
69static int machine_has_topology;
70static struct timer_list topology_timer; 69static struct timer_list topology_timer;
71static void set_topology_timer(void); 70static void set_topology_timer(void);
72static DECLARE_WORK(topology_work, topology_work_fn); 71static DECLARE_WORK(topology_work, topology_work_fn);
@@ -88,7 +87,7 @@ static cpumask_t cpu_group_map(struct mask_info *info, unsigned int cpu)
88 cpumask_t mask; 87 cpumask_t mask;
89 88
90 cpus_clear(mask); 89 cpus_clear(mask);
91 if (!topology_enabled || !machine_has_topology) 90 if (!topology_enabled || !MACHINE_HAS_TOPOLOGY)
92 return cpu_possible_map; 91 return cpu_possible_map;
93 while (info) { 92 while (info) {
94 if (cpu_isset(cpu, info->mask)) { 93 if (cpu_isset(cpu, info->mask)) {
@@ -186,7 +185,6 @@ static void tl_to_cores(struct tl_info *info)
186 break; 185 break;
187 default: 186 default:
188 clear_masks(); 187 clear_masks();
189 machine_has_topology = 0;
190 goto out; 188 goto out;
191 } 189 }
192 tle = next_tle(tle); 190 tle = next_tle(tle);
@@ -223,7 +221,7 @@ int topology_set_cpu_management(int fc)
223 int cpu; 221 int cpu;
224 int rc; 222 int rc;
225 223
226 if (!machine_has_topology) 224 if (!MACHINE_HAS_TOPOLOGY)
227 return -EOPNOTSUPP; 225 return -EOPNOTSUPP;
228 if (fc) 226 if (fc)
229 rc = ptf(PTF_VERTICAL); 227 rc = ptf(PTF_VERTICAL);
@@ -269,7 +267,7 @@ int arch_update_cpu_topology(void)
269 struct sys_device *sysdev; 267 struct sys_device *sysdev;
270 int cpu; 268 int cpu;
271 269
272 if (!machine_has_topology) { 270 if (!MACHINE_HAS_TOPOLOGY) {
273 update_cpu_core_map(); 271 update_cpu_core_map();
274 topology_update_polarization_simple(); 272 topology_update_polarization_simple();
275 return 0; 273 return 0;
@@ -323,7 +321,7 @@ static int __init init_topology_update(void)
323 int rc; 321 int rc;
324 322
325 rc = 0; 323 rc = 0;
326 if (!machine_has_topology) { 324 if (!MACHINE_HAS_TOPOLOGY) {
327 topology_update_polarization_simple(); 325 topology_update_polarization_simple();
328 goto out; 326 goto out;
329 } 327 }
@@ -354,10 +352,8 @@ void __init s390_init_cpu_topology(void)
354 struct tl_info *info; 352 struct tl_info *info;
355 int i; 353 int i;
356 354
357 if (!test_facility(2) || !test_facility(11)) 355 if (!MACHINE_HAS_TOPOLOGY)
358 return; 356 return;
359 machine_has_topology = 1;
360
361 tl_info = alloc_bootmem_pages(PAGE_SIZE); 357 tl_info = alloc_bootmem_pages(PAGE_SIZE);
362 info = tl_info; 358 info = tl_info;
363 store_topology(info); 359 store_topology(info);