From patchwork Wed Apr 10 12:49:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan Tan X-Patchwork-Id: 10893847 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 871B11515 for ; Wed, 10 Apr 2019 12:49:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6F70728600 for ; Wed, 10 Apr 2019 12:49:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5EBCB2865F; Wed, 10 Apr 2019 12:49:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4F57028600 for ; Wed, 10 Apr 2019 12:49:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732084AbfDJMti (ORCPT ); Wed, 10 Apr 2019 08:49:38 -0400 Received: from mail-eopbgr680040.outbound.protection.outlook.com ([40.107.68.40]:55681 "EHLO NAM04-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730758AbfDJMth (ORCPT ); Wed, 10 Apr 2019 08:49:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vmware.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yc8upti9x5DMkmU0IPIRwe3PfphRMo9M60ROkOBSjJ4=; b=oyF1LPwvPT7JncES76alXXvDUkrBnUYmI3M7GOWnS9uCF7iLqIiR1+xJdeY1DxKvNjn020e6tvZslELGhPHWD1yx0ajHYxbAhN2+Z6dOVh18NT7Xbus9wRIDzeuGds13WcSHGpgUeGnLg/zCTCTpzLiDX5fye/vPlLtOSR97tt4= Received: from DM5PR05MB3292.namprd05.prod.outlook.com (10.174.191.31) by DM5PR05MB2828.namprd05.prod.outlook.com (10.168.177.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1792.15; Wed, 10 Apr 2019 12:49:34 +0000 Received: from DM5PR05MB3292.namprd05.prod.outlook.com ([fe80::1872:e9e:7779:4b4c]) by DM5PR05MB3292.namprd05.prod.outlook.com ([fe80::1872:e9e:7779:4b4c%2]) with mapi id 15.20.1792.009; Wed, 10 Apr 2019 12:49:34 +0000 From: Bryan Tan CC: Wim Van Sebroeck , Guenter Roeck , "linux-watchdog@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Bryan Tan Subject: [PATCH] watchdog: wdat_wdt: fix get_timeleft call for wdat_wdt Thread-Topic: [PATCH] watchdog: wdat_wdt: fix get_timeleft call for wdat_wdt Thread-Index: AQHU75vYKEDScG67k0a+4y5dahf8cA== Date: Wed, 10 Apr 2019 12:49:33 +0000 Message-ID: <20190410124813.86892-1-bryantan@vmware.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: LO2P265CA0050.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:60::14) To DM5PR05MB3292.namprd05.prod.outlook.com (2603:10b6:4:3e::31) authentication-results: spf=none (sender IP is ) smtp.mailfrom=bryantan@vmware.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.20.1 (Apple Git-117) x-originating-ip: [212.36.145.45] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: bd353b36-c1c3-423a-f7a7-08d6bdb2f79e x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600139)(711020)(4605104)(2017052603328)(7193020);SRVR:DM5PR05MB2828; x-ms-traffictypediagnostic: DM5PR05MB2828: x-microsoft-antispam-prvs: x-forefront-prvs: 00032065B2 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(136003)(346002)(39860400002)(396003)(366004)(376002)(199004)(189003)(50226002)(55236004)(6436002)(102836004)(36756003)(59246006)(6506007)(386003)(186003)(6116002)(3846002)(105586002)(26005)(54906003)(2906002)(99286004)(6486002)(52116002)(486006)(106356001)(476003)(2616005)(316002)(71190400001)(71200400001)(109986005)(86362001)(7736002)(6512007)(1671002)(107886003)(25786009)(305945005)(4326008)(14454004)(53936002)(68736007)(8936002)(1076003)(14444005)(66066001)(8676002)(256004)(4744005)(81156014)(81166006)(478600001)(97736004)(5660300002);DIR:OUT;SFP:1101;SCL:1;SRVR:DM5PR05MB2828;H:DM5PR05MB3292.namprd05.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: vmware.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: RPbOQIFJEyrpH+j017Q8tI2VA33mXkglHud72Uf3pYyy3+XN3Oy08IzmFwT76a1s9VQ8fAMV6TMQSkp5dGJj0g2V7Z9HZdSP8FHWa3XH7J1SDs+SihtEGw858d7POZhjsPdvxsZ2E56SXKhx9MTdxjkkGSQhcZr+05hMrqNqTP6nsJ0FKVu6tH8O5fobU/h/XtP2gjM7HB5/xDHnZSm2WaW0c9xcD4P1CvwPwKSz6rRXtdF+WFVE5Q5KdBxafmG1DgWqN+zpfAGQP+R7pkUqwpoaBNoAUdi3yNg8/Zrjjpr9CYRibQ5tZshkybKmA9W937CaIb3Vjmaj37Dwd1VSHj2OnwoB0Aq88TIs5QxYFWLjQU1aBy36j6K7s9wh9PaMuEDLYaoUkvdJJP4m+he70ODa3ZhPDnDmyox97RBxiDA= MIME-Version: 1.0 X-OriginatorOrg: vmware.com X-MS-Exchange-CrossTenant-Network-Message-Id: bd353b36-c1c3-423a-f7a7-08d6bdb2f79e X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Apr 2019 12:49:33.9476 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b39138ca-3cee-4b4a-a4d6-cd83d9dd62f0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR05MB2828 To: unlisted-recipients:; (no To-header on input) Sender: linux-watchdog-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The get_timeleft call for wdat_wdt was using ACPI_WDAT_GET_COUNTDOWN when running an action on the device, which would return the configured countdown, instead of ACPI_WDAT_GET_CURRENT_COUNTDOWN, which returns the time left before the watchdog will fire. This change corrects that. Signed-off-by: Bryan Tan Reviewed-by: Guenter Roeck --- drivers/watchdog/wdat_wdt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/watchdog/wdat_wdt.c b/drivers/watchdog/wdat_wdt.c index 56ad196..387892f 100644 --- a/drivers/watchdog/wdat_wdt.c +++ b/drivers/watchdog/wdat_wdt.c @@ -287,7 +287,7 @@ static unsigned int wdat_wdt_get_timeleft(struct watchdog_device *wdd) struct wdat_wdt *wdat = to_wdat_wdt(wdd); u32 periods = 0; - wdat_wdt_run_action(wdat, ACPI_WDAT_GET_COUNTDOWN, 0, &periods); + wdat_wdt_run_action(wdat, ACPI_WDAT_GET_CURRENT_COUNTDOWN, 0, &periods); return periods * wdat->period / 1000; }