From patchwork Mon Oct 1 23:01:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Blanchard X-Patchwork-Id: 977532 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42PHxR4vthz9s7T for ; Tue, 2 Oct 2018 09:07:39 +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="vpSJMJrv"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 42PHxR3L9SzF3Cl for ; Tue, 2 Oct 2018 09:07:39 +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="vpSJMJrv"; 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 [203.11.71.1]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 42PHny28whzF3Cw for ; Tue, 2 Oct 2018 09:01:10 +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="vpSJMJrv"; dkim-atps=neutral Received: by ozlabs.org (Postfix, from userid 1010) id 42PHny0s9fz9sBq; Tue, 2 Oct 2018 09:01:09 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ozlabs.org; s=201707; t=1538434870; bh=K5AgXpLFDn9agxRmO/xfpRR427CZS+riAhLFAhKE77s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vpSJMJrv0vm5sSpSDv/JjhiKxrxhhCYGof3kVVY9Cx/qZRG8qBeyc5jYJ5xmC+Nra n/09gxBmPW9ac+XeYbhn6kvqkcv+zjcVd0orrsIeKgHCrhbUOJuV1d2W1TVxa+rlVv ei5JAWVAjH1o5vPGVZle8FbTmXyB2BR49WrbpqqxFVB/+3VZld7jRju3QQmfYzqOTn /QfckkOjuF+mPSC8r4G8mDEsyMbPj6tTQ90703txivSKmRcLEGAEwiqDSLj9hhT/5D uzDvH0WTcRIzenm2Rysx4eBgl7BztZlnGuHx1ufre7Cja6PM38wJyejdzqWeEEq/zq keoiJeNjZX9wg== 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: Add set_state_oneshot_stopped decrementer callback Date: Tue, 2 Oct 2018 09:01:05 +1000 Message-Id: <20181001230105.26040-2-anton@ozlabs.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181001230105.26040-1-anton@ozlabs.org> References: <20181001230105.26040-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: if (IS_ENABLED(CONFIG_PPC_WATCHDOG)) set_dec(0x7fffffff); else set_dec(decrementer_max); If there are no future events, we don't reprogram the decrementer after this and we end up with 0x7fffffff even on a large decrementer capable system. As suggested by Nick, add a set_state_oneshot_stopped callback so we program the decrementer with decrementer_max if there are no future events. Signed-off-by: Anton Blanchard --- arch/powerpc/kernel/time.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c index 6a1f0a084ca3..40868f3ee113 100644 --- a/arch/powerpc/kernel/time.c +++ b/arch/powerpc/kernel/time.c @@ -111,6 +111,7 @@ struct clock_event_device decrementer_clockevent = { .rating = 200, .irq = 0, .set_next_event = decrementer_set_next_event, + .set_state_oneshot_stopped = decrementer_shutdown, .set_state_shutdown = decrementer_shutdown, .tick_resume = decrementer_shutdown, .features = CLOCK_EVT_FEAT_ONESHOT |