Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752388AbdGRUJx (ORCPT ); Tue, 18 Jul 2017 16:09:53 -0400 Received: from mail-wr0-f175.google.com ([209.85.128.175]:34838 "EHLO mail-wr0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751927AbdGRUJv (ORCPT ); Tue, 18 Jul 2017 16:09:51 -0400 MIME-Version: 1.0 In-Reply-To: References: <20170708000303.21863-1-dbasehore@chromium.org> <7467728.lI8lN4PjS8@aspire.rjw.lan> From: "dbasehore ." Date: Tue, 18 Jul 2017 13:09:48 -0700 X-Google-Sender-Auth: lRuV6LGfCAHN57Ls_TVwqQ5IHuU Message-ID: Subject: Re: [PATCH v5 2/5] tick: Add freeze timer events To: Thomas Gleixner Cc: "Rafael J. Wysocki" , "Rafael J. Wysocki" , Peter Zijlstra , Linux Kernel Mailing List , Ingo Molnar , Rajneesh Bhardwaj , "the arch/x86 maintainers" , Platform Driver , 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: 1324 Lines: 28 On Mon, Jul 17, 2017 at 11:40 PM, Thomas Gleixner wrote: > On Mon, 17 Jul 2017, dbasehore . wrote: >> On Mon, Jul 17, 2017 at 6:33 PM, Rafael J. Wysocki wrote: >> I could make a patch to try it out. I would probably add a flag to rtc >> timers to indicate whether it wakes the system (default true). We >> would have to add a sync with the rtc irq and the rtc irqwork. I would >> probably add a rtc_timer_sync function that would flush the rtc irq >> and flush the irqwork. I would call this after the freeze_ops sync >> function since the sci irq needs to finish before syncing with the rtc >> irq. Also, pm_wakeup_irq seems racy with the current implementation of >> s2idle_loop since the RTC irq could be mistakenly set as pm_wakeup_irq >> when something else actually triggered the full wakeup. Fortunately, I >> don't think pm_wakeup_irq is used for anything except debugging, but >> we might change that. > > There is another option which you might consider. We can reserve one of the > HPET comparators for that purpose and have a special interrupt handler for > it. Checking the HPET for expiry from the low level code should be trivial. > Does that handle setting up new timers properly or does the timer sync code still need to be written? > Thanks, > > tglx > >