From patchwork Thu Jul 16 11:26:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 51163 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id EB13522A28 for ; Thu, 16 Jul 2015 11:29:22 +0000 (UTC) Received: by lbbpo10 with SMTP id po10sf17641110lbb.1 for ; Thu, 16 Jul 2015 04:29:21 -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=OThBDy07ITyrOO9xIsQuirNHRNxbKO7ovMVP1ATRelQ=; b=Zd3osk6zq/tS/641vQVZFIv5neSXNQFLKyjFi3kXwg2BluxHTNW0OV8Yfqen4xkbnU DDnB342sCrUPPDl7vwOZPwHV0m5aMeVwaK/v7pyWeZoPsqRXJL8oze0NQTW067JI1NTv Is4raq0UyiqD5xbXqExIjeeN7Ef9jPeiLq5BObV0nCkV55J2++zK5RYr8PPRzb+S+y6X eFV5SiojtvGPt5IFXk5MX8yZoTaZUqVl5I1yfbsXSQvejyfoX7gbHSA6CjtdEBD9qwm8 8EC/an8783orrS9Db9Rx4whU2hEfj+t4+RWwBdgJRFunHGawcQumnWwCssavSEMylY+H zWnw== X-Gm-Message-State: ALoCoQntVXVm58PtzcqXzqEOTzmx+1ibxNUMlmoh0Ype3vNtkoFSab4YXu6KCIiKk8T5K57IvC5j X-Received: by 10.112.99.37 with SMTP id en5mr4576901lbb.7.1437046161910; Thu, 16 Jul 2015 04:29:21 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.36.227 with SMTP id t3ls351525laj.72.gmail; Thu, 16 Jul 2015 04:29:21 -0700 (PDT) X-Received: by 10.152.184.44 with SMTP id er12mr8884903lac.94.1437046161602; Thu, 16 Jul 2015 04:29:21 -0700 (PDT) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com. [209.85.217.176]) by mx.google.com with ESMTPS id dp7si6676369lbc.155.2015.07.16.04.29.21 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Jul 2015 04:29:21 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) client-ip=209.85.217.176; Received: by lbbyj8 with SMTP id yj8so41821451lbb.0 for ; Thu, 16 Jul 2015 04:29:21 -0700 (PDT) X-Received: by 10.112.166.106 with SMTP id zf10mr8942129lbb.36.1437046161490; Thu, 16 Jul 2015 04:29:21 -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 hn6csp192089lbb; Thu, 16 Jul 2015 04:29:20 -0700 (PDT) X-Received: by 10.66.138.16 with SMTP id qm16mr18114168pab.29.1437046159622; Thu, 16 Jul 2015 04:29:19 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w10si12507253pas.189.2015.07.16.04.29.18; Thu, 16 Jul 2015 04:29:19 -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 S1755433AbbGPL3J (ORCPT + 27 others); Thu, 16 Jul 2015 07:29:09 -0400 Received: from mail-pd0-f169.google.com ([209.85.192.169]:34299 "EHLO mail-pd0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752199AbbGPL3G (ORCPT ); Thu, 16 Jul 2015 07:29:06 -0400 Received: by pdbep18 with SMTP id ep18so44385719pdb.1 for ; Thu, 16 Jul 2015 04:29:06 -0700 (PDT) X-Received: by 10.66.62.163 with SMTP id z3mr17586235par.12.1437046146499; Thu, 16 Jul 2015 04:29:06 -0700 (PDT) Received: from localhost ([122.171.186.190]) by smtp.gmail.com with ESMTPSA id sd7sm7631409pbb.93.2015.07.16.04.29.05 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 16 Jul 2015 04:29:05 -0700 (PDT) From: Viresh Kumar To: Thomas Gleixner , Daniel Lezcano Cc: linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org, Viresh Kumar , Jeff Dike , Richard Weinberger , user-mode-linux-devel@lists.sourceforge.net, user-mode-linux-user@lists.sourceforge.net Subject: [PATCH 19/23] um/time: Migrate to new 'set-state' interface Date: Thu, 16 Jul 2015 16:56:31 +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.176 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 um 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. Cc: Jeff Dike Cc: Richard Weinberger Cc: user-mode-linux-devel@lists.sourceforge.net Cc: user-mode-linux-user@lists.sourceforge.net Signed-off-by: Viresh Kumar --- arch/um/kernel/time.c | 44 ++++++++++++++++++++------------------------ 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/arch/um/kernel/time.c b/arch/um/kernel/time.c index 117568d4f64a..5af441efb377 100644 --- a/arch/um/kernel/time.c +++ b/arch/um/kernel/time.c @@ -22,23 +22,16 @@ void timer_handler(int sig, struct siginfo *unused_si, struct uml_pt_regs *regs) local_irq_restore(flags); } -static void itimer_set_mode(enum clock_event_mode mode, - struct clock_event_device *evt) +static int itimer_shutdown(struct clock_event_device *evt) { - switch (mode) { - case CLOCK_EVT_MODE_PERIODIC: - set_interval(); - break; - - case CLOCK_EVT_MODE_SHUTDOWN: - case CLOCK_EVT_MODE_UNUSED: - case CLOCK_EVT_MODE_ONESHOT: - disable_timer(); - break; - - case CLOCK_EVT_MODE_RESUME: - break; - } + disable_timer(); + return 0; +} + +static int itimer_set_periodic(struct clock_event_device *evt) +{ + set_interval(); + return 0; } static int itimer_next_event(unsigned long delta, @@ -48,14 +41,17 @@ static int itimer_next_event(unsigned long delta, } static struct clock_event_device itimer_clockevent = { - .name = "itimer", - .rating = 250, - .cpumask = cpu_all_mask, - .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, - .set_mode = itimer_set_mode, - .set_next_event = itimer_next_event, - .shift = 32, - .irq = 0, + .name = "itimer", + .rating = 250, + .cpumask = cpu_all_mask, + .features = CLOCK_EVT_FEAT_PERIODIC | + CLOCK_EVT_FEAT_ONESHOT, + .set_state_shutdown = itimer_shutdown, + .set_state_periodic = itimer_set_periodic, + .set_state_oneshot = itimer_shutdown, + .set_next_event = itimer_next_event, + .shift = 32, + .irq = 0, }; static irqreturn_t um_timer(int irq, void *dev)