From patchwork Wed Mar 27 06:42:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ji-Ze Hong (Peter Hong)" X-Patchwork-Id: 10872815 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 F28011390 for ; Wed, 27 Mar 2019 06:43:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DA4DB28C2D for ; Wed, 27 Mar 2019 06:43:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CE1D928C77; Wed, 27 Mar 2019 06:43:12 +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,FREEMAIL_FROM,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 B4D3228C2D for ; Wed, 27 Mar 2019 06:43:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732615AbfC0GnB (ORCPT ); Wed, 27 Mar 2019 02:43:01 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:36594 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726214AbfC0GnA (ORCPT ); Wed, 27 Mar 2019 02:43:00 -0400 Received: by mail-pf1-f196.google.com with SMTP id p10so9268285pff.3; Tue, 26 Mar 2019 23:43:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=Jy7F2QSsf5OTfixtg/4VNXIPeW3wBP1cuuaUxSIcMMA=; b=pvitqHl4Wz4/M52ef9EPVvoUKyFldCtAyYXHPqLkOPa7Cm9AKJcaCZTpzNFi/0WgEC 4UEzFFsQO1no14cCUsLzjWjG9dAREb+PZVOw8TycPf/llHtecYio9Ef6xqPwLtQWVlgl KikSBKb8aGIXYgNABQuG8h98qBAHA/6+7Fg1yq9uhqbqSAVgJ1dPpMX7uLzIMNJS0iVg 103fCgY9SuEBFnT/go6msGkhB6OLEVm+UytBoOhIWIHjr3N+dUnYBOhWk23ObMOy8XWX YVj1mGZyrjE5v6a3UL9NO5iPszGF4bqcPYWy+6Sm5YQJIy9CWnmN4sIEpj96BjjpMUoW PurQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Jy7F2QSsf5OTfixtg/4VNXIPeW3wBP1cuuaUxSIcMMA=; b=i1KXnvQsXG9jbHNTNCk5tuY/b9K33ouRbjHz9CZcfK5M/dwb6nfwWvaY43/L4DTbmr eJ9Z2okUDNUECdsRfiFNRJYl3PXHtmiUyaB0W9FxHXZsp0TAd5DbcqChd0qxnMGiX0Pe MpsuLwr86XIsmaT3D3vBoCv555GwJ+7JuA1Mt/FI3T3EkonZFarYsPVmOV3sQ/f7SxPH dJap/PXEesw/hQbcykV32ayWBfiJaIDICZTOcw0siCE9I7m9vxEKvppOFvwfjLOWXEd2 8EPwdUuqpk57SGEcjvx+H2Nhpo9JFzhaU0/T9vFRzAHsG/ld+UgfwsUtqlmDL7ZctBa6 1hqw== X-Gm-Message-State: APjAAAXIXJqKnaZcb5HD/UbLmQaZx3WejMunzR/0Kv/STLw0Cu8TisyC pizYAAYXjkpnvVrpfbDpWdxQyh1q X-Google-Smtp-Source: APXvYqzTL+Awbn/SXMSTQWAYApC+eFZm/MR4hORxtVsMRyCVa8BUjEF4CbGR8HWfpbuhuMvivjzzhQ== X-Received: by 2002:a63:6bc6:: with SMTP id g189mr33157008pgc.427.1553668980149; Tue, 26 Mar 2019 23:43:00 -0700 (PDT) Received: from localhost (59-120-186-245.HINET-IP.hinet.net. [59.120.186.245]) by smtp.gmail.com with ESMTPSA id q62sm25737760pga.32.2019.03.26.23.42.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Mar 2019 23:42:59 -0700 (PDT) From: "Ji-Ze Hong (Peter Hong)" X-Google-Original-From: "Ji-Ze Hong (Peter Hong)" To: peter_hong@fintek.com.tw, wim@linux-watchdog.org, linux@roeck-us.net Cc: linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org, "Ji-Ze Hong (Peter Hong)" Subject: [PATCH V2 1/2] watchdog: f71808e_wdt: separate declaration and assignment Date: Wed, 27 Mar 2019 14:42:50 +0800 Message-Id: <1553668971-18801-1-git-send-email-hpeter+linux_kernel@gmail.com> X-Mailer: git-send-email 2.7.4 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 Separate declaration and assignment in watchdog_start() Signed-off-by: Ji-Ze Hong (Peter Hong) Reviewed-by: Guenter Roeck --- drivers/watchdog/f71808e_wdt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/watchdog/f71808e_wdt.c b/drivers/watchdog/f71808e_wdt.c index 9a1c761258ce..bd2ced9f39f4 100644 --- a/drivers/watchdog/f71808e_wdt.c +++ b/drivers/watchdog/f71808e_wdt.c @@ -338,8 +338,10 @@ static int f71862fg_pin_configure(unsigned short ioaddr) static int watchdog_start(void) { + int err; + /* Make sure we don't die as soon as the watchdog is enabled below */ - int err = watchdog_keepalive(); + err = watchdog_keepalive(); if (err) return err; From patchwork Wed Mar 27 06:42:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ji-Ze Hong (Peter Hong)" X-Patchwork-Id: 10872813 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 CA8E81390 for ; Wed, 27 Mar 2019 06:43:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B579D28C2D for ; Wed, 27 Mar 2019 06:43:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A938E28C77; Wed, 27 Mar 2019 06:43:10 +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,FREEMAIL_FROM,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 5A1BE28C2D for ; Wed, 27 Mar 2019 06:43:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726214AbfC0GnE (ORCPT ); Wed, 27 Mar 2019 02:43:04 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:44033 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387512AbfC0GnC (ORCPT ); Wed, 27 Mar 2019 02:43:02 -0400 Received: by mail-pl1-f194.google.com with SMTP id g12so2855120pll.11; Tue, 26 Mar 2019 23:43:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=frjGhiJJMFqcB474kkUxeMS2hJxQyCfF39S1eqNxpTQ=; b=mzDZu/ub2HSd6X7sfIOFmlSHGCqLc4jd/rR57ZokZ+uA2VSlhFZychlwimZ1kf1Xb+ j9dMQ9BdupPpmP82htNH+4oA4a7yzBBGf3rSGQCSEGwnTTUnHTsLdrZ4SsEvRazIT7ol 1nb3oQYXbcUI2+TGX4/n1YR6Uq+7JlYygloSknjDY5Z0JxDJJmnfvae0qCUpHdHimejf vqNCsxA/A3+8Qs7rB+e6BuJXmsmTYS7PAdOIlF4PTYRZDBAnDzOB1tz13Jxiaxj3enHI UQ/GhRsegLIN6frCiH+nGj7M7hMewuKTrJ15OE0MWuNlSFlV1pzDsHZwsTTvER2LC60o qVAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=frjGhiJJMFqcB474kkUxeMS2hJxQyCfF39S1eqNxpTQ=; b=GgtY/BDX/ucC2fiGKRvy2clb7fEmSgbeaD0M3NniRcSsLEzJ9siFD5dMEoRymMqOVN 7rtPmh04zCfvVpQDxRGMZZBiIYeNooUpS0sYf52lZcsE9daUhT8gATMsBb7fQ627iK/P iMYBvLHX8d0TwczJff5ty7OVqs2cIHA08q9UcuEXahhPogA3qnF4ZgURtiNO7ypivykL ujt0ByOKr0cD2+mLZI9godEbrapaW55Rend1IXwaKrMlKGMDgsbA/FxxbRkdGlH8nU6L FVt2PuicvLm58CJTofzG+cnIjqZCfMGKmZK7hKkSeXv6lZ1Oe13IwORPtCho4KeSi5Uc PIDA== X-Gm-Message-State: APjAAAXMxhWQ+JekHErzbIBFKbYeQ9hGmQ8d11yljoGh5iSFDDUeiowH TGRQ/DgJvCoLLl5yj++HfstINtNf X-Google-Smtp-Source: APXvYqwVfAXa/CemrIQaOjV13PEghdOiD0MGo9ce0iyBVWNiODPUrvFvpgf/NdeYliFHqRXpOh4FpA== X-Received: by 2002:a17:902:e60e:: with SMTP id cm14mr35333879plb.192.1553668981919; Tue, 26 Mar 2019 23:43:01 -0700 (PDT) Received: from localhost (59-120-186-245.HINET-IP.hinet.net. [59.120.186.245]) by smtp.gmail.com with ESMTPSA id u13sm42836769pfa.169.2019.03.26.23.43.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Mar 2019 23:43:01 -0700 (PDT) From: "Ji-Ze Hong (Peter Hong)" X-Google-Original-From: "Ji-Ze Hong (Peter Hong)" To: peter_hong@fintek.com.tw, wim@linux-watchdog.org, linux@roeck-us.net Cc: linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org, "Ji-Ze Hong (Peter Hong)" Subject: [PATCH V2 2/2] watchdog: f71808e_wdt: fix F81866 bit operation Date: Wed, 27 Mar 2019 14:42:51 +0800 Message-Id: <1553668971-18801-2-git-send-email-hpeter+linux_kernel@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1553668971-18801-1-git-send-email-hpeter+linux_kernel@gmail.com> References: <1553668971-18801-1-git-send-email-hpeter+linux_kernel@gmail.com> 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 Fix error bit operation in watchdog_start() Fixes: 14b24a88a3660 ("watchdog: f71808e_wdt: Add F81866 support") Signed-off-by: Ji-Ze Hong (Peter Hong) Reviewed-by: Guenter Roeck --- drivers/watchdog/f71808e_wdt.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/watchdog/f71808e_wdt.c b/drivers/watchdog/f71808e_wdt.c index bd2ced9f39f4..afd1446241b3 100644 --- a/drivers/watchdog/f71808e_wdt.c +++ b/drivers/watchdog/f71808e_wdt.c @@ -339,6 +339,7 @@ static int f71862fg_pin_configure(unsigned short ioaddr) static int watchdog_start(void) { int err; + u8 tmp; /* Make sure we don't die as soon as the watchdog is enabled below */ err = watchdog_keepalive(); @@ -388,19 +389,18 @@ static int watchdog_start(void) break; case f81866: - /* Set pin 70 to WDTRST# */ - superio_clear_bit(watchdog.sioaddr, SIO_F81866_REG_PORT_SEL, - BIT(3) | BIT(0)); - superio_set_bit(watchdog.sioaddr, SIO_F81866_REG_PORT_SEL, - BIT(2)); /* * GPIO1 Control Register when 27h BIT3:2 = 01 & BIT0 = 0. * The PIN 70(GPIO15/WDTRST) is controlled by 2Ch: * BIT5: 0 -> WDTRST# * 1 -> GPIO15 */ - superio_clear_bit(watchdog.sioaddr, SIO_F81866_REG_GPIO1, - BIT(5)); + tmp = superio_inb(watchdog.sioaddr, SIO_F81866_REG_PORT_SEL); + tmp &= ~(BIT(3) | BIT(0)); + tmp |= BIT(2); + superio_outb(watchdog.sioaddr, SIO_F81866_REG_PORT_SEL, tmp); + + superio_clear_bit(watchdog.sioaddr, SIO_F81866_REG_GPIO1, 5); break; default: