From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760873AbdEOJzc (ORCPT ); Mon, 15 May 2017 05:55:32 -0400 Received: from pandora.armlinux.org.uk ([78.32.30.218]:56368 "EHLO pandora.armlinux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755197AbdEOJza (ORCPT ); Mon, 15 May 2017 05:55:30 -0400 Date: Mon, 15 May 2017 10:55:14 +0100 From: Russell King - ARM Linux 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() Message-ID: <20170515095513.GS22219@n2100.armlinux.org.uk> References: <20170515091336.10827-1-yanjiang.jin@windriver.com> <20170515091336.10827-2-yanjiang.jin@windriver.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170515091336.10827-2-yanjiang.jin@windriver.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 15, 2017 at 05:13:36PM +0800, yanjiang.jin@windriver.com wrote: > From: Yanjiang Jin > > 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.