Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936530AbcKXBH4 (ORCPT ); Wed, 23 Nov 2016 20:07:56 -0500 Received: from cloudserver094114.home.net.pl ([79.96.170.134]:56577 "EHLO cloudserver094114.home.net.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935632AbcKXBHy (ORCPT ); Wed, 23 Nov 2016 20:07:54 -0500 From: "Rafael J. Wysocki" To: Sudeep Holla Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Daniel Lezcano , Lorenzo Pieralisi , Andy Gross , Vincent Guittot Subject: Re: [PATCH v2] drivers: cpuidle: assign enter_freeze to same as enter callback function Date: Thu, 24 Nov 2016 02:15:41 +0100 Message-ID: <27933980.8pxBHcNLmE@vostro.rjw.lan> User-Agent: KMail/4.11.5 (Linux/4.9.0-rc5+; KDE/4.11.5; x86_64; ; ) In-Reply-To: References: <1478713410-10727-1-git-send-email-sudeep.holla@arm.com> <1478787873-18180-1-git-send-email-sudeep.holla@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="utf-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1755 Lines: 45 On Tuesday, November 15, 2016 02:20:21 PM Sudeep Holla wrote: > Hi Rafael, > > On 10/11/16 14:24, Sudeep Holla wrote: > > enter_freeze() callback is expected atleast to do the same as enter() > > but it has to guarantee that interrupts aren't enabled at any point > > in its execution, as the tick is frozen. > > > > CPUs execute ->enter_freeze with the local tick or entire timekeeping > > suspended, so it must not re-enable interrupts at any point (even > > temporarily) or attempt to change states of clock event devices. > > > > It will be called when the system goes to suspend-to-idle and will > > reduce power usage because CPUs won't be awaken for unnecessary IRQs > > (i.e. woken up only on IRQs from "wakeup sources") > > > > We can reuse the same code for both the enter() and enter_freeze() > > callbacks as along as they don't re-enable interrupts. Only "coupled" > > cpuidle mechanism enables interrupts and doing that with timekeeping > > suspended is generally not safe. > > > > Since this generic DT based idle driver doesn't support "coupled" > > states, it is safe to assume that the interrupts are not re-enabled. > > > > This patch assign enter_freeze to same as enter callback function which > > helps to save power without any intermittent spurious wakeups from > > suspend-to-idle. > > > > Cc: "Rafael J. Wysocki" > > Signed-off-by: Sudeep Holla > > --- > > drivers/cpuidle/dt_idle_states.c | 6 ++++++ > > 1 file changed, 6 insertions(+) > > > > v1->v2: > > - Dropped checking and using only states with CPUIDLE_FLAG_TIMER_STOP > > enabled. > > > > Can you pick up this patch directly if there are no concerns ? There were none, so it's been queued up for 4.10. Thanks, Rafael