public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Russell King - ARM Linux <linux@armlinux.org.uk>
To: yanjiang.jin@windriver.com
Cc: mark.rutland@arm.com, dinguyen@kernel.org,
	dinguyen@opensource.altera.com, jinyanjiang@gmail.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] socfpga_a10: reset CPU1 in socfpga_cpu_kill()
Date: Mon, 15 May 2017 10:55:14 +0100	[thread overview]
Message-ID: <20170515095513.GS22219@n2100.armlinux.org.uk> (raw)
In-Reply-To: <20170515091336.10827-2-yanjiang.jin@windriver.com>

On Mon, May 15, 2017 at 05:13:36PM +0800, yanjiang.jin@windriver.com wrote:
> From: Yanjiang Jin <yanjiang.jin@windriver.com>
> 
> socfpga_cpu_die() just puts CPU in WFI, not actually off. So that Kexec's
> second kernel goes wrong since the kerenl text gets ovewritten.
> Now reset CPU1 in cpu_kill() to avoid this error.
> Also add flush_cache_all() to prevent data from being lost in cpu_die().

You should not need this, as the common code does the cache flushing
for you.

It's rather unsafe too - you are completely unsynchronised between the
CPU executing in cpu_die() and the CPU executing cpu_kill() - it's
quite possible for the code in cpu_kill() to take effect when you're
part-way through the flush_cache_all().

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.

  reply	other threads:[~2017-05-15  9:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-15  9:13 [V2 PATCH] socfpga_a10: fix a kexec boot issue yanjiang.jin
2017-05-15  9:13 ` [PATCH] socfpga_a10: reset CPU1 in socfpga_cpu_kill() yanjiang.jin
2017-05-15  9:55   ` Russell King - ARM Linux [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-05-10  5:13 [PATCH] socfpga_a10: fix a kexec boot issue yanjiang.jin
2017-05-10  5:13 ` [PATCH] socfpga_a10: reset CPU1 in socfpga_cpu_kill() yanjiang.jin
2017-05-12 14:25   ` Dinh Nguyen
2017-05-12 14:36   ` Mark Rutland
2017-05-15  9:05     ` yjin
2017-05-15 10:00     ` Russell King - ARM Linux

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=20170515095513.GS22219@n2100.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=dinguyen@kernel.org \
    --cc=dinguyen@opensource.altera.com \
    --cc=jinyanjiang@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=yanjiang.jin@windriver.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox