Linux-Watchdog Archive on lore.kernel.org
 help / color / Atom feed
From: <ansuelsmth@gmail.com>
To: "'Guenter Roeck'" <linux@roeck-us.net>
Cc: "'Andy Gross'" <agross@kernel.org>,
	"'Bjorn Andersson'" <bjorn.andersson@linaro.org>,
	"'Wim Van Sebroeck'" <wim@linux-watchdog.org>,
	"'Rob Herring'" <robh+dt@kernel.org>,
	"'Mark Rutland'" <mark.rutland@arm.com>,
	<linux-arm-msm@vger.kernel.org>, <linux-watchdog@vger.kernel.org>,
	<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: R: R: [PATCH 1/3] watchdog: qcom-wdt: add option to skip pretimeout
Date: Tue, 4 Feb 2020 18:30:40 +0100
Message-ID: <035f01d5db80$d2ed1fb0$78c75f10$@gmail.com> (raw)
In-Reply-To: <20200204162516.GA22814@roeck-us.net>

> On Tue, Feb 04, 2020 at 05:16:34PM +0100, ansuelsmth@gmail.com wrote:
> > If something like this is used, msm-timer require interrupts. Without
this
> > configuration, the device is unbootable as the system froze on system
> > bootup.
> >
> > timer@200a000 {
> > 			compatible = "qcom,kpss-timer", "qcom,msm-timer";
> > 			interrupts = <GIC_PPI 1 (GIC_CPU_MASK_SIMPLE(2) |
> > 						 IRQ_TYPE_EDGE_RISING)>,
> > 				     <GIC_PPI 2 (GIC_CPU_MASK_SIMPLE(2) |
> > 						 IRQ_TYPE_EDGE_RISING)>,
> > 				     <GIC_PPI 3 (GIC_CPU_MASK_SIMPLE(2) |
> > 						 IRQ_TYPE_EDGE_RISING)>,
> > 				     <GIC_PPI 4 (GIC_CPU_MASK_SIMPLE(2) |
> > 						 IRQ_TYPE_EDGE_RISING)>,
> > 				     <GIC_PPI 5 (GIC_CPU_MASK_SIMPLE(2) |
> > 						 IRQ_TYPE_EDGE_RISING)>;
> > 			no-pretimeout;
> > 			reg = <0x0200a000 0x100>;
> > 			clock-frequency = <25000000>,
> > 					  <32768>;
> > 			clocks = <&sleep_clk>;
> > 			clock-names = "sleep";
> > 			cpu-offset = <0x80000>;
> > 		};
> >
> 
> I think this is all wrong; the new property shows up in a node which
> is completely unrelated to a watchdog. Maybe it wasn't such a good idea
> to tie the watchdog to the timer node. At the very least, the situation
> should be handled in the driver via of_table flags. If the situation can't
> be handled that way, something is even more wrong. In that case it might
> be better to revert commit 36375491a439 until that is sorted out properly.
> 
> Guenter
> 

So pretimeout should be enabled only for kpss-wdt and disabled with a flag 
in the of_table of the driver?

> > > On Tue, Feb 04, 2020 at 04:21:01PM +0100, Ansuel Smith wrote:
> > > > 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) {
> > >
> > > That is unnecessary; such platforms should simply not provide an
> > interrupt.
> > > Or, in other words, what is the point of assigning an interrupt to be
used
> > > for pretimeout if the platform doesn't support it ? And then to add
yet
> > > another attribute to tell the driver not to use it ?
> > >
> > > Guenter
> > >
> > > >  		ret = devm_request_irq(dev, irq, qcom_wdt_isr,
> > > >  				       IRQF_TRIGGER_RISING,
> > > >  				       "wdt_bark", &wdt->wdd);
> > > > --
> > > > 2.24.0
> > > >
> >


  reply index

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-04 15:21 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       ` ansuelsmth [this message]
2020-02-04 17:37         ` R: " Guenter Roeck

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='035f01d5db80$d2ed1fb0$78c75f10$@gmail.com' \
    --to=ansuelsmth@gmail.com \
    --cc=agross@kernel.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-arm-msm@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=robh+dt@kernel.org \
    --cc=wim@linux-watchdog.org \
    /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

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