From patchwork Fri May 9 08:40:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 29881 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f71.google.com (mail-qa0-f71.google.com [209.85.216.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E8C1E20675 for ; Fri, 9 May 2014 08:41:08 +0000 (UTC) Received: by mail-qa0-f71.google.com with SMTP id w8sf9577392qac.2 for ; Fri, 09 May 2014 01:41:08 -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=FYpKnw2jLkGzPWSU65lGPV+5BoGOL5lGt/ggPYiGplo=; b=MuiLF964ETQucSSmVgjRwTgi6r+sUlRnfLmrzjJw3a9/XXKbaPpXXr5CSEVaJSWLED 6RtyJJOnQF71OCAzBLVzHpD6JS/3O978iCS9LBBmIPS0EwRf3MHJ+WmyIAuyspiF1O/+ U12yGDOk27fpKqvlllDJLFa6gSCKhsPKgXW0FUXc1qaV7f0ZaLkzorSC+56jJ/i/Km/B hK2/pq3b5lFcQzBZRuHPbp6CQvTMm37IBvcIe2l2rm3ab/vrQiLmteJmdxKyRa7FCgsp 6GDvkCoEcw8PnRplLJBOM4zARoyY0h3TbGXdzVJiil3vo6s3+chPwd7gstxW6LEPAv3p 1urw== X-Gm-Message-State: ALoCoQnzBjxoF9d7pYuDiq53O+aQUuKVKIzfk4cQ0G9wtMaYoNc8MiwWxl4Da4fe3FjgWE0IBE4j X-Received: by 10.236.141.11 with SMTP id f11mr4241463yhj.54.1399624868674; Fri, 09 May 2014 01:41:08 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.95.84 with SMTP id h78ls186391qge.54.gmail; Fri, 09 May 2014 01:41:08 -0700 (PDT) X-Received: by 10.220.163.3 with SMTP id y3mr7374406vcx.7.1399624868428; Fri, 09 May 2014 01:41:08 -0700 (PDT) Received: from mail-ve0-f174.google.com (mail-ve0-f174.google.com [209.85.128.174]) by mx.google.com with ESMTPS id fo15si610506vcb.171.2014.05.09.01.41.08 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 09 May 2014 01:41:08 -0700 (PDT) Received-SPF: none (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) client-ip=209.85.128.174; Received: by mail-ve0-f174.google.com with SMTP id jw12so4803582veb.33 for ; Fri, 09 May 2014 01:41:08 -0700 (PDT) X-Received: by 10.220.92.135 with SMTP id r7mr7362104vcm.11.1399624868342; Fri, 09 May 2014 01:41:08 -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.220.221.72 with SMTP id ib8csp61203vcb; Fri, 9 May 2014 01:41:07 -0700 (PDT) X-Received: by 10.66.241.199 with SMTP id wk7mr15153933pac.7.1399624867605; Fri, 09 May 2014 01:41:07 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id rx8si1120958pab.186.2014.05.09.01.41.06; Fri, 09 May 2014 01:41:07 -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 S1756345AbaEIIk7 (ORCPT + 27 others); Fri, 9 May 2014 04:40:59 -0400 Received: from mail-we0-f169.google.com ([74.125.82.169]:61776 "EHLO mail-we0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751517AbaEIIk4 (ORCPT ); Fri, 9 May 2014 04:40:56 -0400 Received: by mail-we0-f169.google.com with SMTP id u56so3692742wes.0 for ; Fri, 09 May 2014 01:40:55 -0700 (PDT) X-Received: by 10.194.206.2 with SMTP id lk2mr7221912wjc.33.1399624855146; Fri, 09 May 2014 01:40:55 -0700 (PDT) Received: from localhost ([213.122.173.131]) by mx.google.com with ESMTPSA id h1sm4597434wjy.7.2014.05.09.01.40.51 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 09 May 2014 01:40:54 -0700 (PDT) From: Viresh Kumar To: tglx@linutronix.de Cc: linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org, fweisbec@gmail.com, arvind.chauhan@arm.com, preeti@linux.vnet.ibm.com, khilman@linaro.org, Viresh Kumar Subject: [PATCH 1/2] hrtimer: reprogram event for expires=KTIME_MAX in hrtimer_force_reprogram() Date: Fri, 9 May 2014 14:10:22 +0530 Message-Id: <189ea71f724d00995a73e63c8ed9ff5b7857a69d.1399623699.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.0.0.rc2 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=neutral (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) 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: , In hrtimer_force_reprogram(), we are reprogramming event device only if the next timer event is before KTIME_MAX. But what if it is equal to KTIME_MAX? As we aren't reprogramming it again, it will be set to the last value it was, probably tick interval, i.e. few milliseconds. And we will get a interrupt due to that, wouldn't have any hrtimers to service and return without doing much. But the implementation of event device's driver may make it more stupid. For example: drivers/clocksource/arm_arch_timer.c disables the event device only on SHUTDOWN/UNUSED requests in set-mode. Otherwise, it will keep giving interrupts at tick interval even if hrtimer_interrupt() didn't reprogram tick.. To get this fixed, lets reprogram event device even for KTIME_MAX, so that the timer is scheduled for long enough. Signed-off-by: Viresh Kumar --- kernel/hrtimer.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c index 6b715c0..b21085c 100644 --- a/kernel/hrtimer.c +++ b/kernel/hrtimer.c @@ -591,8 +591,7 @@ hrtimer_force_reprogram(struct hrtimer_cpu_base *cpu_base, int skip_equal) if (cpu_base->hang_detected) return; - if (cpu_base->expires_next.tv64 != KTIME_MAX) - tick_program_event(cpu_base->expires_next, 1); + tick_program_event(cpu_base->expires_next, 1); } /*