From patchwork Thu Jul 16 10:58:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 51147 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f72.google.com (mail-wg0-f72.google.com [74.125.82.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E716922A8A for ; Thu, 16 Jul 2015 10:59:41 +0000 (UTC) Received: by wgjx7 with SMTP id x7sf17856005wgj.3 for ; Thu, 16 Jul 2015 03:59:41 -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=qhvCAExL8y3YMxdOTR4LLDqWo0bjZLpn0D0qQSA2Uh4=; b=JuUuufOzG/PPEHKVw2MPhSSJB7XJH3+Fu/ZNQmY2iNqst36jPWaANxLccOTc8pPv/z LkdLha63zNjDxg+vM8eZW9mvBjryOEpQCWEIVZEOfXVbCR6PmJVkrMYtcgjIDN7ZKmy/ RnuzSkwRWpfVsdajdp33XemLwLp6ewcIQxm78kh/H/HN1M2yTSGh2SBYOBGJ6uFyjrgs kT4a8ekNhu12uHYreLxh3IXhC1mEFgU3Yh/kKTnBzu0PugyKV1f4YMt5Y2ObHm+UvQwm 7XSaMmlgSMwF1gefMt9Z0FRtdWJ21TeW+gztN3xESqkmtJ0Vmj1/Pu2zXKyKZvv1izUr x5YQ== X-Gm-Message-State: ALoCoQlqbiQVUy+b96cajippBpJOeebl3Nq/jTTApj+TG9kxpZpNbL2d3QFam/tuQCA202eNON1d X-Received: by 10.152.37.101 with SMTP id x5mr4569393laj.5.1437044381228; Thu, 16 Jul 2015 03:59:41 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.120.40 with SMTP id kz8ls359024lab.24.gmail; Thu, 16 Jul 2015 03:59:41 -0700 (PDT) X-Received: by 10.152.18.162 with SMTP id x2mr8810318lad.73.1437044381052; Thu, 16 Jul 2015 03:59:41 -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 ws3si6635702lbb.70.2015.07.16.03.59.41 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Jul 2015 03:59:41 -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 lahh5 with SMTP id h5so41163177lah.2 for ; Thu, 16 Jul 2015 03:59:41 -0700 (PDT) X-Received: by 10.112.139.103 with SMTP id qx7mr8820125lbb.73.1437044380950; Thu, 16 Jul 2015 03:59:40 -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 hn6csp175464lbb; Thu, 16 Jul 2015 03:59:39 -0700 (PDT) X-Received: by 10.70.37.77 with SMTP id w13mr17582744pdj.49.1437044379233; Thu, 16 Jul 2015 03:59:39 -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.37; Thu, 16 Jul 2015 03:59:39 -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 S1754332AbbGPK7Y (ORCPT + 26 others); Thu, 16 Jul 2015 06:59:24 -0400 Received: from mail-pa0-f53.google.com ([209.85.220.53]:36094 "EHLO mail-pa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752632AbbGPK7U (ORCPT ); Thu, 16 Jul 2015 06:59:20 -0400 Received: by pachj5 with SMTP id hj5so41182848pac.3 for ; Thu, 16 Jul 2015 03:59:19 -0700 (PDT) X-Received: by 10.66.249.101 with SMTP id yt5mr17473371pac.116.1437044359602; Thu, 16 Jul 2015 03:59:19 -0700 (PDT) Received: from localhost ([122.171.186.190]) by smtp.gmail.com with ESMTPSA id qa10sm7571307pbc.44.2015.07.16.03.59.18 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 16 Jul 2015 03:59:18 -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 , Rusty Russell , Alexander Kuleshov , Brian Gerst , Denys Vlasenko , Jan Beulich , Andy Lutomirski , lguest@lists.ozlabs.org (open list:LGUEST) Subject: [PATCH 3/5] x86/lguest/timer: Migrate to new 'set-state' interface Date: Thu, 16 Jul 2015 16:28:46 +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.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 lguest 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/lguest/boot.c | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/arch/x86/lguest/boot.c b/arch/x86/lguest/boot.c index f2dc08c003eb..433e5a7dd37f 100644 --- a/arch/x86/lguest/boot.c +++ b/arch/x86/lguest/boot.c @@ -985,23 +985,11 @@ static int lguest_clockevent_set_next_event(unsigned long delta, return 0; } -static void lguest_clockevent_set_mode(enum clock_event_mode mode, - struct clock_event_device *evt) -{ - switch (mode) { - case CLOCK_EVT_MODE_UNUSED: - case CLOCK_EVT_MODE_SHUTDOWN: - /* A 0 argument shuts the clock down. */ - hcall(LHCALL_SET_CLOCKEVENT, 0, 0, 0, 0); - break; - case CLOCK_EVT_MODE_ONESHOT: - /* This is what we expect. */ - break; - case CLOCK_EVT_MODE_PERIODIC: - BUG(); - case CLOCK_EVT_MODE_RESUME: - break; - } +static int lguest_clockevent_shutdown(struct clock_event_device *evt) +{ + /* A 0 argument shuts the clock down. */ + hcall(LHCALL_SET_CLOCKEVENT, 0, 0, 0, 0); + return 0; } /* This describes our primitive timer chip. */ @@ -1009,7 +997,7 @@ static struct clock_event_device lguest_clockevent = { .name = "lguest", .features = CLOCK_EVT_FEAT_ONESHOT, .set_next_event = lguest_clockevent_set_next_event, - .set_mode = lguest_clockevent_set_mode, + .set_state_shutdown = lguest_clockevent_shutdown, .rating = INT_MAX, .mult = 1, .shift = 0,