[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5605e7b7a0f540a7908a1eb5191bbe5e@svr-chch-ex1.atlnz.lc>
Date: Tue, 5 Mar 2019 01:26:08 +0000
From: Chris Packham <Chris.Packham@...iedtelesis.co.nz>
To: Andrew Lunn <andrew@...n.ch>
CC: "linux@...ck-us.net" <linux@...ck-us.net>,
"gregory.clement@...tlin.com" <gregory.clement@...tlin.com>,
"jason@...edaemon.net" <jason@...edaemon.net>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"linux-watchdog@...r.kernel.org" <linux-watchdog@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Sebastian Hesselbarth <sebastian.hesselbarth@...il.com>,
Rob Herring <robh+dt@...nel.org>,
"Mark Rutland" <mark.rutland@....com>,
Wim Van Sebroeck <wim@...ux-watchdog.org>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>
Subject: Re: [PATCH 2/2] watchdog: orion_wdt: use timer1 as a pretimeout
On 5/03/19 1:57 PM, Andrew Lunn wrote:
> On Tue, Mar 05, 2019 at 11:51:52AM +1300, Chris Packham wrote:
>> The orion watchdog can either reset the CPU or generate an interrupt.
>> The interrupt would be useful for debugging as it provides panic()
>> output about the watchdog expiry, however if the interrupt is used the
>> watchdog can't reset the CPU in the event of being stuck in a loop with
>> interrupts disabled or if the CPU is prevented from accessing memory
>> (e.g. an unterminated DMA).
>>
>> All of the orion based CPU cores (at least back as far as Kirkwood) have
>> spare timers that aren't currently used by the Linux kernel.
Actually this appears to be incorrect Kirkwood does configure timer1 as
a clockevent timer. So I can't just grab timer1 for all platforms.
>> We can use
>> timer1 to provide a pre-timeout ahead of the watchdog timer and provide
>> the possibility of gathering debug before the reset triggers.
>
> Hi Chris
>
> I had a quick look at other drivers implementing pre-timeout. They
> seem to call watchdog_notify_pretimeout(). I don't see that here? What
> happens when timer1 fires?
>
It invokes the regular orion_wdt_irq(). On Armada-385 prior to this
change the irq was not specified because the reset always kicked in so
there was no point.
For correctness I could make the devicetree binding specify 2
interrupts. One for the regular watchdog interrupt (which would never
usually get hit because the reset would kick in) and one for the
pretimeout/timer1.
>> @@ -169,38 +174,46 @@ static int armadaxp_wdt_clock_init(struct platform_device *pdev,
>> }
>>
>> /* Enable the fixed watchdog clock input */
>> - atomic_io_modify(dev->reg + TIMER_CTRL,
>> - WDT_AXP_FIXED_ENABLE_BIT,
>> - WDT_AXP_FIXED_ENABLE_BIT);
>> + val = WDT_AXP_FIXED_ENABLE_BIT | TIMER1_FIXED_ENABLE_BIT;
>> + atomic_io_modify(dev->reg + TIMER_CTRL, val, val);
>>
>> dev->clk_rate = clk_get_rate(dev->clk);
>> +
>> +
>
> One blank line is sufficient,
>
>
>> return 0;
>> }
>
> Andrew
>
Powered by blists - more mailing lists