From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dave Young Subject: Re: [PATCH v7 5/8] Watchdog: introduce ARM SBSA watchdog driver Date: Wed, 16 Sep 2015 09:57:41 +0800 Message-ID: <20150916015741.GA6699@dhcp-128-62.nay.redhat.com> References: <=fu.wei@linaro.org> <1440435683-7343-1-git-send-email-fu.wei@linaro.org> <1440435683-7343-6-git-send-email-fu.wei@linaro.org> <20150915083823.GB5767@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-doc-owner@vger.kernel.org To: Fu Wei Cc: Suravee Suthikulpanit , Hanjun Guo , Linaro ACPI Mailman List , linux-watchdog@vger.kernel.org, devicetree@vger.kernel.org, LKML , linux-doc@vger.kernel.org, Wei Fu , G Gregory , Al Stone , Arnd Bergmann , Guenter Roeck , Vipul Gandhi , Wim Van Sebroeck , Jon Masters , Leo Duran , Jon Corbet , Mark Rutland , Catalin Marinas , Will Deacon , Rafael Wysocki , Pratyush Anand List-Id: devicetree@vger.kernel.org > >> diff --git a/drivers/watchdog/sbsa_gwdt.c b/drivers/watchdog/sbsa_gwdt.c > >> new file mode 100644 > >> index 0000000..7ae45cc > >> --- /dev/null > >> +++ b/drivers/watchdog/sbsa_gwdt.c > >> @@ -0,0 +1,459 @@ > >> +/* > >> + * SBSA(Server Base System Architecture) Generic Watchdog driver > >> + * > >> + * Copyright (c) 2015, Linaro Ltd. > >> + * Author: Fu Wei > >> + * Suravee Suthikulpanit > >> + * > >> + * This program is free software; you can redistribute it and/or modify > >> + * it under the terms of the GNU General Public License 2 as published > >> + * by the Free Software Foundation. > >> + * > >> + * This program is distributed in the hope that it will be useful, > >> + * but WITHOUT ANY WARRANTY; without even the implied warranty of > >> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > >> + * GNU General Public License for more details. > >> + * > >> + * The SBSA Generic watchdog driver is compatible with the pretimeout > >> + * concept of Linux kernel. > >> + * The timeout and pretimeout are determined by WCV or WOR. > >> + * The first watch period is set by writing WCV directly, that can > >> + * support more than 10s timeout at the maximum system counter > >> + * frequency (400MHz). > >> + * When WS0 is triggered, the second watch period (pretimeout) is > >> + * determined by one of these registers: > >> + * (1)WOR: 32bit register, this gives a maximum watch period of > >> + * around 10s at the maximum system counter frequency. It's loaded > >> + * automatically by hardware. > >> + * (2)WCV: If the pretimeout value is greater then "max_wor_timeout", > >> + * it will be loaded in WS0 interrupt routine. If system is in > >> + * ws0_mode (reboot by kexec/kdump in panic with watchdog enabled > >> + * and WS0 == true), the ping operation will only reload WCV. > > > > Below is the field comment about ws0_mode, it says ws0_mode is only > > for rebooting in second stage timeout, but kexec/kdump can reboot in > > either first or second stage > > Great thanks for your feedback. > > yes, if kexec/kdump reboot the system before the WS0, ws0_mode may not be set. > in this case, if WS0 is triggered during the reboot(AFAIK, panic will > disable irq, and in the early boot stage of system, irq is disabled, > too.), ws0_mode will be set at the next "open" in kdump kernel > if WS0 haven't triggered until the watchdog is opened again in kdump > kernel , ws0_mode won't be set. > > ws0_mode doesn't indicate if the system is in the kdump kernel, it > indicates that if WS0 is triggered, when the watchdog is initialized. > > Do I answer your question? Yes, thanks for explanation. So it sounds better to change the comment like below? from (reboot by kexec/kdump in panic with watchdog enabled and WS0 == true) to (reboot in the pre-timeout stage and WS0 == true) Thanks Dave