From patchwork Tue Jun 18 15:20:32 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 2744511 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id EB8E59F8E1 for ; Tue, 18 Jun 2013 17:49:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 16DA920594 for ; Tue, 18 Jun 2013 17:49:32 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 245F42058E for ; Tue, 18 Jun 2013 17:49:31 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UoxlV-0003fm-IP; Tue, 18 Jun 2013 15:24:16 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UoxkQ-0003MK-Kk; Tue, 18 Jun 2013 15:23:06 +0000 Received: from mail-pa0-x22b.google.com ([2607:f8b0:400e:c03::22b]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UoxjY-0003Ez-Pd for linux-arm-kernel@lists.infradead.org; Tue, 18 Jun 2013 15:22:13 +0000 Received: by mail-pa0-f43.google.com with SMTP id hz11so4149660pad.16 for ; Tue, 18 Jun 2013 08:21:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :in-reply-to:references:x-gm-message-state; bh=XJBG+SdTLh3bOKBk15HntcY+YRCwLhyPa4klLmqVSbs=; b=E/PtXOJ4MeMcVWQLF9ejvZ3mJk3Q+fcxk1wWAbDGoBha8RgOcroL0DJRLHgV4B5gtO irN8MnhNQ4LJrLuSxKjcgO5T+JllixjZxuOvEumbB2B+zI8cL51Inj/aH4XAfeQaxQB+ BS8OXfjQDUNYrwmWbci7ZsbdTjF9jyRq0mwLEL6Aio+huLfj6P8OaU+3wqpsycp2Uvgh 4QHu+gAWmqOuWkE+q6ZvHjJFbH0UpRRolyZIK6y/0v4ZngbGLr+pzDvc1bChQYhThcv5 yqXfKSg21KzH5FJwWnMmUQqSi2hpJ64M0o0bttrnYl/5cYunG4vRMNCm2zf23w2B12IS IU2g== X-Received: by 10.66.159.168 with SMTP id xd8mr2533974pab.146.1371568911313; Tue, 18 Jun 2013 08:21:51 -0700 (PDT) Received: from localhost ([122.167.240.191]) by mx.google.com with ESMTPSA id kv2sm18694202pbc.28.2013.06.18.08.21.48 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 18 Jun 2013 08:21:50 -0700 (PDT) From: Viresh Kumar To: wim@iguana.be Subject: [PATCH V3 08/14] watchdog/mpcore_wdt: disable wdt in suspend only if it is busy Date: Tue, 18 Jun 2013 20:50:32 +0530 Message-Id: <8bad206e36e575433374b1ae6a18753ea00d6fa3.1371535243.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e In-Reply-To: References: In-Reply-To: References: X-Gm-Message-State: ALoCoQm0M2AIp2w7c7MGL23YKW6EfkaM0TZsuV8gIoi6t1IZetPN6GDD2CBMpieb/IszSlX+ZQAH X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130618_112212_960545_9FC246EE X-CRM114-Status: GOOD ( 10.39 ) X-Spam-Score: -1.9 (-) Cc: marc.zyngier@arm.com, Viresh Kumar , linux-watchdog@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We don't need to call mpcore_wdt_stop() in suspend, if wdt is not BUSY. So, call mpcore_wdt_stop() conditionally in suspend. Signed-off-by: Viresh Kumar --- drivers/watchdog/mpcore_wdt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/watchdog/mpcore_wdt.c b/drivers/watchdog/mpcore_wdt.c index b4d06f1..75cc518 100644 --- a/drivers/watchdog/mpcore_wdt.c +++ b/drivers/watchdog/mpcore_wdt.c @@ -261,7 +261,9 @@ static int mpcore_wdt_remove(struct platform_device *pdev) static int mpcore_wdt_suspend(struct device *dev) { struct mpcore_wdt *wdt = dev_get_drvdata(dev); - mpcore_wdt_stop(&wdt->wdd); /* Turn the WDT off */ + + if (watchdog_active(&wdt->wdd)) + mpcore_wdt_stop(&wdt->wdd); /* Turn the WDT off */ return 0; }