From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753100AbcHZKdV (ORCPT ); Fri, 26 Aug 2016 06:33:21 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:36469 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751569AbcHZKdU (ORCPT ); Fri, 26 Aug 2016 06:33:20 -0400 Date: Fri, 26 Aug 2016 12:09:38 +0200 (CEST) From: Thomas Gleixner To: Will Deacon cc: James Morse , linux-kernel@vger.kernel.org, Mark Rutland , Lorenzo Pieralisi , linux-pm@vger.kernel.org, Peter Zijlstra , "Rafael J . Wysocki" , Catalin Marinas , Ingo Molnar , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v5 1/3] cpu/hotplug: Allow suspend/resume CPU to be specified In-Reply-To: <20160826093241.GC13554@arm.com> Message-ID: References: <1471438227-8747-1-git-send-email-james.morse@arm.com> <1471438227-8747-2-git-send-email-james.morse@arm.com> <20160826093241.GC13554@arm.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 26 Aug 2016, Will Deacon wrote: > On Wed, Aug 17, 2016 at 01:50:25PM +0100, James Morse wrote: > > disable_nonboot_cpus() assumes that the lowest numbered online CPU is > > the boot CPU, and that this is the correct CPU to run any power > > management code on. > > > > On x86 this is always correct, as CPU0 cannot (easily) by taken offline. > > > > On arm64 CPU0 can be taken offline. For hibernate/resume this means we > > may hibernate on a CPU other than CPU0. If the system is rebooted with > > kexec 'CPU0' will be assigned to a different physical CPU. This > > complicates hibernate/resume as now we can't trust the CPU numbers. > > Arch code can find the correct physical CPU, and ensure it is online > > before resume from hibernate begins, but also needs to influence > > disable_nonboot_cpus()s choice of CPU. > > > > Rename disable_nonboot_cpus() as freeze_secondary_cpus() and add an > > argument indicating which CPU should be left standing. Follow the logic > > in migrate_to_reboot_cpu() to use the lowest numbered online CPU if the > > requested CPU is not online. > > Add disable_nonboot_cpus() as an inline function that has the existing > > behaviour. > > > > Signed-off-by: James Morse > > Cc: Rafael J. Wysocki > > --- > > An alternative is to provide two functions calling a common function, > > but this would mean spilling the cpu_maps_update_begin() into these two. > > > > include/linux/cpu.h | 6 +++++- > > kernel/cpu.c | 9 +++++---- > > 2 files changed, 10 insertions(+), 5 deletions(-) > > Thomas, does this look ok to you? If so, would you prefer to merge this > series via -tip, or have us take this one via the arm64 tree? You can take it via ARM64. It's not conflicting with the stuff I have in the pipeline. Reviewed-by: Thomas Gleixner