devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Timur Tabi <timur@codeaurora.org>
To: fu.wei@linaro.org, robh+dt@kernel.org, pawel.moll@arm.com,
	mark.rutland@arm.com, ijc+devicetree@hellion.org.uk,
	galak@codeaurora.org, wim@iguana.be, linux@roeck-us.net,
	corbet@lwn.net, catalin.marinas@arm.com, will.deacon@arm.com,
	Suravee.Suthikulpanit@amd.com
Cc: linux-kernel@vger.kernel.org, linux-watchdog@vger.kernel.org,
	linux-doc@vger.kernel.org, devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linaro-acpi@lists.linaro.org, rruigrok@codeaurora.org,
	harba@codeaurora.org, cov@codeaurora.org, dyoung@redhat.com,
	panand@redhat.com, graeme.gregory@linaro.org,
	al.stone@linaro.org, hanjun.guo@linaro.org, jcm@redhat.com,
	arnd@arndb.de, leo.duran@amd.com, sudeep.holla@arm.com
Subject: Re: [PATCH v12 4/4] Watchdog: introduce ARM SBSA watchdog driver
Date: Fri, 26 Feb 2016 13:27:39 -0600	[thread overview]
Message-ID: <56D0A72B.8020100@codeaurora.org> (raw)
In-Reply-To: <1455611785-2407-5-git-send-email-fu.wei@linaro.org>

fu.wei@linaro.org wrote:
> +	if (action) {
> +		irq = platform_get_irq(pdev, 0);
> +		if (irq < 0) {
> +			action = 0;
> +			dev_warn(dev, "unable to get ws0 interrupt.\n");
> +		} else {
> +			if (devm_request_irq(dev, irq, sbsa_gwdt_interrupt, 0,
> +					     pdev->name, gwdt)) {
> +				action = 0;
> +				dev_warn(dev, "unable to request IRQ %d.\n",
> +					 irq);
> +			}
> +		}
> +		if (!action)
> +			dev_warn(dev, "falling back to signle stage mode.\n");
> +	}
> +
> +	/*
> +	 * Get the frequency of system counter from the cp15 interface of ARM
> +	 * Generic timer. We don't need to check it, because if it returns "0",
> +	 * system would panic in very early stage.
> +	 */
> +	gwdt->clk = arch_timer_get_cntfrq();
> +	gwdt->refresh_base = rf_base;
> +	gwdt->control_base = cf_base;

I think you need to ping the watchdog before enabling the interrupt, in 
case there is a pending interrupt.  This just happened to me in testing, 
so I recommend this:

> 	/*
> 	 * Get the frequency of system counter from the cp15 interface of ARM
> 	 * Generic timer. We don't need to check it, because if it returns "0",
> 	 * system would panic in very early stage.
> 	 */
> 	gwdt->clk = arch_timer_get_cntfrq();
> 	gwdt->refresh_base = rf_base;
> 	gwdt->control_base = cf_base;
>
> 	if (action) {
> 		irq = platform_get_irq(pdev, 0);
> 		if (irq < 0) {
> 			action = 0;
> 			dev_warn(dev, "unable to get ws0 interrupt.\n");
> 		} else {
> 			sbsa_gwdt_keepalive(&gwdt->wdd);
> 			if (devm_request_irq(dev, irq, sbsa_gwdt_interrupt, 0,
> 					     pdev->name, gwdt)) {
> 				action = 0;
> 				dev_warn(dev, "unable to request IRQ %d.\n",
> 					 irq);
> 			}
> 		}
> 		if (!action)
> 			dev_warn(dev, "falling back to single stage mode.\n");
> 	}

In fact, I think you need to move the "if (action) {" block near the end 
of sbsa_gwdt_probe().  We don't want to enable the interrupt until the 
watchdog is fully initialized.

-- 
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora
Forum, a Linux Foundation collaborative project.

  parent reply	other threads:[~2016-02-26 19:27 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-16  8:36 [PATCH v12 0/4] Watchdog: introduce ARM SBSA watchdog driver fu.wei
2016-02-16  8:36 ` [PATCH v12 1/4] Documentation: add sbsa-gwdt driver documentation fu.wei
2016-02-16 15:30   ` Guenter Roeck
2016-02-16  8:36 ` [PATCH v12 2/4] ARM64: add SBSA Generic Watchdog device node in foundation-v8.dts fu.wei
2016-02-16 15:31   ` Guenter Roeck
2016-02-16  8:36 ` [PATCH v12 3/4] ARM64: add SBSA Generic Watchdog device node in amd-seattle-soc.dtsi fu.wei
2016-02-16 15:31   ` Guenter Roeck
2016-02-16  8:36 ` [PATCH v12 4/4] Watchdog: introduce ARM SBSA watchdog driver fu.wei
2016-02-16 15:29   ` Guenter Roeck
2016-02-16 15:54     ` Fu Wei
2016-02-16 16:33       ` Fu Wei
2016-02-17  0:09         ` Guenter Roeck
2016-02-26 19:27   ` Timur Tabi [this message]
     [not found]     ` <56D0A72B.8020100-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2016-02-28 14:01       ` Fu Wei

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56D0A72B.8020100@codeaurora.org \
    --to=timur@codeaurora.org \
    --cc=Suravee.Suthikulpanit@amd.com \
    --cc=al.stone@linaro.org \
    --cc=arnd@arndb.de \
    --cc=catalin.marinas@arm.com \
    --cc=corbet@lwn.net \
    --cc=cov@codeaurora.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dyoung@redhat.com \
    --cc=fu.wei@linaro.org \
    --cc=galak@codeaurora.org \
    --cc=graeme.gregory@linaro.org \
    --cc=hanjun.guo@linaro.org \
    --cc=harba@codeaurora.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=jcm@redhat.com \
    --cc=leo.duran@amd.com \
    --cc=linaro-acpi@lists.linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=mark.rutland@arm.com \
    --cc=panand@redhat.com \
    --cc=pawel.moll@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=rruigrok@codeaurora.org \
    --cc=sudeep.holla@arm.com \
    --cc=will.deacon@arm.com \
    --cc=wim@iguana.be \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).