From patchwork Tue Jun 15 12:39:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grzegorz Jaszczyk X-Patchwork-Id: 12322591 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F31CBC48BDF for ; Tue, 15 Jun 2021 18:08:18 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id C00AC610F7 for ; Tue, 15 Jun 2021 18:08:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C00AC610F7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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=7xqP077o7UMrhDoYB3ui8pgfpaBGXT3rkvh0u4BIy3g=; b=hsiDSbYeZcOV8C c8B+6LwLP9cDn88+CUyy/9fhrzDHpz4yWnSSXKVnK7h12dx8zb4rJwFnrOO344yZKeWqO8OozzCWa WbeRCOgWQ7FzpciGDUWT+Z6tD9VAHNIG+Qh0yB04QYcl25iIZ7aPVDs03III8PhIOj6dnKGUEFD/o lLeMu3EcxqxcIwAPRktCi6ZXA/057+WWbcw76LvZws9rVZ2y22GD/AW3El7hbj1hEfwDaq/Sep1n9 TwNH9XhovFQy5BM8jfpZFsf8gF4bJEZbrx0NfHFfT1/Myl3Hzc8cHokWwQ+7aD5aSjtWE53wuVOee 71MlP77fuMTdXpTB0znw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ltDRt-001yua-3T; Tue, 15 Jun 2021 18:06:07 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lt9DO-000ByJ-0V for linux-arm-kernel@bombadil.infradead.org; Tue, 15 Jun 2021 13:34:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version :Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:In-Reply-To:References; bh=UuCiW2orTCucTZCp6O8CDD9AXD/9H9Otzbi//Cqg1DA=; b=rO3buVlSjs0112g3ApY8f0sxHe rLdknVXChmKON52hLsXin7OzFoGJVnvgpqR3yY7iy/vNpf8b0ZkgkUzwyiEXhEbnbimFLCK6BqsdX JuHAhsDp9Pb+IZjK/7PUIzFnVMlakaqEp/1j+XfAsXHKyWNFh2JCGzyaKZZz6YF4UG0hsdtbnRg7m LTHvGaK4uwtdsHjneULuBqQnGlXSWedQZGjYUy9+5KevhqVo76AP3T65b7tENdtueRkrF2ItBqRPo 4ddfgoo2TzjK8QdxRhm4AeJ0yL6+WYmeyK4weesyZpxLGqORTb1F1V4frIX1OE/j0GQqd8ESGROMz ZJWwLQ9Q==; Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]) by desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lt8LV-007t35-JR for linux-arm-kernel@lists.infradead.org; Tue, 15 Jun 2021 12:39:18 +0000 Received: by mail-lf1-x133.google.com with SMTP id r198so26754932lff.11 for ; Tue, 15 Jun 2021 05:39:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=UuCiW2orTCucTZCp6O8CDD9AXD/9H9Otzbi//Cqg1DA=; b=VZ3GcXveZakLxHce86jM4RSuS7T16Lj1tuDnRPjjD6LmGpt28d1lvFZtSU3p7z0M1p ReRbsQU4aVs4CX7VFzsuAIKAuJuvEBZfqLFZAhOCb0mt7DZrfKtiZGkkVZ0uNrLZ+dY1 luUe8J/JKZuqKjFiY1V+aiYKkwFMJtMvVHz50fSPUv2+LoFm+fL2cYZoLhoavVaMcnJp 53C879XsXgpQeNsOLnsK/jCocXn6Lbilb9UCJpfDqXFZr83N9k5sPbKzhl9sjnOtyrbn ykxZsh28MK7EPMorjJGsGTZwre6MCu6c0GgBoCpNHt7Cq7+wQBsVAU1WIBfp8FIUsLin Ofyg== 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:mime-version :content-transfer-encoding; bh=UuCiW2orTCucTZCp6O8CDD9AXD/9H9Otzbi//Cqg1DA=; b=FmXaQm8xYM9hgPvx3I9ys8TVDgbHNNk/Sz5wpATRbgeVNejMwSZiQAQQJo8PR2yy5U O86AlTLETvU5lC6DvUtiv/GoD3WVGeAw5Q1F+OjPyVnrGv1aZQv64jcyiO8cgSJgM4Dp OlR5jUS+UnueujHHVewFJ04IT4+TzBp0d+DEJbFj3+ZUhitzGO7lgPfJe4Cu6svn9+53 OE9djBx7I4Sf7ZEThU5cPPaZW+VhbFx7nLXzJPzkEB4BsSEtNdnnOkqqK6AQeP/2xYl1 3VD2kPjHAnJ1FHhYt8x58WLxt//EkBnmGI6EKAsuXJ54OCHKlhIt2BromgiaBQ9HHcZT 8qQQ== X-Gm-Message-State: AOAM5324UV8xREkhFvQBAxZYB+KoKFZX7TsXgE7uzJV+dy+FtJrXUkEA t2nyqnI/hd8VTfW4rlfeGeY/VA== X-Google-Smtp-Source: ABdhPJwDSx5g6S/Z3ibqwuHIj/X45vbYi1g0IUdok+X6ST8l1GlMDaBjW2PeiJeQ28sxtJaAY2HhRg== X-Received: by 2002:a05:6512:36d8:: with SMTP id e24mr10216306lfs.8.1623760751686; Tue, 15 Jun 2021 05:39:11 -0700 (PDT) Received: from gilgamesh.lab.semihalf.net ([83.142.187.85]) by smtp.gmail.com with ESMTPSA id m12sm811418lfb.231.2021.06.15.05.39.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Jun 2021 05:39:11 -0700 (PDT) From: Grzegorz Jaszczyk To: wim@linux-watchdog.org, linux@roeck-us.net, shawnguo@kernel.org Cc: linux-watchdog@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, grzegorz.jaszczyk@linaro.org Subject: [PATCH 0/2] introduce watchdog_dev_suspend/resume Date: Tue, 15 Jun 2021 14:39:02 +0200 Message-Id: <20210615123904.2568052-1-grzegorz.jaszczyk@linaro.org> X-Mailer: git-send-email 2.29.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210615_133916_587777_6E3B9721 X-CRM114-Status: GOOD ( 11.73 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi All, This patch-set fixes system hang which occurs when the ping worker fires after wdog suspend and before wdog resume. This happens because the ping worker can issue low-level ping while the wdog clk was disabled by the suspend routine (accessing hw wdog registers while they are not fed by the clk). To overcome this issue two patches were introduced. Patch #1 provides watchdog_dev_suspend/resume function, which can be used in wdog drivers. First function allows to cancel watchdog ping worker during suspend, preventing watchdog_dev from issuing low-level ping and second one restores ping worker if needed. Patch #2 introduces relevant changes to imx2_wdt driver and takes advantage of just introduced routines. Grzegorz Jaszczyk (2): watchdog: introduce watchdog_dev_suspend/resume watchdog: imx2_wdg: notify wdog subsystem about wdog suspend/resume drivers/watchdog/imx2_wdt.c | 20 ++++++++++---- drivers/watchdog/watchdog_dev.c | 49 +++++++++++++++++++++++++++++++++ include/linux/watchdog.h | 2 ++ 3 files changed, 66 insertions(+), 5 deletions(-)