From patchwork Tue Oct 29 17:40:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 11218363 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 17D7213BD for ; Tue, 29 Oct 2019 17:40:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E89EF20856 for ; Tue, 29 Oct 2019 17:40:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="QbAl5aoo" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727640AbfJ2Rkm (ORCPT ); Tue, 29 Oct 2019 13:40:42 -0400 Received: from mail-qk1-f195.google.com ([209.85.222.195]:36991 "EHLO mail-qk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725905AbfJ2Rkm (ORCPT ); Tue, 29 Oct 2019 13:40:42 -0400 Received: by mail-qk1-f195.google.com with SMTP id u184so13090629qkd.4 for ; Tue, 29 Oct 2019 10:40:41 -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=CWPhtFj/OQa1LCw2CayuNIf9ZsZ9HP4t2jYM12d1Obo=; b=QbAl5aooHO9Mc4qJlaF3s3a5D7daWbnGV2q9T0uzZ63ZkE1Np0KLW4L93VXs0v+1iV 9tg7vPVcS2nrIStasfXspO/ggETMvrBTVkjpfprBxOannMjS0J0SP/kWjnxH2kJQNTZ4 7ZwJNyXURex2LbLjO7sMSn29A7rbj53xSsC2bW1Hk7cjDY6GN2vaf0V+eyEmVAbfFQws yHxK/WxVpNM0TXffRDpyWOFpeKNfSBcLWKvkwKJKjy/1MI3CeMcyIySAdLoKpG+QiVAF FtOffacXeAZl7fallx8fqEQfKr0cJbAP9ABn3Yx3ZwKTrRv956DLyhcnzZA/XVdL/6mo oERQ== 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=CWPhtFj/OQa1LCw2CayuNIf9ZsZ9HP4t2jYM12d1Obo=; b=JyDIVL1ZAb4ye1Grsk5+IY6IKCpuKpYaJrsBOGC8W5b8Ow/dOsvEayf/l/PbdV3pZy iwUZwvZtwoddhlfIHQ04lxoC/aW2SdddI6PFyjk84iJIrAdNcxsidfbaz4HYPILDVbfL iTLK1UoAbe/xpKUQfOi/84leSQmM+To+szwvQM5WPkF/SPZRgyCRRI3ylLjtXG8v1cBq 6RNS0qXlkn8Jf9klWBOFhDBblXriptDm1KyVDJUlsJ/8vsX0pmWTRTXbdjdjvpma0LNA BbBSbyi7ODgkN8U4/h9o+RMw/8uQE6HKxItr69RNCeXsWnrZcp9iuXbdsLC2Kfh4coaf wizA== X-Gm-Message-State: APjAAAXxDJyak52YA/EByGDfuLs8L5t521TI++KCGIhZfI2D+aMCLUB1 j+8O9jYuyklhgVL0xFxPqjc= X-Google-Smtp-Source: APXvYqz2R9cdoPltTPvFAWNKpZk743df189OT80KeVxDHf5VbdjH9w13PBoJFYximAHVCTGYZYYGwg== X-Received: by 2002:a37:9c0f:: with SMTP id f15mr23200599qke.62.1572370841027; Tue, 29 Oct 2019 10:40:41 -0700 (PDT) Received: from fabio-Latitude-E5450.nxp.com ([177.221.114.206]) by smtp.gmail.com with ESMTPSA id c21sm7417725qtg.61.2019.10.29.10.40.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Oct 2019 10:40:40 -0700 (PDT) From: Fabio Estevam To: linux@roeck-us.net Cc: wim@linux-watchdog.org, linux-watchdog@vger.kernel.org, Anson.Huang@nxp.com, shawnguo@kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, Fabio Estevam Subject: [PATCH 1/5] watchdog: imx7ulp: Fix reboot hang Date: Tue, 29 Oct 2019 14:40:33 -0300 Message-Id: <20191029174037.25381-1-festevam@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: linux-watchdog-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@vger.kernel.org The following hang is observed when a 'reboot' command is issued: # reboot # Stopping network: OK Stopping klogd: OK Stopping syslogd: OK umount: devtmpfs busy - remounted read-only [ 8.612079] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null) The system is going down NOW! Sent SIGTERM to all processes Sent SIGKILL to all processes Requesting system reboot [ 10.694753] reboot: Restarting system [ 11.699008] Reboot failed -- System halted Fix this problem by adding a .restart ops member. Fixes: 41b630f41bf7 ("watchdog: Add i.MX7ULP watchdog support") Signed-off-by: Fabio Estevam Reviewed-by: Guenter Roeck --- drivers/watchdog/imx7ulp_wdt.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/watchdog/imx7ulp_wdt.c b/drivers/watchdog/imx7ulp_wdt.c index 5ce51026989a..ba5d535a6db2 100644 --- a/drivers/watchdog/imx7ulp_wdt.c +++ b/drivers/watchdog/imx7ulp_wdt.c @@ -106,12 +106,28 @@ static int imx7ulp_wdt_set_timeout(struct watchdog_device *wdog, return 0; } +static int imx7ulp_wdt_restart(struct watchdog_device *wdog, + unsigned long action, void *data) +{ + struct imx7ulp_wdt_device *wdt = watchdog_get_drvdata(wdog); + + imx7ulp_wdt_enable(wdt->base, true); + imx7ulp_wdt_set_timeout(&wdt->wdd, 1); + + /* wait for wdog to fire */ + while (true) + ; + + return NOTIFY_DONE; +} + static const struct watchdog_ops imx7ulp_wdt_ops = { .owner = THIS_MODULE, .start = imx7ulp_wdt_start, .stop = imx7ulp_wdt_stop, .ping = imx7ulp_wdt_ping, .set_timeout = imx7ulp_wdt_set_timeout, + .restart = imx7ulp_wdt_restart, }; static const struct watchdog_info imx7ulp_wdt_info = { From patchwork Tue Oct 29 17:40:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 11218365 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 093A713BD for ; Tue, 29 Oct 2019 17:40:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D83A320679 for ; Tue, 29 Oct 2019 17:40:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="EPYWlJ86" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728574AbfJ2Rkr (ORCPT ); Tue, 29 Oct 2019 13:40:47 -0400 Received: from mail-qk1-f193.google.com ([209.85.222.193]:44028 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727518AbfJ2Rkq (ORCPT ); Tue, 29 Oct 2019 13:40:46 -0400 Received: by mail-qk1-f193.google.com with SMTP id a194so13074672qkg.10 for ; Tue, 29 Oct 2019 10:40:45 -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=/LNOlHf2rDm22wEkTsouArIOxVXq1gxd46OR69rUm3k=; b=EPYWlJ86L4Djyk4xMC4yRspSA8HN8+v55zNkN212xDFpGxJu/FDeYEFol8FnkFwzr9 deiV9oqTkU6aXWKdYZdpN2koF89XJPpBTb3WCC03SXqC3Hacy5jJEoDVl1uM+VZHqRXd 1nE0JZ02oNJvg1DcO9mzx1Q2CYHpy1AtygOb4i7dpM1VzmFFR/EiJkahk+Dsy7nIDrrS 6kmwuQ+2T25E4qDMYoPRHZnpTjWFwbd35HnRcR9fSAqNNE3y+oLpJ2XJ4X3ZVeLb/oHD j6KakXpH1QMUQhggVqc3O+6LFgLmrgX5hdXlRNPlFFFiWz29B/1SAme7Oc4KL9Q9aOuu a6Eg== 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=/LNOlHf2rDm22wEkTsouArIOxVXq1gxd46OR69rUm3k=; b=bT3MG6WvPLRIveInIQdhOz9RL9rXga9UA6WbWEjkX6zZVq7iq79ETjYmcOlk9i85Fb 0ZLJ8J2O4bXiW6BLJpQ5BLnZhg0jh5ISuw1AgA+iDToRmkrJHinmOthbC5Fm0JWEcM8N Dp5HbqEG8ehL+JIj8wL9SBL75ZR1H7s8Mw2Io6adttaxJXq+/DR8LTwEiHsnsYnYW/6c bKycXrAUUXW+rzbPtn2+xj0F2Vt6JOnCB1N539CsYkMUxEmHYMy3vZoY3vRWqGLiwsyK mKAic65Ltds6gyv8o3d3Z5jgmB0ssAXczr8LsFurbK1UTuwT+iXdGU8FZJVgW2SQd8UZ LhTA== X-Gm-Message-State: APjAAAWuUbkWgILSzsH8axHKU6ObCGj8sSf3KbywzO/p1y3az+UKKzJw HIxJgczhoyGP80Am75/LjvQ= X-Google-Smtp-Source: APXvYqwgSeTRcFyhLfDgzwCX20cxjCvPj8kSVkOmRvXOaVBsp82Cy/sIcSQb3V3gIjXW3y8VMXjsyA== X-Received: by 2002:a05:620a:68c:: with SMTP id f12mr22837966qkh.501.1572370844375; Tue, 29 Oct 2019 10:40:44 -0700 (PDT) Received: from fabio-Latitude-E5450.nxp.com ([177.221.114.206]) by smtp.gmail.com with ESMTPSA id c21sm7417725qtg.61.2019.10.29.10.40.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Oct 2019 10:40:43 -0700 (PDT) From: Fabio Estevam To: linux@roeck-us.net Cc: wim@linux-watchdog.org, linux-watchdog@vger.kernel.org, Anson.Huang@nxp.com, shawnguo@kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, Fabio Estevam Subject: [PATCH 2/5] watchdog: imx7ulp: Pass the wdog instance inimx7ulp_wdt_enable() Date: Tue, 29 Oct 2019 14:40:34 -0300 Message-Id: <20191029174037.25381-2-festevam@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191029174037.25381-1-festevam@gmail.com> References: <20191029174037.25381-1-festevam@gmail.com> Sender: linux-watchdog-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@vger.kernel.org It is more natural to pass the watchdog instance inside imx7ulp_wdt_enable() instead of the base address. This also has the benefit to reduce the code a bit. Signed-off-by: Fabio Estevam Reviewed-by: Guenter Roeck --- drivers/watchdog/imx7ulp_wdt.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/drivers/watchdog/imx7ulp_wdt.c b/drivers/watchdog/imx7ulp_wdt.c index ba5d535a6db2..eea415609d44 100644 --- a/drivers/watchdog/imx7ulp_wdt.c +++ b/drivers/watchdog/imx7ulp_wdt.c @@ -47,15 +47,17 @@ struct imx7ulp_wdt_device { struct clk *clk; }; -static inline void imx7ulp_wdt_enable(void __iomem *base, bool enable) +static inline void imx7ulp_wdt_enable(struct watchdog_device *wdog, bool enable) { - u32 val = readl(base + WDOG_CS); + struct imx7ulp_wdt_device *wdt = watchdog_get_drvdata(wdog); + + u32 val = readl(wdt->base + WDOG_CS); - writel(UNLOCK, base + WDOG_CNT); + writel(UNLOCK, wdt->base + WDOG_CNT); if (enable) - writel(val | WDOG_CS_EN, base + WDOG_CS); + writel(val | WDOG_CS_EN, wdt->base + WDOG_CS); else - writel(val & ~WDOG_CS_EN, base + WDOG_CS); + writel(val & ~WDOG_CS_EN, wdt->base + WDOG_CS); } static inline bool imx7ulp_wdt_is_enabled(void __iomem *base) @@ -76,18 +78,15 @@ static int imx7ulp_wdt_ping(struct watchdog_device *wdog) static int imx7ulp_wdt_start(struct watchdog_device *wdog) { - struct imx7ulp_wdt_device *wdt = watchdog_get_drvdata(wdog); - imx7ulp_wdt_enable(wdt->base, true); + imx7ulp_wdt_enable(wdog, true); return 0; } static int imx7ulp_wdt_stop(struct watchdog_device *wdog) { - struct imx7ulp_wdt_device *wdt = watchdog_get_drvdata(wdog); - - imx7ulp_wdt_enable(wdt->base, false); + imx7ulp_wdt_enable(wdog, false); return 0; } @@ -109,10 +108,8 @@ static int imx7ulp_wdt_set_timeout(struct watchdog_device *wdog, static int imx7ulp_wdt_restart(struct watchdog_device *wdog, unsigned long action, void *data) { - struct imx7ulp_wdt_device *wdt = watchdog_get_drvdata(wdog); - - imx7ulp_wdt_enable(wdt->base, true); - imx7ulp_wdt_set_timeout(&wdt->wdd, 1); + imx7ulp_wdt_enable(wdog, true); + imx7ulp_wdt_set_timeout(wdog, 1); /* wait for wdog to fire */ while (true) From patchwork Tue Oct 29 17:40:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 11218367 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E498B15AB for ; Tue, 29 Oct 2019 17:40:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B9378208E3 for ; Tue, 29 Oct 2019 17:40:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="BGbyT7aG" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727518AbfJ2Rku (ORCPT ); Tue, 29 Oct 2019 13:40:50 -0400 Received: from mail-qt1-f194.google.com ([209.85.160.194]:43582 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727193AbfJ2Rku (ORCPT ); Tue, 29 Oct 2019 13:40:50 -0400 Received: by mail-qt1-f194.google.com with SMTP id c26so2770497qtj.10 for ; Tue, 29 Oct 2019 10:40:48 -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=fCtbEiPh4RVwJQFmLbcxYcjZMuCT1CfeoiRz2toc4rs=; b=BGbyT7aG7xJfe77ae++8pKxAHf3lqxRfOJApKzZpcfoh+20ZQyEEaTQNg8A3RWjwZr kFpV4J0xSYaasH3wd+D2+XCiumhiUGYRZHqraKl4pSmN4BUsWj+Fz09BowwZrLoKX6Yj zD8UnHDGlD4ossadnsm6uieSxfOY4JTGqc9pWcAF9lz3cETyAGxpq9qD2G3S4ENvAYtC N5x4dTvfQwsdvT0YxwQc2iEUUgdF01C7Rv/jmMb7nhUkaECTHj1HIiKSf/KopsHpsGFO XPOGUEM/iX/InkWdDJrpzs4zp1yEMpXjIzjG3fq8T9KDkUGKbi+tQYxQGA8dujO4S7f3 5bnw== 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=fCtbEiPh4RVwJQFmLbcxYcjZMuCT1CfeoiRz2toc4rs=; b=kBpVKfl2QW/9rHIQ28jxMoqZ4MzRj36mhSb2Hs6BFCbPuVIR48VuWBdQDaenGZN/Gt 6qiM/4ZM7Guej0Hc6rusdyPjrJifI8KAws1v/3YqAG0pkV040v+j08wm/H+Ea5M/Eik2 gozvYc5ESXUX8c4z6Fs1k979wmTPMKi3dMyZn7W6EuPAbdl9DJpe0USAY7+TUZSR1X9r qiUcnwUJTR1r7typiXu3WJQCg1RyUKJ94KcFkKTPSZB+29R+g4cj3c2qVHhUIB7kl6Fo cIZwTDozlPO7FEGVKgkYBsychq1PtFQffn/QbGN/bKC1K7wLNeBs07nTJVRYFhWobtDz QPUA== X-Gm-Message-State: APjAAAWloKfdR7x4krYSLwDtVnrHfDCrElvce3oO+Y4i7hTjBB/N98z0 H7mJ/JO+aQDjwx8nbk+GrZk= X-Google-Smtp-Source: APXvYqwURNXyGJAniOrJlVckcVE63XFuWpOlqP4tNYSMIzeEXQkoKpnFaqdDWLqNhflu3kTlT9Q0Xw== X-Received: by 2002:a05:6214:421:: with SMTP id a1mr16180491qvy.0.1572370847839; Tue, 29 Oct 2019 10:40:47 -0700 (PDT) Received: from fabio-Latitude-E5450.nxp.com ([177.221.114.206]) by smtp.gmail.com with ESMTPSA id c21sm7417725qtg.61.2019.10.29.10.40.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Oct 2019 10:40:47 -0700 (PDT) From: Fabio Estevam To: linux@roeck-us.net Cc: wim@linux-watchdog.org, linux-watchdog@vger.kernel.org, Anson.Huang@nxp.com, shawnguo@kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, Fabio Estevam Subject: [PATCH 3/5] watchdog: imx7ulp: Remove unused structure member Date: Tue, 29 Oct 2019 14:40:35 -0300 Message-Id: <20191029174037.25381-3-festevam@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191029174037.25381-1-festevam@gmail.com> References: <20191029174037.25381-1-festevam@gmail.com> Sender: linux-watchdog-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@vger.kernel.org The 'notifier_block' structure member is unused, so just remove it. Signed-off-by: Fabio Estevam Reviewed-by: Guenter Roeck --- drivers/watchdog/imx7ulp_wdt.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/watchdog/imx7ulp_wdt.c b/drivers/watchdog/imx7ulp_wdt.c index 670102924bc1..ed4f7d439f2e 100644 --- a/drivers/watchdog/imx7ulp_wdt.c +++ b/drivers/watchdog/imx7ulp_wdt.c @@ -41,7 +41,6 @@ MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); struct imx7ulp_wdt_device { - struct notifier_block restart_handler; struct watchdog_device wdd; void __iomem *base; struct clk *clk; From patchwork Tue Oct 29 17:40:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 11218369 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 11A4013BD for ; Tue, 29 Oct 2019 17:40:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E29DF20679 for ; Tue, 29 Oct 2019 17:40:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="N4uvAWbn" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729608AbfJ2Rkx (ORCPT ); Tue, 29 Oct 2019 13:40:53 -0400 Received: from mail-qk1-f193.google.com ([209.85.222.193]:33725 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729025AbfJ2Rkx (ORCPT ); Tue, 29 Oct 2019 13:40:53 -0400 Received: by mail-qk1-f193.google.com with SMTP id 71so13117748qkl.0 for ; Tue, 29 Oct 2019 10:40:51 -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=8EHIOJjx9TW9fBNO1txxDakXsrb9eKAqZMrFe7L1UJ8=; b=N4uvAWbnMxnlVQuwSPhWuI+iHQ9cP/3WcMWZTEdu2sOqxGCu64ZiUmvMqDr75iWqjJ 924n3vRWAP7OC9FD//0dAOkGhRkwoIj1cr1xY9WyeHVHIRMd/PY3nFUhUg/0rFhzVsWf uGljh9zykeSUOaq+ZTyD2nBzINJKhreVRBSrCKwDpKrismWW5ZstpMgTUbJ2FFn9Z14I p28hnXKLQvV6fnSjUf1OZENvG6o9jlKk77/xOsQK42fOZLrqDnrpB+gsq9E14o/RgKrY p9XW+cdqmqARM/+PUtR+XzmD8RgD6kh0NSsYJqDtyfVj+cgdvN/vL0RR3tAAjvsnu+oh G+4Q== 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=8EHIOJjx9TW9fBNO1txxDakXsrb9eKAqZMrFe7L1UJ8=; b=SbvIQXcSf/TQiegQcKM5Mf+5JpIqxAHbMqzBy4X52o+GVRov+izCEzt7J8Y+3Hmdma 9BdX4zE3DVa4KDY/qP7U37+wE1TpgoRgN2bkYs3MJCcu/9zAWMfB211yPBDgZgbNGPQB W6D4Ts+fkvl3Xx76du8vzDhVWGstcGOR3Or0enrOzyNNSQBGEz0JQILKZL+e5hKNWciQ mM9T3AOVsdzePZVH03jubsP7FTNc3KFywEoxTjlz+RYRvnVs8S0KptUP3MgfOZItyfxa WVDeMXNLECjXfP72hbmibVc24dLiVbturwhLsncC3mWROSqxSgTYfY3LunBDqkYFeiVd 0ZGg== X-Gm-Message-State: APjAAAX/6hSnzL1uzyTcQDoLzq2uLYe1kZJqBCKZLnRf5WnxsNERppL1 /7Xxt1l89toFA02SCaz8dhA= X-Google-Smtp-Source: APXvYqwozPWGOSN9tsS1yu7qfr2Aa7y1eEkITkGZh5Y68PCV2QICDELDXgGev/CLPLSRWy1vZCPvdg== X-Received: by 2002:a05:620a:548:: with SMTP id o8mr16594098qko.44.1572370851073; Tue, 29 Oct 2019 10:40:51 -0700 (PDT) Received: from fabio-Latitude-E5450.nxp.com ([177.221.114.206]) by smtp.gmail.com with ESMTPSA id c21sm7417725qtg.61.2019.10.29.10.40.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Oct 2019 10:40:50 -0700 (PDT) From: Fabio Estevam To: linux@roeck-us.net Cc: wim@linux-watchdog.org, linux-watchdog@vger.kernel.org, Anson.Huang@nxp.com, shawnguo@kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, Fabio Estevam Subject: [PATCH 4/5] watchdog: imx7ulp: Remove inline annotations Date: Tue, 29 Oct 2019 14:40:36 -0300 Message-Id: <20191029174037.25381-4-festevam@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191029174037.25381-1-festevam@gmail.com> References: <20191029174037.25381-1-festevam@gmail.com> Sender: linux-watchdog-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@vger.kernel.org Compiler is smart enough and knows when to inline, so there is no need to mark some of these functions as 'inline'. Remove such annotations. Signed-off-by: Fabio Estevam Reviewed-by: Guenter Roeck --- drivers/watchdog/imx7ulp_wdt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/watchdog/imx7ulp_wdt.c b/drivers/watchdog/imx7ulp_wdt.c index ed4f7d439f2e..bcef3b6a9782 100644 --- a/drivers/watchdog/imx7ulp_wdt.c +++ b/drivers/watchdog/imx7ulp_wdt.c @@ -46,7 +46,7 @@ struct imx7ulp_wdt_device { struct clk *clk; }; -static inline void imx7ulp_wdt_enable(struct watchdog_device *wdog, bool enable) +static void imx7ulp_wdt_enable(struct watchdog_device *wdog, bool enable) { struct imx7ulp_wdt_device *wdt = watchdog_get_drvdata(wdog); @@ -59,7 +59,7 @@ static inline void imx7ulp_wdt_enable(struct watchdog_device *wdog, bool enable) writel(val & ~WDOG_CS_EN, wdt->base + WDOG_CS); } -static inline bool imx7ulp_wdt_is_enabled(void __iomem *base) +static bool imx7ulp_wdt_is_enabled(void __iomem *base) { u32 val = readl(base + WDOG_CS); @@ -132,7 +132,7 @@ static const struct watchdog_info imx7ulp_wdt_info = { WDIOF_MAGICCLOSE, }; -static inline void imx7ulp_wdt_init(void __iomem *base, unsigned int timeout) +static void imx7ulp_wdt_init(void __iomem *base, unsigned int timeout) { u32 val; From patchwork Tue Oct 29 17:40:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 11218371 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 05A1513BD for ; Tue, 29 Oct 2019 17:40:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D7D2121734 for ; Tue, 29 Oct 2019 17:40:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bGcBFN47" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729733AbfJ2Rkz (ORCPT ); Tue, 29 Oct 2019 13:40:55 -0400 Received: from mail-qt1-f195.google.com ([209.85.160.195]:39389 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729025AbfJ2Rkz (ORCPT ); Tue, 29 Oct 2019 13:40:55 -0400 Received: by mail-qt1-f195.google.com with SMTP id t8so21434395qtc.6 for ; Tue, 29 Oct 2019 10:40:54 -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=hMLzfyGr3cpjTUw47ePlTvPDaWbwwoe19NIKcbfGLxo=; b=bGcBFN47qyJ+FBC8eIPd/QYESNiLshojQRT9zJ61sjbOTBdOU6GCtKKs/FkYzcGjWF PAxU7SIOr+BVv3seftD/4BD74MZj+Qc6RF3ztu/gBwsmFODkpVXK2iGRORZjAvSLxgVz H0wgd94dawJtkMC443hPl78ZtahPi91fgI8YySD7F9czmsWyJTlRnEIqHUwiHrZK5aHA S0lZo9hzH4mdqFhRBoupjRpUBEpt0Dq65ELCSQ80YFIwXkzpV4/i3SCaXk0tOxwwy6+7 BMOiX8/saDF9Cds2fdCD8RhjfLvF0ibePDe/fjzs/gBSUbiosyyk+t9s0lS8SqdnaDHD CbFw== 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=hMLzfyGr3cpjTUw47ePlTvPDaWbwwoe19NIKcbfGLxo=; b=AaXxnBfNpYxFiOu4Gm7BV7wwvy/zgihIf61UV4o/Io0X5j/dXi35+vg/qNrGxU2zYw kM4MrLrDmOjhTnsAbrRtK/Esbto2CtJsAxcbE3cryT2C+XAas3PpoTKmXbuh5zmZJnf6 xDrm8Vxkoz60r3uHQiGeRYcIdW3dvF5PoKqPOWpku01JgQRH19hJ3YCOKJq8NXr3Gm3I XFdJHSkxAM+hBsBqqu5tw3JmJkvLQfXtoP7wmRqbgxvkUtGjAPu4aepOpD+LR3Avp5JN Xs61sJ+JrGmmx5qa5B/qniwiIQhIDDb966igoyoz3zlthXF3soaomuUJCqUtioICINJ3 n8Lw== X-Gm-Message-State: APjAAAVRG+jMTO6smq2ptd2CcmL3PrKu1WOng8MTlbcyktqi7CNXAgNn 5OIBNBylSJG/FC7OjVjpgptaUL9iCI0= X-Google-Smtp-Source: APXvYqwZ3eoAK7uReqZ34lVYcT79pbCE0MunkJnoq7GePafDMEYca7o+1tTWreEbTmk04a34xue9Gw== X-Received: by 2002:aed:2be2:: with SMTP id e89mr142329qtd.161.1572370854359; Tue, 29 Oct 2019 10:40:54 -0700 (PDT) Received: from fabio-Latitude-E5450.nxp.com ([177.221.114.206]) by smtp.gmail.com with ESMTPSA id c21sm7417725qtg.61.2019.10.29.10.40.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Oct 2019 10:40:53 -0700 (PDT) From: Fabio Estevam To: linux@roeck-us.net Cc: wim@linux-watchdog.org, linux-watchdog@vger.kernel.org, Anson.Huang@nxp.com, shawnguo@kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, Fabio Estevam Subject: [PATCH 5/5] watchdog: imx7ulp: Use definitions instead of magic values Date: Tue, 29 Oct 2019 14:40:37 -0300 Message-Id: <20191029174037.25381-5-festevam@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191029174037.25381-1-festevam@gmail.com> References: <20191029174037.25381-1-festevam@gmail.com> Sender: linux-watchdog-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@vger.kernel.org Use definitions instead of magic values in order to improve readability. Since the CLK field of the WDOG CS register is composed of two bits to select the watchdog clock source, use a shift representation instead of BIT(). Signed-off-by: Fabio Estevam Reviewed-by: Guenter Roeck --- drivers/watchdog/imx7ulp_wdt.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/watchdog/imx7ulp_wdt.c b/drivers/watchdog/imx7ulp_wdt.c index bcef3b6a9782..e3c1382dac52 100644 --- a/drivers/watchdog/imx7ulp_wdt.c +++ b/drivers/watchdog/imx7ulp_wdt.c @@ -17,6 +17,9 @@ #define WDOG_CS_CMD32EN BIT(13) #define WDOG_CS_ULK BIT(11) #define WDOG_CS_RCS BIT(10) +#define LPO_CLK 0x1 +#define LPO_CLK_SHIFT 8 +#define WDOG_CS_CLK (LPO_CLK << LPO_CLK_SHIFT) #define WDOG_CS_EN BIT(7) #define WDOG_CS_UPDATE BIT(5) @@ -143,7 +146,7 @@ static void imx7ulp_wdt_init(void __iomem *base, unsigned int timeout) /* set an initial timeout value in TOVAL */ writel(timeout, base + WDOG_TOVAL); /* enable 32bit command sequence and reconfigure */ - val = BIT(13) | BIT(8) | BIT(5); + val = WDOG_CS_CMD32EN | WDOG_CS_CLK | WDOG_CS_UPDATE; writel(val, base + WDOG_CS); }