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: 2833469 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0AB88C0319 for ; Thu, 25 Jul 2013 16:07:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7858820209 for ; Thu, 25 Jul 2013 16:07:26 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0A87C20154 for ; Thu, 25 Jul 2013 16:07:25 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V2O4Y-0000MF-Oz; Thu, 25 Jul 2013 16:07:23 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1V2O4W-000659-MM; Thu, 25 Jul 2013 16:07:20 +0000 Received: from mail-qc0-f176.google.com ([209.85.216.176]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V2O4U-00063n-Fa for linux-arm-kernel@lists.infradead.org; Thu, 25 Jul 2013 16:07:18 +0000 Received: by mail-qc0-f176.google.com with SMTP id z10so1019346qcx.21 for ; Thu, 25 Jul 2013 09:06:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version:content-type:x-gm-message-state; bh=GW8cEdrFnGR84HSlQ3WELVqm/0dP/hIVsFYWlPN6jkY=; b=EPNDLMehmN9prGr8r5+Y0FnZD3nAqRb9p6MjrF5YlAU+0rf+Y4Sma41kvJamRToozJ G0udRAgA523J3gXXN1Ct0jcnNDgI9yrI4aDCTSdmwDdK/DP5VPfvU1uqmyS5AQSNmDtn aTvn1WzOZOYxd3wOUGnHjhufcWes0HvM+xyU3LQsj3qbshbAYXbRKqR+CGW1cDI607eZ azZqSlxTzI0TxCdGGvYkoG9aGoi1WfwodunKDrZhDcqjkEKCXS8GR2iMyznzNgLJkoCa xwrWrYvUTFytk2vviDhsuv54U/TwiY3z1d+UjhoBZeFRoUvVVqpALo+U6uH56zfcKQ7A 22ww== 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 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: ALoCoQk8gKqtE298rr+em13vQ9pzaCkIwDQU6JD6RkzuRBkiJgJD1CMuzCCwVKBSEozVZ0b2br9m X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130725_120718_563622_195C72CF X-CRM114-Status: GOOD ( 18.00 ) X-Spam-Score: -2.6 (--) Cc: Dave Martin , lorenzo.pieralisi@arm.com, linux-arm-kernel@lists.infradead.org, patches@linaro.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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)) {