From patchwork Fri Apr 10 07:26:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 46995 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 130DD218D9 for ; Fri, 10 Apr 2015 07:27:13 +0000 (UTC) Received: by wgiv13 with SMTP id v13sf2053867wgi.3 for ; Fri, 10 Apr 2015 00:27:12 -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:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=AY8tKpSjVFeT5ithDxmgvUAVNT5chnQmi8K6ESZy4IM=; b=h7t7lxGLCbIioBavXFfQYN4MTDOgDvF+obPrgIkdHiaHkuzjKvEjRs+jOskOqGqMGD ZIKMGSNSAPp1qvEoX8vDfqLTX27NkuOwe0fLMLOw/mp3G0/FPdy9iWN1n3AXA6JHcZk0 LVeUj/aguSnFPAEl7TiXFW+0m5ioHbsL4tMu8+qcq2z8V2j6ZVx4itft2vvhac9U9jyQ F+7upvJzy7M1Bplp0MGThvlnsGGHeJyw7tJH5pSzNzAvXgbWq1UPUL4Pc2n7WkrFqgSF vCdCFnvME2K3gqy+UzcT24E5dfhR+h19MruBr3OpESxOwy2v+pi6DqUtyP5umgmrWtQT m+ng== X-Gm-Message-State: ALoCoQkHK2561WCvkH/yxOiPnGOMayyiqWajbPVtmbGSz2EUzHg6enmMP+JSHDeghfEsO87AkuPC X-Received: by 10.112.26.5 with SMTP id h5mr51311lbg.4.1428650832266; Fri, 10 Apr 2015 00:27:12 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.43.41 with SMTP id t9ls427028lal.82.gmail; Fri, 10 Apr 2015 00:27:12 -0700 (PDT) X-Received: by 10.152.88.99 with SMTP id bf3mr165592lab.97.1428650832071; Fri, 10 Apr 2015 00:27:12 -0700 (PDT) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com. [209.85.215.54]) by mx.google.com with ESMTPS id rp7si809200lbb.83.2015.04.10.00.27.12 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Apr 2015 00:27:12 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.54 as permitted sender) client-ip=209.85.215.54; Received: by laat2 with SMTP id t2so7124380laa.1 for ; Fri, 10 Apr 2015 00:27:12 -0700 (PDT) X-Received: by 10.152.28.5 with SMTP id x5mr198085lag.112.1428650831974; Fri, 10 Apr 2015 00:27:11 -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.67.65 with SMTP id l1csp921657lbt; Fri, 10 Apr 2015 00:27:11 -0700 (PDT) X-Received: by 10.70.135.168 with SMTP id pt8mr473951pdb.8.1428650830256; Fri, 10 Apr 2015 00:27:10 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id jp11si1673893pbb.255.2015.04.10.00.27.09; Fri, 10 Apr 2015 00:27:10 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754049AbbDJH0v (ORCPT + 27 others); Fri, 10 Apr 2015 03:26:51 -0400 Received: from mail-pd0-f175.google.com ([209.85.192.175]:34641 "EHLO mail-pd0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751300AbbDJH0u (ORCPT ); Fri, 10 Apr 2015 03:26:50 -0400 Received: by pdbqa5 with SMTP id qa5so14251769pdb.1 for ; Fri, 10 Apr 2015 00:26:49 -0700 (PDT) X-Received: by 10.66.149.8 with SMTP id tw8mr351851pab.69.1428650809646; Fri, 10 Apr 2015 00:26:49 -0700 (PDT) Received: from localhost ([122.167.118.120]) by mx.google.com with ESMTPSA id v3sm1212921pbs.18.2015.04.10.00.26.48 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 10 Apr 2015 00:26:48 -0700 (PDT) From: Viresh Kumar To: Ingo Molnar , Thomas Gleixner , Peter Zijlstra Cc: linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org, Daniel Lezcano , Viresh Kumar Subject: [PATCH] clockevents: Shutdown detached clockevent device Date: Fri, 10 Apr 2015 12:56:41 +0530 Message-Id: X-Mailer: git-send-email 2.3.0.rc0.44.ga94655d 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.54 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: , A clockevent device is marked DETACHED when it is replaced by another clockevent device. The device is shutdown properly for drivers that implement legacy ->set_mode() callback, as we call ->set_mode() for CLOCK_EVT_MODE_UNUSED as well. But for the new per-state callback interface, we skip shutting down the device, as we thought its an internal state change. That wasn't correct. The effect is that the device is left programmed in oneshot or periodic mode. Fall-back to 'case CLOCK_EVT_STATE_SHUTDOWN', to shutdown the device. Fixes: bd624d75db21 ("clockevents: Introduce mode specific callbacks") Reported-by: Daniel Lezcano Signed-off-by: Viresh Kumar --- Tested on Samsung's Arndale (Dual Cortex A15) board. kernel/time/clockevents.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c index 25d942d1da27..629be4e21e96 100644 --- a/kernel/time/clockevents.c +++ b/kernel/time/clockevents.c @@ -117,11 +117,7 @@ static int __clockevents_set_state(struct clock_event_device *dev, /* Transition with new state-specific callbacks */ switch (state) { case CLOCK_EVT_STATE_DETACHED: - /* - * This is an internal state, which is guaranteed to go from - * SHUTDOWN to DETACHED. No driver interaction required. - */ - return 0; + /* The clockevent device is getting replaced. Shut it down. */ case CLOCK_EVT_STATE_SHUTDOWN: return dev->set_state_shutdown(dev);