Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755880AbcDLF33 (ORCPT ); Tue, 12 Apr 2016 01:29:29 -0400 Received: from mail-oi0-f66.google.com ([209.85.218.66]:35146 "EHLO mail-oi0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750888AbcDLF30 (ORCPT ); Tue, 12 Apr 2016 01:29:26 -0400 From: "Bill Huey (hui)" To: Peter Zijlstra , Steven Rostedt , linux-kernel@vger.kernel.org Cc: Dario Faggioli , Alessandro Zummo , Thomas Gleixner , KY Srinivasan , Amir Frenkel , Bdale Garbee Subject: [PATCH RFC v0 02/12] Reroute rtc update irqs to the cyclic scheduler handler Date: Mon, 11 Apr 2016 22:29:10 -0700 Message-Id: <1460438960-32060-3-git-send-email-bill.huey@gmail.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1460438960-32060-1-git-send-email-bill.huey@gmail.com> References: <1460438960-32060-1-git-send-email-bill.huey@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1742 Lines: 60 Redirect rtc update irqs so that it drives the cyclic scheduler timer handler instead. Let the handler determine which slot to activate next. Similar to scheduler tick handling but just for the cyclic scheduler. Signed-off-by: Bill Huey (hui) --- drivers/rtc/interface.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/drivers/rtc/interface.c b/drivers/rtc/interface.c index 9ef5f6f..6d39d40 100644 --- a/drivers/rtc/interface.c +++ b/drivers/rtc/interface.c @@ -17,6 +17,10 @@ #include #include +#ifdef CONFIG_RTC_CYCLIC +#include "../kernel/sched/cyclic.h" +#endif + static int rtc_timer_enqueue(struct rtc_device *rtc, struct rtc_timer *timer); static void rtc_timer_remove(struct rtc_device *rtc, struct rtc_timer *timer); @@ -488,6 +492,9 @@ EXPORT_SYMBOL_GPL(rtc_update_irq_enable); void rtc_handle_legacy_irq(struct rtc_device *rtc, int num, int mode) { unsigned long flags; +#ifdef CONFIG_RTC_CYCLIC + int handled = 0; +#endif /* mark one irq of the appropriate mode */ spin_lock_irqsave(&rtc->irq_lock, flags); @@ -500,7 +507,23 @@ void rtc_handle_legacy_irq(struct rtc_device *rtc, int num, int mode) rtc->irq_task->func(rtc->irq_task->private_data); spin_unlock_irqrestore(&rtc->irq_task_lock, flags); +#ifdef CONFIG_RTC_CYCLIC + /* wake up slot_curr if overrun task */ + if (RTC_PF) { + if (rt_overrun_rq_admitted()) { + /* advance the cursor, overrun report */ + rt_overrun_timer_handler(rtc); + handled = 1; + } + } + + if (!handled) { + wake_up_interruptible(&rtc->irq_queue); + } +#else wake_up_interruptible(&rtc->irq_queue); +#endif + kill_fasync(&rtc->async_queue, SIGIO, POLL_IN); } -- 2.5.0