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>
This commit is contained in:
David Hildenbrand 2015-05-06 13:19:29 +02:00 committed by Martin Schwidefsky
parent 37c5f6c86c
commit 3a9f3fe69e
3 changed files with 3 additions and 16 deletions

View File

@ -68,8 +68,6 @@ extern struct sclp_info sclp;
int sclp_get_cpu_info(struct sclp_cpu_info *info); int sclp_get_cpu_info(struct sclp_cpu_info *info);
int sclp_cpu_configure(u8 cpu); int sclp_cpu_configure(u8 cpu);
int sclp_cpu_deconfigure(u8 cpu); int sclp_cpu_deconfigure(u8 cpu);
unsigned int sclp_get_mtid(u8 cpu_type);
unsigned int sclp_get_mtid_max(void);
int sclp_sdias_blk_count(void); int sclp_sdias_blk_count(void);
int sclp_sdias_copy(void *dest, int blk_num, int nr_blks); int sclp_sdias_copy(void *dest, int blk_num, int nr_blks);
int sclp_chp_configure(struct chp_id chpid); int sclp_chp_configure(struct chp_id chpid);

View File

@ -740,7 +740,7 @@ static void __init smp_detect_cpus(void)
#endif #endif
/* Set multi-threading state for the current system */ /* Set multi-threading state for the current system */
mtid = sclp_get_mtid(boot_cpu_type); mtid = boot_cpu_type ? sclp.mtid : sclp.mtid_cp;
mtid = (mtid < smp_max_threads) ? mtid : smp_max_threads - 1; mtid = (mtid < smp_max_threads) ? mtid : smp_max_threads - 1;
pcpu_set_smt(mtid); pcpu_set_smt(mtid);
@ -882,7 +882,8 @@ void __init smp_fill_possible_mask(void)
{ {
unsigned int possible, sclp_max, cpu; unsigned int possible, sclp_max, cpu;
sclp_max = min(smp_max_threads, sclp_get_mtid_max() + 1); sclp_max = max(sclp.mtid, sclp.mtid_cp) + 1;
sclp_max = min(smp_max_threads, sclp_max);
sclp_max = sclp.max_cpu * sclp_max ?: nr_cpu_ids; sclp_max = sclp.max_cpu * sclp_max ?: nr_cpu_ids;
possible = setup_possible_cpus ?: nr_cpu_ids; possible = setup_possible_cpus ?: nr_cpu_ids;
possible = min(possible, sclp_max); possible = min(possible, sclp_max);

View File

@ -49,7 +49,6 @@ struct read_info_sccb {
static char sccb_early[PAGE_SIZE] __aligned(PAGE_SIZE) __initdata; static char sccb_early[PAGE_SIZE] __aligned(PAGE_SIZE) __initdata;
static struct sclp_ipl_info sclp_ipl_info; static struct sclp_ipl_info sclp_ipl_info;
static unsigned int sclp_mtid_max;
struct sclp_info sclp; struct sclp_info sclp;
EXPORT_SYMBOL(sclp); EXPORT_SYMBOL(sclp);
@ -143,20 +142,9 @@ static void __init sclp_facilities_detect(struct read_info_sccb *sccb)
sclp.mtid = (sccb->fac42 & 0x80) ? (sccb->fac42 & 31) : 0; sclp.mtid = (sccb->fac42 & 0x80) ? (sccb->fac42 & 31) : 0;
sclp.mtid_cp = (sccb->fac42 & 0x80) ? (sccb->fac43 & 31) : 0; sclp.mtid_cp = (sccb->fac42 & 0x80) ? (sccb->fac43 & 31) : 0;
sclp_mtid_max = max(sclp.mtid, sclp.mtid_cp);
sclp.mtid_prev = (sccb->fac42 & 0x80) ? (sccb->fac66 & 31) : 0; sclp.mtid_prev = (sccb->fac42 & 0x80) ? (sccb->fac66 & 31) : 0;
} }
unsigned int sclp_get_mtid(u8 cpu_type)
{
return cpu_type ? sclp.mtid : sclp.mtid_cp;
}
unsigned int sclp_get_mtid_max(void)
{
return sclp_mtid_max;
}
/* /*
* This function will be called after sclp_facilities_detect(), which gets * This function will be called after sclp_facilities_detect(), which gets
* called from early.c code. The sclp_facilities_detect() function retrieves * called from early.c code. The sclp_facilities_detect() function retrieves