From patchwork Tue Jan 19 06:53:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 59960 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp2398101lbb; Mon, 18 Jan 2016 22:54:08 -0800 (PST) X-Received: by 10.66.252.6 with SMTP id zo6mr41822423pac.154.1453186447888; Mon, 18 Jan 2016 22:54:07 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t74si45467525pfa.106.2016.01.18.22.54.07 for ; Mon, 18 Jan 2016 22:54:07 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-watchdog-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-watchdog-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-watchdog-owner@vger.kernel.org; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751689AbcASGxS (ORCPT ); Tue, 19 Jan 2016 01:53:18 -0500 Received: from mail-pf0-f176.google.com ([209.85.192.176]:36319 "EHLO mail-pf0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751638AbcASGxR (ORCPT ); Tue, 19 Jan 2016 01:53:17 -0500 Received: by mail-pf0-f176.google.com with SMTP id n128so170257222pfn.3 for ; Mon, 18 Jan 2016 22:53:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=cY7V2YsTmGH7t/ikR/kcBTY0ikPGzVx8w3h4uNl9lCs=; b=OsQxVAuoA0mapeVuJqMvYy+NNH2tig0YyGEB6/GaMU5Q7pmSaOeu8BPd4+xaDkYIoW 1AsHH7Rf+ZtkAXZrS3GFXmfwd1/lobc6D6lyadFroVfQZt+fQ1N9ovMiEVdARHtKLu6r LzMYWSTnY7HVPZlr7vsA5dxYclBg1fgp8NTnE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=cY7V2YsTmGH7t/ikR/kcBTY0ikPGzVx8w3h4uNl9lCs=; b=lqd2/zv5pRAgYBJM8W8uJDJzZpHTpALLtTwYMXYr5Nnr8TvABTBEjaHVHK2hUyp9MK JH7hCPr5MYrNO8brgDjEBKAs6q7r87jksxx/khAlp70hM5Smbn2Umm/B5mQiEva2kbpG Q7fbeg46PbQDQuJL9ESNeJgblQey6ERc1UzYYaX+/bit499MWKSVI7g8Nuj8kcKO75Ly WSE2gPUQe0nQPaq0K/IGP4eXD/wjmPzjkIFQ04g3lCVJubUcIaopM+67xHOfgnGbmNtU ceBem+j58452kBxyanNyWZwgJKu8vYkp6mvyOfSTYPStNoM79GT+ibrntGi8AjeQQIqp AvoA== X-Gm-Message-State: ALoCoQm9ZY61lwWMV/5SgLfAltnsL3ZMliIJXkXoFdkLpgmEm5oLA4nvedZD0IQiS51v7pL5WzmCq4+f4x3pKJBaWT8dzBv+VA== X-Received: by 10.98.89.78 with SMTP id n75mr41563112pfb.120.1453186397158; Mon, 18 Jan 2016 22:53:17 -0800 (PST) Received: from localhost ([122.172.53.165]) by smtp.gmail.com with ESMTPSA id x18sm38497598pfa.65.2016.01.18.22.53.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Jan 2016 22:53:16 -0800 (PST) Date: Tue, 19 Jan 2016 12:23:13 +0530 From: Viresh Kumar To: Sandeep Tripathy Cc: wim@iguana.be, linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com Subject: Re: [PATCH 1/1] watchdog: sp805: ping fails to abort wdt reset Message-ID: <20160119065313.GA22443@vireshk> References: <1453183462-27577-1-git-send-email-tripathy@broadcom.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1453183462-27577-1-git-send-email-tripathy@broadcom.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-watchdog-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@vger.kernel.org On 19-01-16, 11:34, Sandeep Tripathy wrote: > sp805 wdt asserts interrupt for the first expiry and Why an extra space before sp805 ? > reloads the counter. If wdt interrupt is set and count > reaches zero then wdt reset event is generated.To get Add space after full-stop. > wdt reset at t timeout the driver loads wdt counter Keep t and t/2 in single quotes, its hardly readable otherwise. > with t/2. A ping before t second *should* prevent wdt > reset. Currently if ping is done after t/2 sec then > wdt interrupt condition gets set. On the next countdown > of loadval wdt reset event occurs eventhough wdt was > reloaded before the set timeout t. > > This patch clears the interrupt condition on ping. Why extra spaces before 'This'? > > Signed-off-by: Sandeep Tripathy > --- > drivers/watchdog/sp805_wdt.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/drivers/watchdog/sp805_wdt.c b/drivers/watchdog/sp805_wdt.c > index 01d8162..e7a715e 100644 > --- a/drivers/watchdog/sp805_wdt.c > +++ b/drivers/watchdog/sp805_wdt.c > @@ -139,12 +139,11 @@ static int wdt_config(struct watchdog_device *wdd, bool ping) > > writel_relaxed(UNLOCK, wdt->base + WDTLOCK); > writel_relaxed(wdt->load_val, wdt->base + WDTLOAD); > + writel_relaxed(INT_MASK, wdt->base + WDTINTCLR); > > - if (!ping) { > - writel_relaxed(INT_MASK, wdt->base + WDTINTCLR); > + if (!ping) > writel_relaxed(INT_ENABLE | RESET_ENABLE, wdt->base + > WDTCONTROL); > - } > > writel_relaxed(LOCK, wdt->base + WDTLOCK); If I read the TRM properly, then you don't need to load the WDTLOAD register on ping and so your change can be written as: Please try if this works or not. -- viresh -- To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/watchdog/sp805_wdt.c b/drivers/watchdog/sp805_wdt.c index 01d816251302..42e1ec86532d 100644 --- a/drivers/watchdog/sp805_wdt.c +++ b/drivers/watchdog/sp805_wdt.c @@ -138,10 +138,10 @@ static int wdt_config(struct watchdog_device *wdd, bool ping) spin_lock(&wdt->lock); writel_relaxed(UNLOCK, wdt->base + WDTLOCK); - writel_relaxed(wdt->load_val, wdt->base + WDTLOAD); + writel_relaxed(INT_MASK, wdt->base + WDTINTCLR); if (!ping) { - writel_relaxed(INT_MASK, wdt->base + WDTINTCLR); + writel_relaxed(wdt->load_val, wdt->base + WDTLOAD); writel_relaxed(INT_ENABLE | RESET_ENABLE, wdt->base + WDTCONTROL); }