From: Vineet Gupta <Vineet.Gupta1@synopsys.com>
To: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-snps-arc@lists.infradead.org"
<linux-snps-arc@lists.infradead.org>
Subject: Re: [PATCH 2/4] ARC: smp-boot: run-on-reset: add callback to allow non masters to wait
Date: Tue, 17 Jan 2017 14:02:12 -0800 [thread overview]
Message-ID: <c329e6ff-3659-9906-5c41-ea395e5ec667@synopsys.com> (raw)
In-Reply-To: <4881796E12491D4BB15146FE0209CE646789B03D@DE02WEMBXB.internal.synopsys.com>
On 01/17/2017 12:58 PM, Alexey Brodkin wrote:
>>
>> +static void arc_default_smp_wait_to_boot(int cpu) {
>> + while (wake_flag != cpu)
>> + ;
>> +
>> + wake_flag = 0;
>
> Why don't we convert "wake_flag" into bit-field so each core uses its special bit.
> It is IMHO beneficial for 2 reasons:
> 1. If we ever decide to have master core with ARCID != 0 implementation of that procedure won't change,
> because "wake_flag" for core with ARCID=0 will be 1 but not 0, see for example http://patchwork.ozlabs.org/patch/703645/
That's not a real use case - it is just a debug exercise ...
>
> 2. There's no need in resetting "wake_flag" to 0 at all as well because each core has its own bit and they not affect anybody else.
> And in that case ...
True, but you need to do a read-modify-write. More importantly, the cores are
setup one at a time by the master - so there just was no need to do this to begin
with - one at a time was just sufficient. If you really want to do this in right
way - it will not a bit filed either, it needs to be a strictly per cpu variable.
>> +}
>> +
>> void arc_platform_smp_wait_to_boot(int cpu) {
>> /* for halt-on-reset, we've waited already */
>> if (IS_ENABLED(CONFIG_ARC_SMP_HALT_ON_RESET))
>> return;
>
> ...we may just remove above part. Master core by that time has already set our bit in "wake_flag" so we
> will effectively fall through the following "while".
No. They way this works is, same routine arc_platform_smp_wait_to_boot() is called
from early boot code for both halt-on-reset and run-on-reset. For latter we need
to actually wait. For former, they were already halted and when they land here,
they've waited enough so we need to return !
This is same as what was before, I've just moved the #ifdef from head.s (where it
looked ugly) to here.
-Vineet
next prev parent reply other threads:[~2017-01-17 22:04 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-16 20:57 [PATCH 0/4] ARC rework SMP boot waiting to handle IO-Coherency case Vineet Gupta
2017-01-16 20:57 ` [PATCH 1/4] ARC: smp-boot: waiting API for run-from-reset need not jump to entry point Vineet Gupta
2017-01-16 20:57 ` [PATCH 2/4] ARC: smp-boot: run-on-reset: add callback to allow non masters to wait Vineet Gupta
2017-01-17 20:58 ` Alexey Brodkin
2017-01-17 22:02 ` Vineet Gupta [this message]
2017-01-16 20:57 ` [PATCH 3/4] ARCv2: smp: MCIP: remove debug aid to halt all cores when one halts Vineet Gupta
2017-01-17 20:13 ` Alexey Brodkin
2017-01-16 20:57 ` [PATCH 4/4] ARCv2: smp-boot: MCIP: use Inter-Core-Debug unit to kick start non master cpus Vineet Gupta
2017-01-17 21:41 ` Alexey Brodkin
2017-01-17 22:14 ` Vineet Gupta
2017-01-17 22:16 ` Vineet Gupta
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=c329e6ff-3659-9906-5c41-ea395e5ec667@synopsys.com \
--to=vineet.gupta1@synopsys.com \
--cc=Alexey.Brodkin@synopsys.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-snps-arc@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
Powered by JetHome