From patchwork Thu Jul 16 10:58:47 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 51148 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 96E1422A8A for ; Thu, 16 Jul 2015 10:59:44 +0000 (UTC) Received: by lbvb1 with SMTP id b1sf17413713lbv.3 for ; Thu, 16 Jul 2015 03:59:43 -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=VVMsgWTY+NEI8bXEXFKSdkAmw5IP/UWVYem7Z6eoGYc=; b=jiYyqXtlerMeNeKnVLwVYu/+AdiZpUaBMmVa8cagqAOh8kLx8XemHU03hukf+hlskX gG/jSnDl7PBGlB3XuXIyibfDiS2R71qYutgIgQ16MA8K20ZxEbiJloBtF6g7z8jPOpZs dGCco4a6soVPBYp3u4SqZXSlAritqraazQ2idzSIScplzOgRp2wiVJusPMTliW06WRV9 cDwyaoogaaEUAUKFrig9HCAqmHQ9t8msBSLljK4EW7AdPlUKiQBvVkinB7bEpOuDcWrb pLfJvZF64ThFP5wFjY8aAY+9rLHJ+vPe8sGI8FLeTzGcKpE3jL0UtDpPrOAixZy17siH DWRw== X-Gm-Message-State: ALoCoQmlygv/BQSv0TPtKV14frXFHnLWqG601PkeP/1MXnssgBeJsHUJSSEa4wW5KNfhejTjDeyv X-Received: by 10.112.253.135 with SMTP id aa7mr4524378lbd.11.1437044383494; Thu, 16 Jul 2015 03:59:43 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.219.4 with SMTP id pk4ls353235lac.90.gmail; Thu, 16 Jul 2015 03:59:43 -0700 (PDT) X-Received: by 10.152.28.42 with SMTP id y10mr8947838lag.9.1437044383312; Thu, 16 Jul 2015 03:59:43 -0700 (PDT) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com. [209.85.215.53]) by mx.google.com with ESMTPS id ls6si6642101lac.31.2015.07.16.03.59.43 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Jul 2015 03:59:43 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) client-ip=209.85.215.53; Received: by laem6 with SMTP id m6so41194216lae.0 for ; Thu, 16 Jul 2015 03:59:43 -0700 (PDT) X-Received: by 10.112.166.106 with SMTP id zf10mr8826700lbb.36.1437044383208; Thu, 16 Jul 2015 03:59:43 -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 hn6csp175486lbb; Thu, 16 Jul 2015 03:59:42 -0700 (PDT) X-Received: by 10.70.62.66 with SMTP id w2mr17364588pdr.106.1437044381423; Thu, 16 Jul 2015 03:59:41 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ki8si12417687pdb.218.2015.07.16.03.59.40; Thu, 16 Jul 2015 03:59:41 -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 S1754447AbbGPK73 (ORCPT + 26 others); Thu, 16 Jul 2015 06:59:29 -0400 Received: from mail-pa0-f42.google.com ([209.85.220.42]:35615 "EHLO mail-pa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752086AbbGPK70 (ORCPT ); Thu, 16 Jul 2015 06:59:26 -0400 Received: by pactm7 with SMTP id tm7so41410713pac.2 for ; Thu, 16 Jul 2015 03:59:26 -0700 (PDT) X-Received: by 10.68.69.11 with SMTP id a11mr17450111pbu.169.1437044366215; Thu, 16 Jul 2015 03:59:26 -0700 (PDT) Received: from localhost ([122.171.186.190]) by smtp.gmail.com with ESMTPSA id fk5sm7593440pab.40.2015.07.16.03.59.24 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 16 Jul 2015 03:59:25 -0700 (PDT) From: Viresh Kumar To: Thomas Gleixner , Ingo Molnar Cc: linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org, x86@kernel.org, hpa@zytor.com, Viresh Kumar , Christoph Lameter , Tejun Heo Subject: [PATCH 4/5] x86/uv/time: Migrate to new 'set-state' interface Date: Thu, 16 Jul 2015 16:28:47 +0530 Message-Id: <52e04139746222a2e82a96d13953cbc306cfb59b.1437042675.git.viresh.kumar@linaro.org> 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.215.53 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 uv 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. We weren't doing anything while switching modes other than in shutdown mode and so those are not implemented. Signed-off-by: Viresh Kumar --- arch/x86/platform/uv/uv_time.c | 37 +++++++++++++------------------------ 1 file changed, 13 insertions(+), 24 deletions(-) diff --git a/arch/x86/platform/uv/uv_time.c b/arch/x86/platform/uv/uv_time.c index a244237f3cfa..2b158a9fa1d7 100644 --- a/arch/x86/platform/uv/uv_time.c +++ b/arch/x86/platform/uv/uv_time.c @@ -32,8 +32,7 @@ static cycle_t uv_read_rtc(struct clocksource *cs); static int uv_rtc_next_event(unsigned long, struct clock_event_device *); -static void uv_rtc_timer_setup(enum clock_event_mode, - struct clock_event_device *); +static int uv_rtc_shutdown(struct clock_event_device *evt); static struct clocksource clocksource_uv = { .name = RTC_NAME, @@ -44,14 +43,14 @@ static struct clocksource clocksource_uv = { }; static struct clock_event_device clock_event_device_uv = { - .name = RTC_NAME, - .features = CLOCK_EVT_FEAT_ONESHOT, - .shift = 20, - .rating = 400, - .irq = -1, - .set_next_event = uv_rtc_next_event, - .set_mode = uv_rtc_timer_setup, - .event_handler = NULL, + .name = RTC_NAME, + .features = CLOCK_EVT_FEAT_ONESHOT, + .shift = 20, + .rating = 400, + .irq = -1, + .set_next_event = uv_rtc_next_event, + .set_state_shutdown = uv_rtc_shutdown, + .event_handler = NULL, }; static DEFINE_PER_CPU(struct clock_event_device, cpu_ced); @@ -321,24 +320,14 @@ static int uv_rtc_next_event(unsigned long delta, } /* - * Setup the RTC timer in oneshot mode + * Shutdown the RTC timer */ -static void uv_rtc_timer_setup(enum clock_event_mode mode, - struct clock_event_device *evt) +static int uv_rtc_shutdown(struct clock_event_device *evt) { int ced_cpu = cpumask_first(evt->cpumask); - switch (mode) { - case CLOCK_EVT_MODE_PERIODIC: - case CLOCK_EVT_MODE_ONESHOT: - case CLOCK_EVT_MODE_RESUME: - /* Nothing to do here yet */ - break; - case CLOCK_EVT_MODE_UNUSED: - case CLOCK_EVT_MODE_SHUTDOWN: - uv_rtc_unset_timer(ced_cpu, 1); - break; - } + uv_rtc_unset_timer(ced_cpu, 1); + return 0; } static void uv_rtc_interrupt(void)