From patchwork Thu May 15 20:38:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 4185811 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 DCBAD9F1C0 for ; Thu, 15 May 2014 20:41:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0AC6920396 for ; Thu, 15 May 2014 20:41:31 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 407E220397 for ; Thu, 15 May 2014 20:41:30 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Wl2Qv-0002Eq-9b; Thu, 15 May 2014 20:39:17 +0000 Received: from mail-pb0-x229.google.com ([2607:f8b0:400e:c01::229]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Wl2Qj-00023q-7U for linux-arm-kernel@lists.infradead.org; Thu, 15 May 2014 20:39:05 +0000 Received: by mail-pb0-f41.google.com with SMTP id uo5so1554732pbc.14 for ; Thu, 15 May 2014 13:38:44 -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; bh=4VXGeN9aaky1Jh+hHx7D4oEgTNDowWyjileecPhPOOw=; b=CG2opQgGsNW1BaO4ZNA+EPMkKeLZMzL3hH4FT3OGJSgX9LY+eQxe6AOh75YQgXupKp O/eHDibj64XOHhCEiKf/OKwQujSVAMOnwX7ndTN2Sx9CXNKlmk6a2X1/745ifFOXXQIN B8tmMNZk2bhLF6DVa4FkvQnxO75a/L7cKm/1HKdrIQQnOwVjLhgoAG4xTJJDRkpfgj8S jcIvDd4dzuOpB4VjkcydlZlw7+tKtyvllzY9Uf+AOpijJsRGIVMpot5WHB6yYOmh1Lcx egvWW4EeG77LVT/KLvtPLAixrMF6BIP3psW/ePN5pAX9EhoHjrOPkoN3jGt0iK1FQyLq lItA== X-Received: by 10.68.178.194 with SMTP id da2mr15072696pbc.151.1400186324389; Thu, 15 May 2014 13:38:44 -0700 (PDT) Received: from localhost (108-223-40-66.lightspeed.sntcca.sbcglobal.net. [108.223.40.66]) by mx.google.com with ESMTPSA id om6sm10660202pbc.43.2014.05.15.13.38.42 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 15 May 2014 13:38:43 -0700 (PDT) From: Guenter Roeck To: linux-watchdog@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 2/6] watchdog: Document reboot API Date: Thu, 15 May 2014 13:38:20 -0700 Message-Id: <1400186304-1691-3-git-send-email-linux@roeck-us.net> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1400186304-1691-1-git-send-email-linux@roeck-us.net> References: <1400186304-1691-1-git-send-email-linux@roeck-us.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140515_133905_314816_6C8978BC X-CRM114-Status: GOOD ( 15.88 ) X-Spam-Score: 0.2 (/) Cc: Russell King , Heiko Stuebner , Arnd Bergmann , linux-doc@vger.kernel.org, Catalin Marinas , Randy Dunlap , Will Deacon , linux-kernel@vger.kernel.org, Jonas Jensen , Wim Van Sebroeck , Maxime Ripard , Guenter Roeck 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: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, 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 Document the new reboot API functionality. Signed-off-by: Guenter Roeck --- v3: Added documentation patch Documentation/watchdog/watchdog-kernel-api.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Documentation/watchdog/watchdog-kernel-api.txt b/Documentation/watchdog/watchdog-kernel-api.txt index a0438f3..39f8e00 100644 --- a/Documentation/watchdog/watchdog-kernel-api.txt +++ b/Documentation/watchdog/watchdog-kernel-api.txt @@ -90,6 +90,7 @@ struct watchdog_ops { int (*stop)(struct watchdog_device *); /* optional operations */ int (*ping)(struct watchdog_device *); + void (*reboot)(struct watchdog_device *); unsigned int (*status)(struct watchdog_device *); int (*set_timeout)(struct watchdog_device *, unsigned int); unsigned int (*get_timeleft)(struct watchdog_device *); @@ -148,6 +149,8 @@ they are supported. These optional routines/operations are: info structure). * status: this routine checks the status of the watchdog timer device. The status of the device is reported with watchdog WDIOF_* status flags/bits. +* reboot: if this routine is present, it may be called to reboot the system. + Parameter is the pointer to the watchdog device. * set_timeout: this routine checks and changes the timeout of the watchdog timer device. It returns 0 on success, -EINVAL for "parameter out of range" and -EIO for "could not write value to the watchdog". On success this @@ -224,3 +227,11 @@ the device tree (if the module timeout parameter is invalid). Best practice is to set the default timeout value as timeout value in the watchdog_device and then use this function to set the user "preferred" timeout value. This routine returns zero on success and a negative errno code for failure. + +The watchdog_do_reboot function can be used to reboot the system. This is +intended to be used in systems which do not have an explicit reboot capability, +but implement reboot by programming the watchdog to expire immediately. If +the function is called, and a watchdog driver with reboot functionality was +previously registered, the reboot function of that driver will be called. +Architecture code should call watchdog_do_reboot from its machine_reboot +function after other means to reboot the system failed.