Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752863AbdGMW66 (ORCPT ); Thu, 13 Jul 2017 18:58:58 -0400 Received: from mail-wm0-f44.google.com ([74.125.82.44]:38676 "EHLO mail-wm0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752045AbdGMW64 (ORCPT ); Thu, 13 Jul 2017 18:58:56 -0400 MIME-Version: 1.0 In-Reply-To: References: <20170708000303.21863-1-dbasehore@chromium.org> <20170708000303.21863-2-dbasehore@chromium.org> <20170713073200.uh3oxqowei6vxvwy@hirez.programming.kicks-ass.net> From: "dbasehore ." Date: Thu, 13 Jul 2017 15:58:53 -0700 X-Google-Sender-Auth: rAxUSwLckLqCFNgASJ0wk20jwZg Message-ID: Subject: Re: [PATCH v5 2/5] tick: Add freeze timer events To: "Rafael J. Wysocki" Cc: Peter Zijlstra , Linux Kernel Mailing List , Thomas Gleixner , Ingo Molnar , Rajneesh Bhardwaj , "the arch/x86 maintainers" , Platform Driver , "Rafael J . Wysocki" , Len Brown , Linux PM 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: 1529 Lines: 30 On Thu, Jul 13, 2017 at 8:09 AM, Rafael J. Wysocki wrote: > On Thu, Jul 13, 2017 at 9:32 AM, Peter Zijlstra wrote: >> On Fri, Jul 07, 2017 at 05:03:00PM -0700, Derek Basehore wrote: >>> Adds a new feature to tick to schedule wakeups on a CPU during freeze. >>> This won't fully wake up the system (devices are not resumed), but >>> allow simple platform functionality to be run during freeze with >>> little power impact. >>> >>> This implementation allows an idle driver to setup a timer event with >>> the clock event device when entering freeze by calling >>> tick_set_freeze_event. Only one caller should exist for the function. >>> >>> tick_freeze_event_expired is used to check if the timer went off when >>> the CPU wakes. >>> >>> The event is cleared by tick_clear_freeze_event. >> >> Why? What's wrong with using the RTC stuff? RTC should be able to wake >> suspended systems, see RTCWAKE(8). > > The RTC interrupt is an SCI (on ACPI systems) and we don't handle it > at this point, so we don't know what woke us up until we re-enable > interrupt handlers and run the one for the SCI. To add to that point, RTC wake ups are valid for fully waking up the system. The clock event wake up wasn't used for waking up the system before, so we know that we don't have to check if it should wake up the system entirely. The way rtc timers work right now, I think that we'd have to go all the way through resume devices to figure out if we should resume to user space or freeze again.