From patchwork Fri Jun 16 06:57:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 776578 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wpryS1XQLz9s71 for ; Fri, 16 Jun 2017 17:06:40 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="uQmi16Za"; 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 3wpryS0T3yzDqJL for ; Fri, 16 Jun 2017 17:06:40 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="uQmi16Za"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mail-pg0-x243.google.com (mail-pg0-x243.google.com [IPv6:2607:f8b0:400e:c05::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3wprmB0F90zDq9P for ; Fri, 16 Jun 2017 16:57:46 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="uQmi16Za"; dkim-atps=neutral Received: by mail-pg0-x243.google.com with SMTP id f127so4279611pgc.2 for ; Thu, 15 Jun 2017 23:57:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Z4LHZk5X0hFqTXil7YT1JsWxpsBffiZwOkx9Bpy3xf4=; b=uQmi16ZavoAMx01dou+TgInzk8KSQNmxnlV1NINR7oUxy34mNL51TyS9q5BSS6nbhI bgujonYooYz74oGfLH8x20tkh6di778Uh5CXjfpTn7W6FYBdPu6g2FV16Z216HH1NOIx XLIATNU7ZTsY5jl+gLgrJxs3rkDuvMcslyHQhFbEUeaEz05OKzRAMKLa99VOC3VzUblF 28ToBCnCWei/Ds5qgaIKue3pjjbXBqX35xCNfJaukjclq62LEcmCFf/5CrwwP11KCdyR QqPnuiZnpFO1jbeYdzQL0vTJ20NVVVvJWvWW3FgbrFGapaSdGbhytVTLx9oS9RTllgIN BB0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Z4LHZk5X0hFqTXil7YT1JsWxpsBffiZwOkx9Bpy3xf4=; b=OZYPUO522wdu9y6txskwbCY6yvI17W5MvglIPmgfXFM8P0F83CFw7KvfMt4YNBJMn7 +uSUuqmd6gt16HsQyZE5ntOpIqHhrU0NbavQPCzcDK5DEmENXhFoH9S3ndKz594MH314 ITS5XrBmjNF3yTG2GX7MwCQXGHF7x6VQwazEFwRN/DMY8f5NIwT50JMSjJkdBOSbhycL TXGSHI5N/CuByatkiY6XWR/EpS63esqobCQxNdLoWfvH73oDCyxU43hAbzN5CxFQYbMv HXAWV2aju4GIrMBCX0/Qt0GhqhWLlQhNz+XbJ/3ZlXuE9DHovKho5uvVMA8r1pJd7edA d+Pg== X-Gm-Message-State: AKS2vOyFAo990j5vXe4zmU0O+l+OcycDBg9zo0IDw3AnH/XZZ9fEeeAN 6BDUseHMOSel9Q== X-Received: by 10.98.65.215 with SMTP id g84mr9484266pfd.204.1497596263930; Thu, 15 Jun 2017 23:57:43 -0700 (PDT) Received: from roar.au.ibm.com ([210.185.119.63]) by smtp.gmail.com with ESMTPSA id a12sm2383235pgn.62.2017.06.15.23.57.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Jun 2017 23:57:42 -0700 (PDT) From: Nicholas Piggin To: Don Zickus Subject: [PATCH v4 4/5] watchdog: provide watchdog_reconfigure() for arch watchdogs Date: Fri, 16 Jun 2017 16:57:14 +1000 Message-Id: <20170616065715.18390-5-npiggin@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170616065715.18390-1-npiggin@gmail.com> References: <20170616065715.18390-1-npiggin@gmail.com> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.23 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, Babu Moger , Nicholas Piggin , linux-kernel@vger.kernel.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" After reconfiguring watchdog sysctls etc., architecture specific watchdogs may not get all their parameters updated. watchdog_reconfigure() can be implemented to pull the new values in and set the arch NMI watchdog. Signed-off-by: Nicholas Piggin --- kernel/watchdog.c | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/kernel/watchdog.c b/kernel/watchdog.c index 1fba9c3d66dc..06cd965f64d2 100644 --- a/kernel/watchdog.c +++ b/kernel/watchdog.c @@ -123,6 +123,11 @@ void __weak watchdog_nmi_disable(unsigned int cpu) { } +void __weak watchdog_nmi_reconfigure(void) +{ +} + + #ifdef CONFIG_SOFTLOCKUP_DETECTOR /* Helper for online, unparked cpus. */ @@ -600,6 +605,12 @@ static void watchdog_disable_all_cpus(void) } } +static int watchdog_update_cpus(void) +{ + return smpboot_update_cpumask_percpu_thread( + &watchdog_threads, &watchdog_cpumask); +} + #else /* SOFTLOCKUP */ static int watchdog_park_threads(void) { @@ -619,6 +630,11 @@ static void watchdog_disable_all_cpus(void) { } +static int watchdog_update_cpus(void) +{ + return 0; +} + static void set_sample_period(void) { } @@ -651,6 +667,8 @@ int lockup_detector_suspend(void) watchdog_enabled = 0; } + watchdog_nmi_reconfigure(); + mutex_unlock(&watchdog_proc_mutex); return ret; @@ -671,6 +689,8 @@ void lockup_detector_resume(void) if (watchdog_running && !watchdog_suspended) watchdog_unpark_threads(); + watchdog_nmi_reconfigure(); + mutex_unlock(&watchdog_proc_mutex); put_online_cpus(); } @@ -696,6 +716,8 @@ static int proc_watchdog_update(void) else watchdog_disable_all_cpus(); + watchdog_nmi_reconfigure(); + return err; } @@ -881,12 +903,11 @@ int proc_watchdog_cpumask(struct ctl_table *table, int write, * a temporary cpumask, so we are likely not in a * position to do much else to make things better. */ -#ifdef CONFIG_SOFTLOCKUP_DETECTOR - if (smpboot_update_cpumask_percpu_thread( - &watchdog_threads, &watchdog_cpumask) != 0) + if (watchdog_update_cpus() != 0) pr_err("cpumask update failed\n"); -#endif } + + watchdog_nmi_reconfigure(); } out: mutex_unlock(&watchdog_proc_mutex);