Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755773AbcKJSSr (ORCPT ); Thu, 10 Nov 2016 13:18:47 -0500 Received: from mail-ua0-f170.google.com ([209.85.217.170]:35778 "EHLO mail-ua0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754369AbcKJSSp (ORCPT ); Thu, 10 Nov 2016 13:18:45 -0500 MIME-Version: 1.0 In-Reply-To: <1478787873-18180-1-git-send-email-sudeep.holla@arm.com> References: <1478713410-10727-1-git-send-email-sudeep.holla@arm.com> <1478787873-18180-1-git-send-email-sudeep.holla@arm.com> From: Andy Gross Date: Thu, 10 Nov 2016 12:18:43 -0600 Message-ID: Subject: Re: [PATCH v2] drivers: cpuidle: assign enter_freeze to same as enter callback function To: Sudeep Holla Cc: linux-pm@vger.kernel.org, "Rafael J . Wysocki" , Linux Kernel list , Daniel Lezcano , Lorenzo Pieralisi , Vincent Guittot 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: 1448 Lines: 33 On 10 November 2016 at 08: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 Tested this on a Qualcomm 410c dragonboard. Worked great. Thanks for the patch! Tested-by: Andy Gross