Linux-Watchdog Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 1/3] watchdog: qcom-wdt: add option to skip pretimeout
@ 2020-02-04 15:21 Ansuel Smith
  2020-02-04 15:21 ` [PATCH 2/3] Documentation: watchdog: qcom-wdt: Remove deprecated compatible Ansuel Smith
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Ansuel Smith @ 2020-02-04 15:21 UTC (permalink / raw)
  Cc: Ansuel Smith, Andy Gross, Bjorn Andersson, Wim Van Sebroeck,
	Guenter Roeck, Rob Herring, Mark Rutland, linux-arm-msm,
	linux-watchdog, devicetree, linux-kernel

Some platform like ipq806x doesn't support pretimeout.
As the driver check if there are available interrupts and ipq806x
use msm-timer that require interrupts, the watchdog fail to probe
as request_irq tries to use a ppi interrupt. Add an option to skip
pretimeout setup and use the normal watchdog probe.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
---
 drivers/watchdog/qcom-wdt.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/watchdog/qcom-wdt.c b/drivers/watchdog/qcom-wdt.c
index a494543d3ae1..e689e97e883e 100644
--- a/drivers/watchdog/qcom-wdt.c
+++ b/drivers/watchdog/qcom-wdt.c
@@ -189,6 +189,7 @@ static int qcom_wdt_probe(struct platform_device *pdev)
 	u32 percpu_offset;
 	int irq, ret;
 	struct clk *clk;
+	bool nopretimeout;
 
 	regs = of_device_get_match_data(dev);
 	if (!regs) {
@@ -204,6 +205,8 @@ static int qcom_wdt_probe(struct platform_device *pdev)
 	if (!res)
 		return -ENOMEM;
 
+	nopretimeout = of_property_read_bool(np, "no-pretimeout");
+
 	/* We use CPU0's DGT for the watchdog */
 	if (of_property_read_u32(np, "cpu-offset", &percpu_offset))
 		percpu_offset = 0;
@@ -247,7 +250,7 @@ static int qcom_wdt_probe(struct platform_device *pdev)
 
 	/* check if there is pretimeout support */
 	irq = platform_get_irq(pdev, 0);
-	if (irq > 0) {
+	if (!nopretimeout && irq > 0) {
 		ret = devm_request_irq(dev, irq, qcom_wdt_isr,
 				       IRQF_TRIGGER_RISING,
 				       "wdt_bark", &wdt->wdd);
-- 
2.24.0


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, back to index

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-04 15:21 [PATCH 1/3] watchdog: qcom-wdt: add option to skip pretimeout Ansuel Smith
2020-02-04 15:21 ` [PATCH 2/3] Documentation: watchdog: qcom-wdt: Remove deprecated compatible Ansuel Smith
2020-02-04 16:09   ` Guenter Roeck
2020-02-06 19:15     ` Rob Herring
2020-02-04 15:21 ` [PATCH 3/3] Documentation: watchdog: qcom-wdt: add new no-pretimeout option Ansuel Smith
2020-02-04 16:11   ` Guenter Roeck
2020-02-04 16:08 ` [PATCH 1/3] watchdog: qcom-wdt: add option to skip pretimeout Guenter Roeck
2020-02-04 16:16   ` R: " ansuelsmth
2020-02-04 16:25     ` Guenter Roeck
2020-02-04 17:30       ` R: " ansuelsmth
2020-02-04 17:37         ` Guenter Roeck

Linux-Watchdog Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-watchdog/0 linux-watchdog/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-watchdog linux-watchdog/ https://lore.kernel.org/linux-watchdog \
		linux-watchdog@vger.kernel.org
	public-inbox-index linux-watchdog

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-watchdog


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git