From patchwork Sat Sep 29 01:26:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Blanchard X-Patchwork-Id: 976524 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42MWFG1QVvz9s55 for ; Sat, 29 Sep 2018 11:30:10 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ozlabs.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="r00Cb0z+"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 42MWFF6xM8zF3Qw for ; Sat, 29 Sep 2018 11:30:09 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=ozlabs.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="r00Cb0z+"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from ozlabs.org (bilbo.ozlabs.org [IPv6:2401:3900:2:1::2]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 42MW8q2vG4zF3Kq for ; Sat, 29 Sep 2018 11:26:19 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=ozlabs.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="r00Cb0z+"; dkim-atps=neutral Received: by ozlabs.org (Postfix, from userid 1010) id 42MW8p6z8Xz9sBq; Sat, 29 Sep 2018 11:26:18 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ozlabs.org; s=201707; t=1538184378; bh=DG4pWJAYPTjPYnbwLyMKrfAgCjARbjRantbxhe0tWNs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=r00Cb0z+rMhSsYOt29jV5FyWQJTh03dii08/pZL7gqUBjGqOCa5SWexwAo2mVBBgy wT9mTEl+HT8EQYezqO7vuvl08G9kSEc72X2sKagAC/vrUYMaYXvidjR/rRnGcYI3Ia 82ZTSCDO9cPSVZTG2qfMlRwAI5oHNHePEYfQn8IGQCZsAd36NBqLjW0/YEUcFsbYfG U3xCkbBSBG8nlpGZ4eV1ZberChKLz1t14Fj6M8ma23WOkT2RNQHAXl67mPPpzwR8s7 JC1QmWN9OmafZcgGuPfxU5/iVudlKraETN+779JZlNcnfGaxQTRl/2E4Rj4zGteEsG I1g58qzd/pLyA== From: Anton Blanchard To: benh@kernel.crashing.org, paulus@samba.org, mpe@ellerman.id.au, npiggin@gmail.com, mikey@neuling.org, oohall@gmail.com Subject: [PATCH 2/2] powerpc/time: Only cap decrementer when watchdog is enabled Date: Sat, 29 Sep 2018 11:26:07 +1000 Message-Id: <20180929012607.10204-2-anton@ozlabs.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180929012607.10204-1-anton@ozlabs.org> References: <20180929012607.10204-1-anton@ozlabs.org> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" If CONFIG_PPC_WATCHDOG is enabled, we always cap the decrementer to 0x7fffffff. As suggested by Nick, add a run time check of the watchdog cpumask, so if it is disabled we use the large decrementer. Signed-off-by: Anton Blanchard --- arch/powerpc/kernel/time.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c index 6a1f0a084ca3..3372019f52bd 100644 --- a/arch/powerpc/kernel/time.c +++ b/arch/powerpc/kernel/time.c @@ -60,6 +60,7 @@ #include #include #include +#include #include #include @@ -575,7 +576,8 @@ void timer_interrupt(struct pt_regs *regs) * 31 bits, which is about 4 seconds on most systems, which gives * the watchdog a chance of catching timer interrupt hard lockups. */ - if (IS_ENABLED(CONFIG_PPC_WATCHDOG)) + if (IS_ENABLED(CONFIG_PPC_WATCHDOG) && + cpumask_test_cpu(smp_processor_id(), &watchdog_cpumask)) set_dec(0x7fffffff); else set_dec(decrementer_max);