From patchwork Thu Jul 16 11:26:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 51150 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E267422A28 for ; Thu, 16 Jul 2015 11:27:11 +0000 (UTC) Received: by laef2 with SMTP id f2sf18022259lae.0 for ; Thu, 16 Jul 2015 04:27:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:in-reply-to:references :sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=LE9vB/WpCiYa4dndyo1b5ody33xlW2KCdbiCYFlRF5E=; b=IQ/Nj3Z9EL+4nrg2GvJyB0iEQoTq4obvf/DV3Z43gy96d7leeX4hNjDxlhfr7Woecn jb9M8hYPE0qc98AeqdHGuzuu0DNDM/LT8zvWBoA8TlRDefKys6jcjbBEM5rL8Y3O+THG 0nQJ0Ie/9rEjJZgcb4EXxY1MyWppmTbhvDt0dbHMnDXMN6xPLOD/Z0X8jlKm6MDPw4xL 1ZzJ3iDMydmZLTxKv6mA/t+7tlf4l2l7DPlFUO9ow0a21cKA8gxWtGg6hCmz/EZ6JOKL M/8u8jxyFONJl1vGry+zGMljJ1K6dHdxdajGRRTHknA2PixSdeDKPgBGHhg0AyYfsoMw ybWA== X-Gm-Message-State: ALoCoQlJ7CKEii+GX8mvyH9tye/EEpRkAWxKMOXnLkZhdITGTYeX3aL20Ox10C2wfflAGeseqFg0 X-Received: by 10.194.2.169 with SMTP id 9mr4666308wjv.2.1437046030856; Thu, 16 Jul 2015 04:27:10 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.6.231 with SMTP id e7ls320073laa.34.gmail; Thu, 16 Jul 2015 04:27:10 -0700 (PDT) X-Received: by 10.112.140.9 with SMTP id rc9mr9061739lbb.14.1437046030587; Thu, 16 Jul 2015 04:27:10 -0700 (PDT) Received: from mail-lb0-f171.google.com (mail-lb0-f171.google.com. [209.85.217.171]) by mx.google.com with ESMTPS id k14si6714139lbh.10.2015.07.16.04.27.10 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Jul 2015 04:27:10 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.171 as permitted sender) client-ip=209.85.217.171; Received: by lbbzr7 with SMTP id zr7so41800341lbb.1 for ; Thu, 16 Jul 2015 04:27:10 -0700 (PDT) X-Received: by 10.152.36.102 with SMTP id p6mr8923672laj.19.1437046030476; Thu, 16 Jul 2015 04:27:10 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp190999lbb; Thu, 16 Jul 2015 04:27:09 -0700 (PDT) X-Received: by 10.68.139.193 with SMTP id ra1mr17357342pbb.121.1437046028626; Thu, 16 Jul 2015 04:27:08 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id iw5si12547099pbc.27.2015.07.16.04.27.07; Thu, 16 Jul 2015 04:27:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754618AbbGPL1D (ORCPT + 27 others); Thu, 16 Jul 2015 07:27:03 -0400 Received: from mail-pd0-f171.google.com ([209.85.192.171]:33611 "EHLO mail-pd0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754580AbbGPL1B (ORCPT ); Thu, 16 Jul 2015 07:27:01 -0400 Received: by pdbqm3 with SMTP id qm3so42997557pdb.0 for ; Thu, 16 Jul 2015 04:27:00 -0700 (PDT) X-Received: by 10.69.17.130 with SMTP id ge2mr17400437pbd.75.1437046020569; Thu, 16 Jul 2015 04:27:00 -0700 (PDT) Received: from localhost ([122.171.186.190]) by smtp.gmail.com with ESMTPSA id qg5sm7699758pdb.13.2015.07.16.04.26.58 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 16 Jul 2015 04:26:59 -0700 (PDT) From: Viresh Kumar To: Thomas Gleixner , Daniel Lezcano Cc: linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org, Viresh Kumar , Richard Henderson , Ivan Kokshaysky , Matt Turner , Christoph Lameter , linux-alpha@vger.kernel.org, Tejun Heo Subject: [PATCH 01/23] alpha/time: Migrate to new 'set-state' interface Date: Thu, 16 Jul 2015 16:56:13 +0530 Message-Id: X-Mailer: git-send-email 2.4.0 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.171 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Migrate alpha driver to the new 'set-state' interface provided by clockevents core, the earlier 'set-mode' interface is marked obsolete now. This also enables us to implement callbacks for new states of clockevent devices, for example: ONESHOT_STOPPED. rtc clockevent device wasn't doing anything in set-mode and so its set-state callbacks aren't implemented. Cc: Richard Henderson Cc: Ivan Kokshaysky Cc: Matt Turner Cc: Christoph Lameter Cc: linux-alpha@vger.kernel.org Signed-off-by: Viresh Kumar --- arch/alpha/kernel/time.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/arch/alpha/kernel/time.c b/arch/alpha/kernel/time.c index 643a9dcdf093..5b6202a825ff 100644 --- a/arch/alpha/kernel/time.c +++ b/arch/alpha/kernel/time.c @@ -93,7 +93,7 @@ rtc_timer_interrupt(int irq, void *dev) struct clock_event_device *ce = &per_cpu(cpu_ce, cpu); /* Don't run the hook for UNUSED or SHUTDOWN. */ - if (likely(ce->mode == CLOCK_EVT_MODE_PERIODIC)) + if (likely(clockevent_state_periodic(ce))) ce->event_handler(ce); if (test_irq_work_pending()) { @@ -104,13 +104,6 @@ rtc_timer_interrupt(int irq, void *dev) return IRQ_HANDLED; } -static void -rtc_ce_set_mode(enum clock_event_mode mode, struct clock_event_device *ce) -{ - /* The mode member of CE is updated in generic code. - Since we only support periodic events, nothing to do. */ -} - static int rtc_ce_set_next_event(unsigned long evt, struct clock_event_device *ce) { @@ -129,7 +122,6 @@ init_rtc_clockevent(void) .features = CLOCK_EVT_FEAT_PERIODIC, .rating = 100, .cpumask = cpumask_of(cpu), - .set_mode = rtc_ce_set_mode, .set_next_event = rtc_ce_set_next_event, }; @@ -161,12 +153,12 @@ static struct clocksource qemu_cs = { * The QEMU alarm as a clock_event_device primitive. */ -static void -qemu_ce_set_mode(enum clock_event_mode mode, struct clock_event_device *ce) +static int qemu_ce_shutdown(struct clock_event_device *ce) { /* The mode member of CE is updated for us in generic code. Just make sure that the event is disabled. */ qemu_set_alarm_abs(0); + return 0; } static int @@ -197,7 +189,9 @@ init_qemu_clockevent(void) .features = CLOCK_EVT_FEAT_ONESHOT, .rating = 400, .cpumask = cpumask_of(cpu), - .set_mode = qemu_ce_set_mode, + .set_state_shutdown = qemu_ce_shutdown, + .set_state_oneshot = qemu_ce_shutdown, + .tick_resume = qemu_ce_shutdown, .set_next_event = qemu_ce_set_next_event, };