From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2D510C433FE for ; Fri, 4 Nov 2022 07:04:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231535AbiKDHEN (ORCPT ); Fri, 4 Nov 2022 03:04:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229804AbiKDHEK (ORCPT ); Fri, 4 Nov 2022 03:04:10 -0400 Received: from cpanel.siel.si (cpanel.siel.si [46.19.9.99]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F18DDB492; Fri, 4 Nov 2022 00:04:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=norik.com; s=default; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject: Cc:To:From:Sender:Reply-To:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=sJk/uIhVMN6FJkJbBHcqgLnXIArLY/TP8/nafG2pa9k=; b=HCig3YIWU0vQa2605yKEgaRSbB SkbMKOr7o+F5qiTTe1pOtR+hFEBHdq7ixx7jVu9gCYcwQ8usNbi1CM8puxXTtgEVYVPrDtlguJFiS 12SAv7o5zRgZS2FbCUqRrbTQ5GPAsn5TZhu03LGG51fZUx7PqczcxR7RrQxw1mKk0lXCU5MgTkPaI 7DhMKwlcMiPgucUjDzNO4wehrwVLnVJ6RTyRHXoKliIiaKCNlBcuNTxGU+GdYrdqAha2k8tFUkczB OGeU67+DT/P0PwaXSKaMWQSkDDQlN+uxEWIMn4dql004J8BJafRN++ARWqXAxxqmSTPrK/a7uUHrt qO1gqGzA==; Received: from [89.212.21.243] (port=40616 helo=localhost.localdomain) by cpanel.siel.si with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.95) (envelope-from ) id 1oqqk7-00EcG2-7k; Fri, 04 Nov 2022 08:04:02 +0100 From: Andrej Picej To: linux-watchdog@vger.kernel.org Cc: wim@linux-watchdog.org, linux@roeck-us.net, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, Anson.Huang@nxp.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 0/3] Suspending i.MX watchdog in WAIT mode Date: Fri, 4 Nov 2022 08:03:55 +0100 Message-Id: <20221104070358.426657-1-andrej.picej@norik.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cpanel.siel.si X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - norik.com X-Get-Message-Sender-Via: cpanel.siel.si: authenticated_id: andrej.picej@norik.com X-Authenticated-Sender: cpanel.siel.si: andrej.picej@norik.com X-Source: X-Source-Args: X-Source-Dir: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The i.MX6 watchdog can't be stopped once started. Additionally, watchdog hardware configuration needs to be able to handle low-power modes of the SoC. For low-power modes, there are two configuration bits in the TRM: - WDZST bit disables the watchdog timer in "deeper" low power modes and - WDW bit disables the watchdog timer in "WAIT" mode WDZST bit support is already in place since 1a9c5efa576e ("watchdog: imx2_wdt: disable watchdog timer during low power mode"). On the other hand, handling of WDZST bit was omitted so far but now these patch series bring support for it. SoC's "WAIT" low-power mode corresponds to Linux's freeze or Suspend-to-Idle (S0) mode which can be activated with: $ echo freeze > /sys/power/state Without these patches, board would be reset by the watchdog after timeout of 128 seconds since watchdog would not be stopped when SoC entered Suspend-to-Idle mode. With patches in place, boards using imx2-wdt are able to stay in Suspend-to-Idle mode indefinitely. Last but not least, WDW bit is not found on all imx2-wdt supported i.MX devices, therefore a new device-tree property "fsl,suspend-in-wait" has been introduced for this. Here is v1: https://lore.kernel.org/lkml/20221019111714.1953262-1-andrej.picej@norik.com/ Here is v2: https://lore.kernel.org/all/20221025072533.2980154-1-andrej.picej@norik.com/#t Here is v3: https://lore.kernel.org/all/20221103100358.176099-1-andrej.picej@norik.com/ Change log in the corresponding patches. Andrej Picej (3): watchdog: imx2_wdg: suspend watchdog in WAIT mode dt-bindings: watchdog: fsl-imx: document suspend in wait mode ARM: dts: imx6ul/ull: suspend i.MX6UL watchdog in wait mode .../bindings/watchdog/fsl-imx-wdt.yaml | 37 ++++++++++++- .../boot/dts/imx6ul-phytec-phycore-som.dtsi | 4 ++ drivers/watchdog/imx2_wdt.c | 55 ++++++++++++++++++- 3 files changed, 90 insertions(+), 6 deletions(-) -- 2.25.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 07B99C433FE for ; Fri, 4 Nov 2022 07:05:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=UfcnqBi0u53zSbar2q2kqlb87HPvtfVLbI29yv1+7Cw=; b=vOPrfmXVLxY1h+ 4cvzRQL1gLypdbfAFq5OHTUn/F5P1KTTtu37hAAh5PDDEQ2H4WBYiUD9blKxOvSh4TdbHbcKDHfNM FBRFcXNzZ/rU/XYhcp1BhhIPHYuRQXIm7X5TCxkS3VxmuPww50Br2k33YQFwygF+czdoGmqtXVySp rs0F8/1jL9MNeLiPAkU+YMJsSkI07w/p4bUsl1/Qp8GxdjyeoBKThYfTuq1XYUsdaUkR2tyUDBwSQ 9zknt1Z/gXzpX8lAXAOdoIbdB41QywbKJU+BfsSmJw2YUEYoK+knL4knDgY+zvCzBD2f080fOQDYp y5XQ3BNE5kfGhq8JpubA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqqkT-002hky-2b; Fri, 04 Nov 2022 07:04:17 +0000 Received: from cpanel.siel.si ([46.19.9.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqqkM-002hhc-Nq for linux-arm-kernel@lists.infradead.org; Fri, 04 Nov 2022 07:04:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=norik.com; s=default; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject: Cc:To:From:Sender:Reply-To:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=sJk/uIhVMN6FJkJbBHcqgLnXIArLY/TP8/nafG2pa9k=; b=HCig3YIWU0vQa2605yKEgaRSbB SkbMKOr7o+F5qiTTe1pOtR+hFEBHdq7ixx7jVu9gCYcwQ8usNbi1CM8puxXTtgEVYVPrDtlguJFiS 12SAv7o5zRgZS2FbCUqRrbTQ5GPAsn5TZhu03LGG51fZUx7PqczcxR7RrQxw1mKk0lXCU5MgTkPaI 7DhMKwlcMiPgucUjDzNO4wehrwVLnVJ6RTyRHXoKliIiaKCNlBcuNTxGU+GdYrdqAha2k8tFUkczB OGeU67+DT/P0PwaXSKaMWQSkDDQlN+uxEWIMn4dql004J8BJafRN++ARWqXAxxqmSTPrK/a7uUHrt qO1gqGzA==; Received: from [89.212.21.243] (port=40616 helo=localhost.localdomain) by cpanel.siel.si with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.95) (envelope-from ) id 1oqqk7-00EcG2-7k; Fri, 04 Nov 2022 08:04:02 +0100 From: Andrej Picej To: linux-watchdog@vger.kernel.org Cc: wim@linux-watchdog.org, linux@roeck-us.net, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, Anson.Huang@nxp.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 0/3] Suspending i.MX watchdog in WAIT mode Date: Fri, 4 Nov 2022 08:03:55 +0100 Message-Id: <20221104070358.426657-1-andrej.picej@norik.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cpanel.siel.si X-AntiAbuse: Original Domain - lists.infradead.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - norik.com X-Get-Message-Sender-Via: cpanel.siel.si: authenticated_id: andrej.picej@norik.com X-Authenticated-Sender: cpanel.siel.si: andrej.picej@norik.com X-Source: X-Source-Args: X-Source-Dir: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221104_000411_296727_4722A0B4 X-CRM114-Status: UNSURE ( 8.26 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The i.MX6 watchdog can't be stopped once started. Additionally, watchdog hardware configuration needs to be able to handle low-power modes of the SoC. For low-power modes, there are two configuration bits in the TRM: - WDZST bit disables the watchdog timer in "deeper" low power modes and - WDW bit disables the watchdog timer in "WAIT" mode WDZST bit support is already in place since 1a9c5efa576e ("watchdog: imx2_wdt: disable watchdog timer during low power mode"). On the other hand, handling of WDZST bit was omitted so far but now these patch series bring support for it. SoC's "WAIT" low-power mode corresponds to Linux's freeze or Suspend-to-Idle (S0) mode which can be activated with: $ echo freeze > /sys/power/state Without these patches, board would be reset by the watchdog after timeout of 128 seconds since watchdog would not be stopped when SoC entered Suspend-to-Idle mode. With patches in place, boards using imx2-wdt are able to stay in Suspend-to-Idle mode indefinitely. Last but not least, WDW bit is not found on all imx2-wdt supported i.MX devices, therefore a new device-tree property "fsl,suspend-in-wait" has been introduced for this. Here is v1: https://lore.kernel.org/lkml/20221019111714.1953262-1-andrej.picej@norik.com/ Here is v2: https://lore.kernel.org/all/20221025072533.2980154-1-andrej.picej@norik.com/#t Here is v3: https://lore.kernel.org/all/20221103100358.176099-1-andrej.picej@norik.com/ Change log in the corresponding patches. Andrej Picej (3): watchdog: imx2_wdg: suspend watchdog in WAIT mode dt-bindings: watchdog: fsl-imx: document suspend in wait mode ARM: dts: imx6ul/ull: suspend i.MX6UL watchdog in wait mode .../bindings/watchdog/fsl-imx-wdt.yaml | 37 ++++++++++++- .../boot/dts/imx6ul-phytec-phycore-som.dtsi | 4 ++ drivers/watchdog/imx2_wdt.c | 55 ++++++++++++++++++- 3 files changed, 90 insertions(+), 6 deletions(-) -- 2.25.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel