diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2010-10-25 10:10:52 -0400 |
---|---|---|
committer | Martin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com> | 2010-10-25 10:10:21 -0400 |
commit | 9186d7a9cfd75e51ac4db4a40e0a558371988bd2 (patch) | |
tree | df0dcb04bd32105734ac736e9ceb1900065dd66a /arch/s390/kernel | |
parent | 14375bc4eb8dd0fb0e765390650564c35bb31068 (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')
-rw-r--r-- | arch/s390/kernel/early.c | 2 | ||||
-rw-r--r-- | arch/s390/kernel/topology.c | 14 |
2 files changed, 7 insertions, 9 deletions
diff --git a/arch/s390/kernel/early.c b/arch/s390/kernel/early.c index d2455d44d99a..d149609e46e6 100644 --- a/arch/s390/kernel/early.c +++ b/arch/s390/kernel/early.c | |||
@@ -382,6 +382,8 @@ static __init void detect_machine_facilities(void) | |||
382 | S390_lowcore.machine_flags |= MACHINE_FLAG_IDTE; | 382 | S390_lowcore.machine_flags |= MACHINE_FLAG_IDTE; |
383 | if (test_facility(8)) | 383 | if (test_facility(8)) |
384 | S390_lowcore.machine_flags |= MACHINE_FLAG_PFMF; | 384 | S390_lowcore.machine_flags |= MACHINE_FLAG_PFMF; |
385 | if (test_facility(11)) | ||
386 | S390_lowcore.machine_flags |= MACHINE_FLAG_TOPOLOGY; | ||
385 | if (test_facility(27)) | 387 | if (test_facility(27)) |
386 | S390_lowcore.machine_flags |= MACHINE_FLAG_MVCOS; | 388 | S390_lowcore.machine_flags |= MACHINE_FLAG_MVCOS; |
387 | if (test_facility(40)) | 389 | if (test_facility(40)) |
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 { | |||
66 | static int topology_enabled = 1; | 66 | static int topology_enabled = 1; |
67 | static void topology_work_fn(struct work_struct *work); | 67 | static void topology_work_fn(struct work_struct *work); |
68 | static struct tl_info *tl_info; | 68 | static struct tl_info *tl_info; |
69 | static int machine_has_topology; | ||
70 | static struct timer_list topology_timer; | 69 | static struct timer_list topology_timer; |
71 | static void set_topology_timer(void); | 70 | static void set_topology_timer(void); |
72 | static DECLARE_WORK(topology_work, topology_work_fn); | 71 | static 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); |