@@ -205,8 +205,11 @@ void __init btcpupools_allocate_pools(void)
if ( add_extra_cpupool )
next_pool_id++;
+ /* Keep track of cpupool id 0 with the global cpupool0 */
+ cpupool0 = cpupool_create_pool(0, pool_sched_map[0]);
+
/* Create cpupools with selected schedulers */
- for ( i = 0; i < next_pool_id; i++ )
+ for ( i = 1; i < next_pool_id; i++ )
cpupool_create_pool(i, pool_sched_map[i]);
}
@@ -312,10 +312,7 @@ static struct cpupool *cpupool_create(unsigned int poolid,
c->cpupool_id = q->cpupool_id + 1;
}
- if ( poolid == 0 )
- c->sched = scheduler_get_default();
- else
- c->sched = scheduler_alloc(sched_id);
+ c->sched = scheduler_alloc(sched_id);
if ( IS_ERR(c->sched) )
{
ret = PTR_ERR(c->sched);
@@ -1242,9 +1239,6 @@ static int __init cf_check cpupool_init(void)
cpupool_hypfs_init();
- cpupool0 = cpupool_create(0, 0);
- BUG_ON(IS_ERR(cpupool0));
- cpupool_put(cpupool0);
register_cpu_notifier(&cpu_nfb);
btcpupools_dtb_parse();
@@ -1185,7 +1185,10 @@ void btcpupools_dtb_parse(void);
int btcpupools_get_domain_pool_id(const struct dt_device_node *node);
#else /* !CONFIG_BOOT_TIME_CPUPOOLS */
-static inline void btcpupools_allocate_pools(void) {}
+static inline void btcpupools_allocate_pools(void)
+{
+ cpupool0 = cpupool_create_pool(0, -1);
+}
static inline void btcpupools_dtb_parse(void) {}
static inline unsigned int btcpupools_get_cpupool_id(unsigned int cpu)
{