diff options
author | David Hildenbrand <dahi@linux.vnet.ibm.com> | 2015-05-06 07:19:29 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2015-05-13 03:58:17 -0400 |
commit | 3a9f3fe69eab40d9de948230a6789bd7ea68d5e9 (patch) | |
tree | 3e188db992126e20ef2082f2808c7560f46f1965 | |
parent | 37c5f6c86cf5cda66c71c3bb1672e3b09d81c6da (diff) |
s390/sclp: get rid of sclp_get_mtid() and sclp_get_mtid_max()
As all relevant sclp data is now directly accessible, let's move the
logic of these two functions to the single caller.
Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
-rw-r--r-- | arch/s390/include/asm/sclp.h | 2 | ||||
-rw-r--r-- | arch/s390/kernel/smp.c | 5 | ||||
-rw-r--r-- | drivers/s390/char/sclp_early.c | 12 |
3 files changed, 3 insertions, 16 deletions
diff --git a/arch/s390/include/asm/sclp.h b/arch/s390/include/asm/sclp.h index 74ba690064f5..6b00faa7e1ad 100644 --- a/arch/s390/include/asm/sclp.h +++ b/arch/s390/include/asm/sclp.h | |||
@@ -68,8 +68,6 @@ extern struct sclp_info sclp; | |||
68 | int sclp_get_cpu_info(struct sclp_cpu_info *info); | 68 | int sclp_get_cpu_info(struct sclp_cpu_info *info); |
69 | int sclp_cpu_configure(u8 cpu); | 69 | int sclp_cpu_configure(u8 cpu); |
70 | int sclp_cpu_deconfigure(u8 cpu); | 70 | int sclp_cpu_deconfigure(u8 cpu); |
71 | unsigned int sclp_get_mtid(u8 cpu_type); | ||
72 | unsigned int sclp_get_mtid_max(void); | ||
73 | int sclp_sdias_blk_count(void); | 71 | int sclp_sdias_blk_count(void); |
74 | int sclp_sdias_copy(void *dest, int blk_num, int nr_blks); | 72 | int sclp_sdias_copy(void *dest, int blk_num, int nr_blks); |
75 | int sclp_chp_configure(struct chp_id chpid); | 73 | int sclp_chp_configure(struct chp_id chpid); |
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c index ac7dda556a7d..0d9d59d4710e 100644 --- a/arch/s390/kernel/smp.c +++ b/arch/s390/kernel/smp.c | |||
@@ -740,7 +740,7 @@ static void __init smp_detect_cpus(void) | |||
740 | #endif | 740 | #endif |
741 | 741 | ||
742 | /* Set multi-threading state for the current system */ | 742 | /* Set multi-threading state for the current system */ |
743 | mtid = sclp_get_mtid(boot_cpu_type); | 743 | mtid = boot_cpu_type ? sclp.mtid : sclp.mtid_cp; |
744 | mtid = (mtid < smp_max_threads) ? mtid : smp_max_threads - 1; | 744 | mtid = (mtid < smp_max_threads) ? mtid : smp_max_threads - 1; |
745 | pcpu_set_smt(mtid); | 745 | pcpu_set_smt(mtid); |
746 | 746 | ||
@@ -882,7 +882,8 @@ void __init smp_fill_possible_mask(void) | |||
882 | { | 882 | { |
883 | unsigned int possible, sclp_max, cpu; | 883 | unsigned int possible, sclp_max, cpu; |
884 | 884 | ||
885 | sclp_max = min(smp_max_threads, sclp_get_mtid_max() + 1); | 885 | sclp_max = max(sclp.mtid, sclp.mtid_cp) + 1; |
886 | sclp_max = min(smp_max_threads, sclp_max); | ||
886 | sclp_max = sclp.max_cpu * sclp_max ?: nr_cpu_ids; | 887 | sclp_max = sclp.max_cpu * sclp_max ?: nr_cpu_ids; |
887 | possible = setup_possible_cpus ?: nr_cpu_ids; | 888 | possible = setup_possible_cpus ?: nr_cpu_ids; |
888 | possible = min(possible, sclp_max); | 889 | possible = min(possible, sclp_max); |
diff --git a/drivers/s390/char/sclp_early.c b/drivers/s390/char/sclp_early.c index 4f6525d5e987..914ff62112c8 100644 --- a/drivers/s390/char/sclp_early.c +++ b/drivers/s390/char/sclp_early.c | |||
@@ -49,7 +49,6 @@ struct read_info_sccb { | |||
49 | 49 | ||
50 | static char sccb_early[PAGE_SIZE] __aligned(PAGE_SIZE) __initdata; | 50 | static char sccb_early[PAGE_SIZE] __aligned(PAGE_SIZE) __initdata; |
51 | static struct sclp_ipl_info sclp_ipl_info; | 51 | static struct sclp_ipl_info sclp_ipl_info; |
52 | static unsigned int sclp_mtid_max; | ||
53 | 52 | ||
54 | struct sclp_info sclp; | 53 | struct sclp_info sclp; |
55 | EXPORT_SYMBOL(sclp); | 54 | EXPORT_SYMBOL(sclp); |
@@ -143,20 +142,9 @@ static void __init sclp_facilities_detect(struct read_info_sccb *sccb) | |||
143 | 142 | ||
144 | sclp.mtid = (sccb->fac42 & 0x80) ? (sccb->fac42 & 31) : 0; | 143 | sclp.mtid = (sccb->fac42 & 0x80) ? (sccb->fac42 & 31) : 0; |
145 | sclp.mtid_cp = (sccb->fac42 & 0x80) ? (sccb->fac43 & 31) : 0; | 144 | sclp.mtid_cp = (sccb->fac42 & 0x80) ? (sccb->fac43 & 31) : 0; |
146 | sclp_mtid_max = max(sclp.mtid, sclp.mtid_cp); | ||
147 | sclp.mtid_prev = (sccb->fac42 & 0x80) ? (sccb->fac66 & 31) : 0; | 145 | sclp.mtid_prev = (sccb->fac42 & 0x80) ? (sccb->fac66 & 31) : 0; |
148 | } | 146 | } |
149 | 147 | ||
150 | unsigned int sclp_get_mtid(u8 cpu_type) | ||
151 | { | ||
152 | return cpu_type ? sclp.mtid : sclp.mtid_cp; | ||
153 | } | ||
154 | |||
155 | unsigned int sclp_get_mtid_max(void) | ||
156 | { | ||
157 | return sclp_mtid_max; | ||
158 | } | ||
159 | |||
160 | /* | 148 | /* |
161 | * This function will be called after sclp_facilities_detect(), which gets | 149 | * This function will be called after sclp_facilities_detect(), which gets |
162 | * called from early.c code. The sclp_facilities_detect() function retrieves | 150 | * called from early.c code. The sclp_facilities_detect() function retrieves |