From patchwork Thu Sep 12 16:50:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Soren Brinkmann X-Patchwork-Id: 2879201 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 281CB9F1C0 for ; Thu, 12 Sep 2013 16:52:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0AA8120320 for ; Thu, 12 Sep 2013 16:52:02 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B5F35202B9 for ; Thu, 12 Sep 2013 16:52:00 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VKA7K-0005H5-LH; Thu, 12 Sep 2013 16:51:42 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VKA7E-0007hN-Og; Thu, 12 Sep 2013 16:51:36 +0000 Received: from mail-pb0-x232.google.com ([2607:f8b0:400e:c01::232]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VKA7A-0007fX-Iw for linux-arm-kernel@lists.infradead.org; Thu, 12 Sep 2013 16:51:33 +0000 Received: by mail-pb0-f50.google.com with SMTP id uo5so53020pbc.37 for ; Thu, 12 Sep 2013 09:51:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=mkvA8cQTFGus//1Fo/taVQov+8LyMfNIVa8WYBYa4x8=; b=ScmTqYSLKOfl81MdaZBN6v9jy+YAqzPaWwewd2L1okRE0iJMmuoGQtepmevw0nFX3q TUIGfaRiIQePPOC5bbxBjcsFFlJh0E0b1Jsns5/l4P3DljC79/+pEPHtPNTNU/WCKMFS Lxq5OUz9Jzb2Z5WhcbBPl8xUg5ac9v598Xe+euzeMA8Km3y9qYmpTObROUgUCea/imk1 p3yDpN1dZfnkwgC58J2Fha0J42/vtgpUlciMQyvEn5AxGYXoiqVs0lTs0vthQEz+lIgA 82BOcgSovPcXxl9A2YtnADXVaKQ88Ez9aaj7KGbxDAnfTVdAvmnk1G0DdO388ye/V6m/ 85KQ== X-Received: by 10.66.227.39 with SMTP id rx7mr10736909pac.44.1379004670958; Thu, 12 Sep 2013 09:51:10 -0700 (PDT) Received: from localhost ([149.199.62.254]) by mx.google.com with ESMTPSA id m4sm3444269pbg.38.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 12 Sep 2013 09:51:10 -0700 (PDT) From: Soren Brinkmann To: Rob Herring , Pawel Moll , Mark Rutland , Stephen Warren , Ian Campbell , Russell King , Michal Simek , Thomas Gleixner , Daniel Lezcano , Stephen Boyd Subject: [PATCH 1/2] tick: broadcast: Deny per-cpu clockevents from being broadcast sources Date: Thu, 12 Sep 2013 09:50:39 -0700 Message-Id: <1379004640-15117-2-git-send-email-soren.brinkmann@xilinx.com> X-Mailer: git-send-email 1.8.4 In-Reply-To: <1379004640-15117-1-git-send-email-soren.brinkmann@xilinx.com> References: <1379004640-15117-1-git-send-email-soren.brinkmann@xilinx.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130912_125132_749436_93289D30 X-CRM114-Status: GOOD ( 12.96 ) X-Spam-Score: -1.9 (-) Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, KHOP_BIG_TO_CC,RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Stephen Boyd On most ARM systems the per-cpu clockevents are truly per-cpu in the sense that they can't be controlled on any other CPU besides the CPU that they interrupt. If one of these clockevents were to become a broadcast source we will run into a lot of trouble because the broadcast source is enabled on the first CPU to go into deep idle (if that CPU suffers from FEAT_C3_STOP) and that could be a different CPU than what the clockevent is interrupting (or even worse the CPU that the clockevent interrupts could be offline). Theoretically it's possible to support per-cpu clockevents as the broadcast source but so far we haven't needed this and supporting it is rather complicated. Let's just deny the possibility for now until this becomes a reality (let's hope it never does!). Reported-by: Sören Brinkmann Signed-off-by: Stephen Boyd --- kernel/time/tick-broadcast.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/time/tick-broadcast.c b/kernel/time/tick-broadcast.c index 218bcb5..d3539e5 100644 --- a/kernel/time/tick-broadcast.c +++ b/kernel/time/tick-broadcast.c @@ -77,6 +77,9 @@ static bool tick_check_broadcast_device(struct clock_event_device *curdev, !(newdev->features & CLOCK_EVT_FEAT_ONESHOT)) return false; + if (cpumask_equal(newdev->cpumask, cpumask_of(smp_processor_id()))) + return false; + return !curdev || newdev->rating > curdev->rating; }