Received: by 10.213.65.68 with SMTP id h4csp1065054imn; Tue, 27 Mar 2018 14:06:44 -0700 (PDT) X-Google-Smtp-Source: AIpwx49Ca3Rsf5cknOyPARl0Qi/utokEVB1dBhEL3ilJ+1wwr1LUpK2pxm90DwAVXKtR2MUnnBQ9 X-Received: by 2002:a17:902:e5:: with SMTP id a92-v6mr873663pla.26.1522184804029; Tue, 27 Mar 2018 14:06:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522184803; cv=none; d=google.com; s=arc-20160816; b=HokF4t1vkYuKjd042Qk2lmXRn1JFkrAR6b9FRN6hDzJUiPZMpH6XG9KsxQP1/LFwUQ 6CHsQuDWJGsoYppMpNdTxN5P4zh9b2qC/WFTBKIwBZ5aWGKEE8oVThkCBQ2tVAj39hdi 1Mi1mutDh2QeaUmR8e0U+BvknBYW5TGvbcTzep4nLMCJfjkL7hKl+T9rU2XBz4BSWX0c alYBHIfLemV0hv7JbK9XrcNJkiapBD1W3vVvGx4a68PBVOFvcsrFb0AsgFVV39qplsny lUKOlDzxeicjrH7KjIeq2r0oWK1LIv++pM29r6N1zL/llr6cxrGas6Tv696S2uh/sYNN upew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=wQvLHdi8imq1BFun9Q+rcanME8FCcCKs0M7c9TeIGS8=; b=QcTOKxiEB5DiXhNgUc0KYTy7aHf2pl0piZUbrwxfd8V9IuTs3HsFz7HPjGMw+uDSOH mU/hpwBiqevsqLGa6oR00Zrbs7q2SK+1CCuCL8Bfqn13ZOIKxGMQHJjfG00/aDjwPYyF D/jA9bA2FOEpXF9Xua6FzkTtjNuAkOmF+uGb94juRc/X4z/Kn6qjTGv6SqF/WNij9ALX TOAYe3FyFW298QHA3GoLwhu/I4zyXRKpO5Ty+B2gNxbnT7ymmcHvdjvxuebjisQzQN4m DDr9uJYxW1RB50YS08nabRhFJcgZOzm+gkixH0k0U/QIL4hH1YYpurpwyV6q6d99eJBF JGKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=sBlilsfW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t3si1414733pgq.237.2018.03.27.14.06.28; Tue, 27 Mar 2018 14:06:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=sBlilsfW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752021AbeC0VEK (ORCPT + 99 others); Tue, 27 Mar 2018 17:04:10 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:40411 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751249AbeC0VEJ (ORCPT ); Tue, 27 Mar 2018 17:04:09 -0400 Received: by mail-pf0-f193.google.com with SMTP id y66so80379pfi.7; Tue, 27 Mar 2018 14:04:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=wQvLHdi8imq1BFun9Q+rcanME8FCcCKs0M7c9TeIGS8=; b=sBlilsfWOpRnrO55fzP8GJm3dNRHAnw6D+A5UgXIaIUvkAT8n8gLDk1RnECepu3YkF vHpRuv2+K+W/xyEwrPjWsOeh6meRJlNHpbBo+qmuaWXbsIaoPSbr0xIQn4Il743j95w+ JGueLozwohKf7StINzj8Qd2F8RR+XjrqZRUVcM/0144WptBU/MtnUnA6nr6YdcBOrIZU HdX7eLm6h9C5nExfY0NOVDoCoiWR7jQGyAkBrthzRE7Agmg981M/nQkwsVdM6izg+7VE hYEhNvYddsNA2kQ3pfBTI4GhwW3dqb/3dxMpuj2OB/rU231O+MiEM83rH8zsmTi8Dobz ek3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=wQvLHdi8imq1BFun9Q+rcanME8FCcCKs0M7c9TeIGS8=; b=VifH6KTXHujTPLQVOb/dYUfVLszLe1IHrGsKK8ViX0egv9g+fDVyen6IsuiJRe0dqE Pn3l5ZSUWfebDAQlFLt/tpO7nQtj8PVkD6iPFZt4EzGVNqB+IkD82apjYTOkjuwBKrsI fg4GCTiiKxFfq75rijCmTcNkPtf/DzqbYnO5mWHFi9yAKy6KVmsWugeT9TvnCbLPLWGm KSv1JDGr5JU1OsxOGeSoXZeOd1IrhDJLxEo3QiJ+jCkzFn1Qeo80hsOWrCt3/Qhjs2f7 8ArzxXN/s6cQ0tD9xLc/6ZR2WgrqF4BypzIXgVEtlCU9tuR6md6+DRo2kZDpGQ8s8l4E XDLg== X-Gm-Message-State: AElRT7GoBr1UKuNjQu+TloBb2lnKDDpAtkChdMw+MrUV/JRHTs4LXbJC TzIvbyWcORHS19B6NlopPrkXWw== X-Received: by 10.98.80.5 with SMTP id e5mr661775pfb.131.1522184648687; Tue, 27 Mar 2018 14:04:08 -0700 (PDT) Received: from server.roeck-us.net (108-223-40-66.lightspeed.sntcca.sbcglobal.net. [108.223.40.66]) by smtp.gmail.com with ESMTPSA id l90sm5101965pfb.96.2018.03.27.14.04.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Mar 2018 14:04:07 -0700 (PDT) Subject: Re: [PATCH v2] aspeed: watchdog: Set bootstatus during probe To: Eddie James , linux-watchdog@vger.kernel.org Cc: openbmc@lists.ozlabs.org, linux-kernel@vger.kernel.org, wim@linux-watchdog.org, joel@jms.id.au References: <1522181367-11231-1-git-send-email-eajames@linux.vnet.ibm.com> From: Guenter Roeck Message-ID: <09152d5f-5b49-9b8b-5ac3-829a2c9aab2e@roeck-us.net> Date: Tue, 27 Mar 2018 14:04:06 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <1522181367-11231-1-git-send-email-eajames@linux.vnet.ibm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/27/2018 01:09 PM, Eddie James wrote: > Check the aspeed timeout status register to see if the system has booted > from the secondary boot source. If so, set the watchdog device > bootstatus flag for "Card previously reset the CPU." > > Signed-off-by: Eddie James Reviewed-by: Guenter Roeck > --- > Changes since v1: > - use bootstatus instead of status > - use WDIOF_CARDRESET instead of raw register contents > > drivers/watchdog/aspeed_wdt.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/drivers/watchdog/aspeed_wdt.c b/drivers/watchdog/aspeed_wdt.c > index a5b8eb2..1abe4d0 100644 > --- a/drivers/watchdog/aspeed_wdt.c > +++ b/drivers/watchdog/aspeed_wdt.c > @@ -55,6 +55,8 @@ struct aspeed_wdt_config { > #define WDT_CTRL_WDT_INTR BIT(2) > #define WDT_CTRL_RESET_SYSTEM BIT(1) > #define WDT_CTRL_ENABLE BIT(0) > +#define WDT_TIMEOUT_STATUS 0x10 > +#define WDT_TIMEOUT_STATUS_BOOT_SECONDARY BIT(1) > > /* > * WDT_RESET_WIDTH controls the characteristics of the external pulse (if > @@ -192,6 +194,7 @@ static int aspeed_wdt_probe(struct platform_device *pdev) > struct device_node *np; > const char *reset_type; > u32 duration; > + u32 status; > int ret; > > wdt = devm_kzalloc(&pdev->dev, sizeof(*wdt), GFP_KERNEL); > @@ -307,6 +310,10 @@ static int aspeed_wdt_probe(struct platform_device *pdev) > writel(duration - 1, wdt->base + WDT_RESET_WIDTH); > } > > + status = readl(wdt->base + WDT_TIMEOUT_STATUS); > + if (status & WDT_TIMEOUT_STATUS_BOOT_SECONDARY) > + wdt->wdd.bootstatus = WDIOF_CARDRESET; > + > ret = devm_watchdog_register_device(&pdev->dev, &wdt->wdd); > if (ret) { > dev_err(&pdev->dev, "failed to register\n"); >