Re: [PATCH] socfpga_a10: reset CPU1 in socfpga_cpu_kill()
From: Russell King - ARM Linux
Date: Mon May 15 2017 - 05:55:35 EST
On Mon, May 15, 2017 at 05:13:36PM +0800, yanjiang.jin@xxxxxxxxxxxxx wrote:
> From: Yanjiang Jin <yanjiang.jin@xxxxxxxxxxxxx>
>
> 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.