From patchwork Fri Feb 28 08:45: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: 25513 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f198.google.com (mail-qc0-f198.google.com [209.85.216.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 561D5203C5 for ; Fri, 28 Feb 2014 08:46:17 +0000 (UTC) Received: by mail-qc0-f198.google.com with SMTP id x3sf900034qcv.9 for ; Fri, 28 Feb 2014 00:46:17 -0800 (PST) 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=5mqsX1cC84k+3eBl5Pf6rX7WYqlJJBI2zze32njfaRc=; b=B+M3DGmTf+981QoknmUgNt1lNkoomgLSi/D+PeOU6P3mtIPtTFV5v5FJqb1BtCIfKK 92oUU8Ef1MqbtZ2mez9UXnnBXpBhXVflDxEKWrfDIi91Qc67p2xzNljNxIpD+buZzlpC DbXL+iGSYc+WcIwRPaeYaujLwBuVTmpIY9yExGBh4lq8I2Z4UFnScrTz3ixPzGhi3q3x /Iz6SuA9Hxv0EMbs3zrnL0Ipw5V+iGFTPya1EPDQi9hhMwuHeFp6WUx29V878lrBT4bk rs1fBqWZ+/IBgKB0bFDlqDlS4tsSACvODwoofM8HcxmaJFBPKo4J4JzMXe15udzlo+Kn LT4A== X-Gm-Message-State: ALoCoQkjK0EjDAQyuVukzZWb84Qdhpxd+x7lSVTT0PF5kRrxWzIc0ev+A5bVeyeoa5gZU6cux9Dt X-Received: by 10.236.92.202 with SMTP id j50mr626638yhf.26.1393577177119; Fri, 28 Feb 2014 00:46:17 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.86.51 with SMTP id o48ls983199qgd.83.gmail; Fri, 28 Feb 2014 00:46:17 -0800 (PST) X-Received: by 10.220.11.141 with SMTP id t13mr1444646vct.30.1393577176976; Fri, 28 Feb 2014 00:46:16 -0800 (PST) Received: from mail-ve0-f176.google.com (mail-ve0-f176.google.com [209.85.128.176]) by mx.google.com with ESMTPS id tx7si1658321vcb.8.2014.02.28.00.46.16 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 28 Feb 2014 00:46:16 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.176; Received: by mail-ve0-f176.google.com with SMTP id cz12so416713veb.7 for ; Fri, 28 Feb 2014 00:46:16 -0800 (PST) X-Received: by 10.52.243.102 with SMTP id wx6mr12298745vdc.12.1393577176892; Fri, 28 Feb 2014 00:46:16 -0800 (PST) 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.130.193 with SMTP id u1csp38777vcs; Fri, 28 Feb 2014 00:46:16 -0800 (PST) X-Received: by 10.68.190.228 with SMTP id gt4mr2218791pbc.94.1393577175751; Fri, 28 Feb 2014 00:46:15 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bl2si1208329pbb.132.2014.02.28.00.46.15; Fri, 28 Feb 2014 00:46:15 -0800 (PST) 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 S1751960AbaB1Ipt (ORCPT + 26 others); Fri, 28 Feb 2014 03:45:49 -0500 Received: from mail-wi0-f179.google.com ([209.85.212.179]:39319 "EHLO mail-wi0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751164AbaB1Ipk (ORCPT ); Fri, 28 Feb 2014 03:45:40 -0500 Received: by mail-wi0-f179.google.com with SMTP id bs8so297223wib.6 for ; Fri, 28 Feb 2014 00:45:39 -0800 (PST) X-Received: by 10.194.61.210 with SMTP id s18mr1521642wjr.10.1393577139048; Fri, 28 Feb 2014 00:45:39 -0800 (PST) Received: from localhost ([213.122.173.131]) by mx.google.com with ESMTPSA id uq2sm2578620wjc.5.2014.02.28.00.45.35 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 28 Feb 2014 00:45:38 -0800 (PST) From: Viresh Kumar To: tglx@linutronix.de Cc: linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org, fweisbec@gmail.com, tj@kernel.org, peterz@infradead.org, mingo@kernel.org, Viresh Kumar Subject: [PATCH 2/2] timer: Make sure TIMER_FLAG_MASK bits are free in allocated base Date: Fri, 28 Feb 2014 14:15:22 +0530 Message-Id: <9144e10d7e854a0aa8a673332adec356d81a923c.1393576981.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e 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: 209.85.128.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) 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: , Currently we are using two lowest bit of base for internal purpose and so they both should be zero in the allocated address. The code was doing the right thing before this patch came in: commit c5f66e99b7cb091e3d51ae8e8156892e8feb7fa3 Author: Tejun Heo Date: Wed Aug 8 11:10:28 2012 -0700 timer: Implement TIMER_IRQSAFE Tejun probably forgot to update this piece of code which checks if the lowest 'n' bits are zero or not and so wasn't updated according to the new flag. Lets use TIMER_FLAG_MASK in the calculations here, so that this code wouldn't require a change later on with another flag in. Signed-off-by: Viresh Kumar --- kernel/timer.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/kernel/timer.c b/kernel/timer.c index e8e7839..d52a8ff 100644 --- a/kernel/timer.c +++ b/kernel/timer.c @@ -1548,9 +1548,8 @@ static int init_timers_cpu(int cpu) if (!base) return -ENOMEM; - /* Make sure that tvec_base is 2 byte aligned */ - if (tbase_get_deferrable(base)) { - WARN_ON(1); + /* Make sure tvec_base has TIMER_FLAG_MASK bits free */ + if (WARN_ON(base != tbase_get_base(base))) { kfree(base); return -ENOMEM; }