All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nikita Yushchenko <nyushchenko@dev.rtsoft.ru>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: Vladimir Murzin <vladimir.murzin@arm.com>,
	kuznetsovg@dev.rtsoft.ru, Ian Campbell <ian.campbell@citrix.com>,
	Mason <slash.tmp@free.fr>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	Will Deacon <will.deacon@arm.com>,
	Paul Kocialkowski <contact@paulk.fr>,
	linux-kernel@vger.kernel.org,
	Masahiro Yamada <yamada.m@jp.panasonic.com>,
	Pavel Machek <pavel@ucw.cz>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [RFC/PATCH] arm: do not skip SMP init calls on SMP_ON_UP case
Date: Tue, 24 Nov 2015 17:52:14 +0300	[thread overview]
Message-ID: <5654799E.5080903@dev.rtsoft.ru> (raw)
In-Reply-To: <20151123130424.GQ8644@n2100.arm.linux.org.uk>

>> Just booted mainline...  unline linux-imx, it does not try to init cpu1.
>>
>> However, imx6dl.dtsi from mainline also has both cpu@0 and cpu@1
>>
>> So missing piece in linux-imx is elsewhere :(
> 
> It works as you mentioned - and it relies upon the code you tried to
> modify.
> 
> The early boot code detects that the boot CPU is not SMP capable, so
> through SMP_ON_UP, it "turns off" SMP support by fixing up the code
> and making is_smp() return false.
> 
> This prevents smp_init_cpus() being called, which in turn prevents
> imx_smp_init_cpus() executing, which prevents the CPU possible mask
> including any CPU but the boot CPU.
> 
> As only the boot CPU is possible, this prevents the SMP code trying
> to bring any secondary CPUs online.

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.

Not sure I understand logic behind this. With the current code,
resulting cpu_possible_mask depends on CONFIG_SMP_ON_UP:
- if it is set, cpu_possible_mask contains (0 1), as initialized in
arm_dt_init_cpu_maps()
- if it is not set, cpu_possible_mask contains (0), since
imx_smp_init_cpus() removes 1 from there.

This does not seem to be intended difference.





WARNING: multiple messages have this Message-ID (diff)
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 17:52:14 +0300	[thread overview]
Message-ID: <5654799E.5080903@dev.rtsoft.ru> (raw)
In-Reply-To: <20151123130424.GQ8644@n2100.arm.linux.org.uk>

>> Just booted mainline...  unline linux-imx, it does not try to init cpu1.
>>
>> However, imx6dl.dtsi from mainline also has both cpu at 0 and cpu at 1
>>
>> So missing piece in linux-imx is elsewhere :(
> 
> It works as you mentioned - and it relies upon the code you tried to
> modify.
> 
> The early boot code detects that the boot CPU is not SMP capable, so
> through SMP_ON_UP, it "turns off" SMP support by fixing up the code
> and making is_smp() return false.
> 
> This prevents smp_init_cpus() being called, which in turn prevents
> imx_smp_init_cpus() executing, which prevents the CPU possible mask
> including any CPU but the boot CPU.
> 
> As only the boot CPU is possible, this prevents the SMP code trying
> to bring any secondary CPUs online.

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.

Not sure I understand logic behind this. With the current code,
resulting cpu_possible_mask depends on CONFIG_SMP_ON_UP:
- if it is set, cpu_possible_mask contains (0 1), as initialized in
arm_dt_init_cpu_maps()
- if it is not set, cpu_possible_mask contains (0), since
imx_smp_init_cpus() removes 1 from there.

This does not seem to be intended difference.

  reply	other threads:[~2015-11-24 14:52 UTC|newest]

Thread overview: 32+ 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
2015-11-23 11:59 ` nyushchenko at dev.rtsoft.ru
2015-11-23 12:03 ` Russell King - ARM Linux
2015-11-23 12:03   ` Russell King - ARM Linux
2015-11-23 12:06   ` Nikita Yushchenko
2015-11-23 12:06     ` Nikita Yushchenko
2015-11-23 12:12     ` Russell King - ARM Linux
2015-11-23 12:12       ` Russell King - ARM Linux
2015-11-23 12:19       ` Russell King - ARM Linux
2015-11-23 12:19         ` Russell King - ARM Linux
2015-11-23 12:46         ` Nikita Yushchenko
2015-11-23 12:46           ` Nikita Yushchenko
2015-11-23 12:32     ` Vladimir Murzin
2015-11-23 12:32       ` Vladimir Murzin
2015-11-23 12:42       ` Nikita Yushchenko
2015-11-23 12:42         ` Nikita Yushchenko
2015-11-23 12:47         ` Nikita Yushchenko
2015-11-23 12:47           ` Nikita Yushchenko
2015-11-23 13:04           ` Russell King - ARM Linux
2015-11-23 13:04             ` Russell King - ARM Linux
2015-11-24 14:52             ` Nikita Yushchenko [this message]
2015-11-24 14:52               ` Nikita Yushchenko
2015-11-24 15:05               ` Nikita Yushchenko
2015-11-24 15:05                 ` Nikita Yushchenko
2015-11-24 15:28                 ` Nikita Yushchenko
2015-11-24 15:28                   ` Nikita Yushchenko
2015-11-24 15:33               ` Russell King - ARM Linux
2015-11-24 15:33                 ` Russell King - ARM Linux
2015-11-28 11:13                 ` Nikita Yushchenko
2015-11-28 11:13                   ` Nikita Yushchenko
2015-11-30  8:25                   ` 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=5654799E.5080903@dev.rtsoft.ru \
    --to=nyushchenko@dev.rtsoft.ru \
    --cc=ard.biesheuvel@linaro.org \
    --cc=contact@paulk.fr \
    --cc=ian.campbell@citrix.com \
    --cc=kuznetsovg@dev.rtsoft.ru \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=pavel@ucw.cz \
    --cc=slash.tmp@free.fr \
    --cc=vladimir.murzin@arm.com \
    --cc=will.deacon@arm.com \
    --cc=yamada.m@jp.panasonic.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.