From: nyushchenko@dev.rtsoft.ru (Nikita Yushchenko)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC/PATCH] arm: do not skip SMP init calls on SMP_ON_UP case
Date: Tue, 24 Nov 2015 18:28:08 +0300 [thread overview]
Message-ID: <56548208.1030402@dev.rtsoft.ru> (raw)
In-Reply-To: <56547CC1.6000009@dev.rtsoft.ru>
24.11.2015 18:05, Nikita Yushchenko ?????:
>> I'm still trying to understand what is going on, and my printk()s show
>> that this is not entirely true.
>>
>> When smp_init() is entered on mainline om imx6s, cpu_possible_mask and
>> cpu_present_mask both contain two cpus. These get initialized in
>> arm_dt_init_cpu_maps() and stay unmodified since then.
>>
>> But cpu_online() returns 1 for cpu0 and 0 from cpu1 - thus it is
>> cpu_online() check, not possible_mask or present_mask, that prevents
>> cpu1 initialization attempt.
>
> Sorry was too quick to type.
>
> cpu_online(0) is true and cpu_online(1) is false.
> It is natural, since cpu0 is already running.
> Thus cpu_up(1) is entered!
... and then code executes into __cpu_up() from arch/arm/kernel/smp.c,
and stops via
if (!smp_ops.smp_boot_secondary)
return -ENOSYS;
(smp_ops zeroed due to SMP_ON_UP, as far as I understand).
In linux-imx 3.14.28 based tree, there is no such check in __cpu_up,
thus boot_secondary() is called
int boot_secondary(unsigned int cpu, struct task_struct *idle)
{
if (smp_ops.smp_boot_secondary)
return smp_ops.smp_boot_secondary(cpu, idle);
return -ENOSYS;
}
at this point zeroed smp_ops plays, -ENOSYS (-38) is returned, and
pr_err() in __cpu_up() prints the message that caused the entire analysis.
So conclusion is that
- behaviour of mainline and linux-imx tres is almost the same, there is
attempt to bring up non-existing cpu 1, difference is only in where
zeroed smp_ops is detected and if error is logged or not.
Not sure that my proposed patch was correct, it fixes imx6s case but can
have bad effect on other arm targets. But I think that something needs
to be done to make cpu masks correct in SMP_ON_UP case.
next prev parent reply other threads:[~2015-11-24 15:28 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-23 11:59 [RFC/PATCH] arm: do not skip SMP init calls on SMP_ON_UP case nyushchenko at dev.rtsoft.ru
2015-11-23 12:03 ` Russell King - ARM Linux
2015-11-23 12:06 ` Nikita Yushchenko
2015-11-23 12:12 ` Russell King - ARM Linux
2015-11-23 12:19 ` Russell King - ARM Linux
2015-11-23 12:46 ` Nikita Yushchenko
2015-11-23 12:32 ` Vladimir Murzin
2015-11-23 12:42 ` Nikita Yushchenko
2015-11-23 12:47 ` Nikita Yushchenko
2015-11-23 13:04 ` Russell King - ARM Linux
2015-11-24 14:52 ` Nikita Yushchenko
2015-11-24 15:05 ` Nikita Yushchenko
2015-11-24 15:28 ` Nikita Yushchenko [this message]
2015-11-24 15:33 ` Russell King - ARM Linux
2015-11-28 11:13 ` Nikita Yushchenko
2015-11-30 8:25 ` Nikita Yushchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56548208.1030402@dev.rtsoft.ru \
--to=nyushchenko@dev.rtsoft.ru \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).