From patchwork Thu Jul 25 16:06:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Pitre X-Patchwork-Id: 18581 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ye0-f199.google.com (mail-ye0-f199.google.com [209.85.213.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B03B225E19 for ; Thu, 25 Jul 2013 16:06:55 +0000 (UTC) Received: by mail-ye0-f199.google.com with SMTP id l12sf719810yen.6 for ; Thu, 25 Jul 2013 09:06:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-beenthere:x-forwarded-to:x-forwarded-for:delivered-to:date:from :to:cc:subject:in-reply-to:message-id:references:user-agent :mime-version:x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe :content-type; bh=GW8cEdrFnGR84HSlQ3WELVqm/0dP/hIVsFYWlPN6jkY=; b=N+HTe5Yabdh8LswBWvodZ+HyHWTPvG2Omoo4bkhsqymqXPQu1NWyJrRGvNjjDrJJfs 7QPC/xLTIR42EqbG7ArKcnbMu0VQrTrbn0LlSu58vDwY7cQhJsrXd1rW/iM6gGZCiZKv sfjKpG/DOu/MUnm9rOIyx8bciUOOzzyCRwmRUtIG/Q1hPZ8xmS3GHlb+e5S/3q/BpzcG vxhSrRUrNtPPr4yh4/Cq3bROR3P0adHmEizcSMPckVNteGaeg+AJLCKjJN+nfaKi+fzl rYZ7xXqDGw657MzJXMJqLQ+3glD8j6o2ns+zvw1AvzUk4z7XxY/vcGtz6ubNp3Z+i7Mn P0RA== X-Received: by 10.236.125.200 with SMTP id z48mr23687861yhh.55.1374768414744; Thu, 25 Jul 2013 09:06:54 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.4.200 with SMTP id m8ls710299qem.70.gmail; Thu, 25 Jul 2013 09:06:54 -0700 (PDT) X-Received: by 10.220.45.132 with SMTP id e4mr972961vcf.56.1374768414552; Thu, 25 Jul 2013 09:06:54 -0700 (PDT) Received: from mail-vc0-f176.google.com (mail-vc0-f176.google.com [209.85.220.176]) by mx.google.com with ESMTPS id ur15si12576208veb.32.2013.07.25.09.06.54 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 25 Jul 2013 09:06:54 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.176; Received: by mail-vc0-f176.google.com with SMTP id ha11so241729vcb.35 for ; Thu, 25 Jul 2013 09:06:54 -0700 (PDT) X-Received: by 10.52.165.71 with SMTP id yw7mr2856283vdb.82.1374768414454; Thu, 25 Jul 2013 09:06:54 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.165.8 with SMTP id yu8csp84758veb; Thu, 25 Jul 2013 09:06:54 -0700 (PDT) X-Received: by 10.49.1.133 with SMTP id 5mr2445606qem.2.1374768413774; Thu, 25 Jul 2013 09:06:53 -0700 (PDT) Received: from mail-qe0-f52.google.com (mail-qe0-f52.google.com [209.85.128.52]) by mx.google.com with ESMTPS id 5si16681460qaw.23.2013.07.25.09.06.53 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 25 Jul 2013 09:06:53 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.52 is neither permitted nor denied by best guess record for domain of nicolas.pitre@linaro.org) client-ip=209.85.128.52; Received: by mail-qe0-f52.google.com with SMTP id cz11so358240qeb.25 for ; Thu, 25 Jul 2013 09:06:53 -0700 (PDT) X-Received: by 10.49.118.166 with SMTP id kn6mr27580628qeb.39.1374768413451; Thu, 25 Jul 2013 09:06:53 -0700 (PDT) Received: from xanadu.home (modemcable044.209-83-70.mc.videotron.ca. [70.83.209.44]) by mx.google.com with ESMTPSA id l15sm23548612qav.13.2013.07.25.09.06.52 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 25 Jul 2013 09:06:52 -0700 (PDT) Date: Thu, 25 Jul 2013 12:06:51 -0400 (EDT) From: Nicolas Pitre To: Dave Martin cc: linux-arm-kernel@lists.infradead.org, Dave Martin , lorenzo.pieralisi@arm.com, patches@linaro.org Subject: Re: [PATCH 01/13] ARM: suspend: use hash of cpu_logical_map value to index into save array In-Reply-To: <20130725105528.GA2546@localhost.localdomain> Message-ID: References: <1374550289-25305-1-git-send-email-nicolas.pitre@linaro.org> <1374550289-25305-2-git-send-email-nicolas.pitre@linaro.org> <20130724164717.GA4610@localhost.localdomain> <20130725105528.GA2546@localhost.localdomain> User-Agent: Alpine 2.03 (LFD 1266 2009-07-14) MIME-Version: 1.0 X-Gm-Message-State: ALoCoQl/KwYAgBXd9sDndzsTIOaU9oBuj/Uqs1fqKhG7mwXmh6OID5T3vg3wf0CpsymOjLZK5IsX X-Original-Sender: nicolas.pitre@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , On Thu, 25 Jul 2013, Dave Martin wrote: > On Wed, Jul 24, 2013 at 02:55:00PM -0400, Nicolas Pitre wrote: > > On Wed, 24 Jul 2013, Dave Martin wrote: > > > > > But this patch commits us to requiring that on the suspend path > > > specifically -- I think that ought to be mentioned somewhere. A > > > comment in the preamble for __cpu_suspend would be enough, I think. > > > > What comment would you suggest? I want to make sure the possible > > confusion you see is properly addressed. > > I think we just need to state that the value of > cpu_logical_map(smp_processor_id()) must be the MPIDR of the physical > CPU the suspending logical CPU will resume on. Consequently, if doing a > migration, cpu_logical_map() must be updated appropriately somewhere > between cpu_pm_enter() and cpu_suspend(). Excellent. I've amended the patch with this: I've put it against cpu_suspend() rather than __cpu_suspend(() as this is what users should care about. ACK? Nicolas diff --git a/arch/arm/kernel/suspend.c b/arch/arm/kernel/suspend.c index 2835d35234..caf938db62 100644 --- a/arch/arm/kernel/suspend.c +++ b/arch/arm/kernel/suspend.c @@ -17,6 +17,11 @@ extern void cpu_resume_mmu(void); /* * Hide the first two arguments to __cpu_suspend - these are an implementation * detail which platform code shouldn't have to know about. + * + * On SMP systems, the value of cpu_logical_map(smp_processor_id()) must be + * the MPIDR of the physical CPU the suspending logical CPU will resume on. + * Consequently, if doing a physical CPU migration, cpu_logical_map() must be + * updated appropriately somewhere between cpu_pm_enter() and cpu_suspend(). */ int cpu_suspend(unsigned long arg, int (*fn)(unsigned long)) {