Received: by 10.213.65.68 with SMTP id h4csp61343imn; Mon, 26 Mar 2018 15:09:40 -0700 (PDT) X-Google-Smtp-Source: AG47ELsbkzXHpzWT6NoTP7lYR+HHLt6c5Zr5J0h62WdOTCrCYM2gxmL4mPRtSccqmtzsg6QLkM2G X-Received: by 2002:a17:902:864a:: with SMTP id y10-v6mr39510319plt.45.1522102180253; Mon, 26 Mar 2018 15:09:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522102180; cv=none; d=google.com; s=arc-20160816; b=yCt63HbUenA0bFOfN5ZcArI/cDL426nhBRQUUgeyXY3IdwyejLdgtP0p0LpSRVoXxn jqMZUvi1uXzIi91h1DfWLXxjtIFv44BNbZFREagbG7gusQuWIwoiYrnNfwWoDAabgXk+ 9E3mErjXwe13XCb5sohpDGXcR1rbe1ZD4AYVcOFMZaRLOHirKYQPaB63f5f8yMxa0KBN iyqNtAPuWv26Nyg0uzZHUlypBGzUq9g0LaUvW2bOvTo+AB5e9+4d42MkYyo0V/FC2Jpb /nTs8hqoHnVF3DHqmbK9LLZbE9als52R3E0j5J3GNsA/JdPSxhhKXK12RUuj3hJX5OG9 ZZNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :from:references:cc:to:subject:arc-authentication-results; bh=oID6n3Z8LU5J09xl9uI6x6fA75okP8auAyBADoiwDRI=; b=y2TuIlv26MgVtQw8NSIJWDm4On5DxlT0LuhBNpmv4V0pj9EWFH3BPWTKfQe8KGA4ts gQORlygJ5qn6kd8GP//L0po4V+TlYWKMQR2keNXICOY3Ojw+3his+g4beaMqHWwm0UBz oYoOIY9MHAl/Wl5PtTm3G2e1tr9e4jpPcjXd8qHUSfLrQcW2tw+0yB7DrGLJGk2Nl69o Izn1EYLj1R2Uj5sskZLAT9DSbmEJkTrJmknNdwNhlpcPjnM/2g5iSrsR05IOUVpmWkM6 /nK4cHnKi8GAiiljP7S80goBCmiKH5UYu2AmUBl2rcaZ7sj3iAcECjz36CDTMcLqKpC1 iGGA== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u21si10866114pgo.100.2018.03.26.15.09.23; Mon, 26 Mar 2018 15:09:40 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752065AbeCZWIX (ORCPT + 99 others); Mon, 26 Mar 2018 18:08:23 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:48296 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751805AbeCZWIW (ORCPT ); Mon, 26 Mar 2018 18:08:22 -0400 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w2QM5Q3G082556 for ; Mon, 26 Mar 2018 18:08:22 -0400 Received: from e19.ny.us.ibm.com (e19.ny.us.ibm.com [129.33.205.209]) by mx0a-001b2d01.pphosted.com with ESMTP id 2gy5u7gckk-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Mon, 26 Mar 2018 18:08:21 -0400 Received: from localhost by e19.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 26 Mar 2018 18:08:20 -0400 Received: from b01cxnp23032.gho.pok.ibm.com (9.57.198.27) by e19.ny.us.ibm.com (146.89.104.206) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 26 Mar 2018 18:08:18 -0400 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp23032.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w2QM8HJK48103636; Mon, 26 Mar 2018 22:08:17 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AF403AC03F; Mon, 26 Mar 2018 18:09:36 -0400 (EDT) Received: from [9.85.181.180] (unknown [9.85.181.180]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP id 2A2D2AC043; Mon, 26 Mar 2018 18:09:36 -0400 (EDT) Subject: Re: [PATCH] aspeed: watchdog: Add status function To: Guenter Roeck , linux-watchdog@vger.kernel.org Cc: linux-kernel@vger.kernel.org, wim@linux-watchdog.org, joel@jms.id.au, openbmc@lists.ozlabs.org References: <1522099028-20347-1-git-send-email-eajames@linux.vnet.ibm.com> From: Eddie James Date: Mon, 26 Mar 2018 17:08:16 -0500 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: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-TM-AS-GCONF: 00 x-cbid: 18032622-0056-0000-0000-000004332D5F X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008749; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000255; SDB=6.01008851; UDB=6.00513873; IPR=6.00788133; MB=3.00020256; MTD=3.00000008; XFM=3.00000015; UTC=2018-03-26 22:08:20 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18032622-0057-0000-0000-000008753943 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-03-26_10:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1803260221 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/26/2018 05:00 PM, Guenter Roeck wrote: > On 03/26/2018 02:17 PM, Eddie James wrote: >> Populate the status watchdog operation to return the "timeout status" >> register of the ASPEED watchdog. >> >> Signed-off-by: Eddie James >> --- >>   drivers/watchdog/aspeed_wdt.c | 9 +++++++++ >>   1 file changed, 9 insertions(+) >> >> diff --git a/drivers/watchdog/aspeed_wdt.c >> b/drivers/watchdog/aspeed_wdt.c >> index a5b8eb2..d6dd5c9 100644 >> --- a/drivers/watchdog/aspeed_wdt.c >> +++ b/drivers/watchdog/aspeed_wdt.c >> @@ -55,6 +55,7 @@ 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 >>     /* >>    * WDT_RESET_WIDTH controls the characteristics of the external >> pulse (if >> @@ -138,6 +139,13 @@ static int aspeed_wdt_ping(struct >> watchdog_device *wdd) >>       return 0; >>   } >>   +static unsigned int aspeed_wdt_status(struct watchdog_device *wdd) >> +{ >> +    struct aspeed_wdt *wdt = to_aspeed_wdt(wdd); >> + >> +    return readl(wdt->base + WDT_TIMEOUT_STATUS); >> +} > > Does the register report WDIOF_* status flags/bits as defined in the > API ? > This seems more than unlikely. Ah, I see I'm misusing the API. It does not... I will rework. Thanks, Eddie > > Guenter > >> + >>   static int aspeed_wdt_set_timeout(struct watchdog_device *wdd, >>                     unsigned int timeout) >>   { >> @@ -171,6 +179,7 @@ static int aspeed_wdt_restart(struct >> watchdog_device *wdd, >>       .start        = aspeed_wdt_start, >>       .stop        = aspeed_wdt_stop, >>       .ping        = aspeed_wdt_ping, >> +    .status        = aspeed_wdt_status, >>       .set_timeout    = aspeed_wdt_set_timeout, >>       .restart    = aspeed_wdt_restart, >>       .owner        = THIS_MODULE, >> >