* Re: [RFC 0/5] r8a7790: lager: add support for RCLK watchdog
2015-02-01 14:47 [RFC 0/5] r8a7790: lager: add support for RCLK watchdog Wolfram Sang
@ 2015-02-02 9:32 ` Geert Uytterhoeven
2015-02-02 11:24 ` Wolfram Sang
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2015-02-02 9:32 UTC (permalink / raw)
To: linux-sh
Hi Wolfram,
On Sun, Feb 1, 2015 at 3:47 PM, Wolfram Sang <wsa@the-dreams.de> wrote:
> I needed a watchdog for my lager board to deploy some long-term tests. Also, a
> working reboot command is so convenient :) I saw the DA9063 work from Geert
> which seems to suffer from an unsolved mystery still. So, I took the liberty to
> hack a driver for the RCLK watchdog. It works fine for me on my Lager board. I
> will add support for the other RCar SoC in the next round, they are all the
> same (according to docs, at least). Then, I'll also add binding documentation.
> This is a "release early" series, so you can already comment if you wish. For
> that reason, the watchdog list is not yet on CC. So, test if you like and
> comment.
Thanks for your series!
Before I started using the DA9063, I did try the RWDT, but I could only get it
to work for CONFIG_SMP=n kernels. With CONFIG_SMP=y, the system locks up
instead of restarting. I played a bit with the various RST registers, but to
no avail. Hence I went with the DA9063 instead. Note that I plan to look into
the DA9063 interrupt storm issue soon.
I've just tried your series on Koelsch, and it suffers from the same problem.
Does it work on Lager for both CONFIG_SMP=y and CONFIG_SMP=n?
From the limited information available about the SWDT, it may be compatible
with the RWDT. Or not. U-Boot disables both the RWDT and the SWDT on startup,
using identical operations.
The RWDT exists on various shmobile SoCs.
From digging into the datasheets, I had discovered two variants:
1. 32-bit registers
a. R-Car Gen2: using RST for restarting
b. R-Mobile APE6: using SYSC for restarting
2. 8-bit registers (SH-Mobile AP4/AG5, R-Mobile A1)
The differences are small: the variant with 8-bit registers has a smaller
maximum timeout, and no magic value to be stored in the upper bits.
Have fun!
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [RFC 0/5] r8a7790: lager: add support for RCLK watchdog
2015-02-01 14:47 [RFC 0/5] r8a7790: lager: add support for RCLK watchdog Wolfram Sang
2015-02-02 9:32 ` Geert Uytterhoeven
@ 2015-02-02 11:24 ` Wolfram Sang
2015-02-02 11:50 ` Geert Uytterhoeven
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Wolfram Sang @ 2015-02-02 11:24 UTC (permalink / raw)
To: linux-sh
[-- Attachment #1: Type: text/plain, Size: 1670 bytes --]
Geert,
> Thanks for your series!
And thanks for your input!
> no avail. Hence I went with the DA9063 instead. Note that I plan to look into
> the DA9063 interrupt storm issue soon.
Cool.
> I've just tried your series on Koelsch, and it suffers from the same problem.
> Does it work on Lager for both CONFIG_SMP=y and CONFIG_SMP=n?
I didn't. And what a surprise, it fails with SMP=y :( I'll having a
look...
> From the limited information available about the SWDT, it may be compatible
> with the RWDT. Or not. U-Boot disables both the RWDT and the SWDT on startup,
> using identical operations.
Well, the block diagram looks the same, the register layout in U-Boot
looks the same. And the bits I use are easy to be verified once I know
the IP core is there. Good enough, I'd say. And maybe we get
confirmation from the HW team via Morimoto-san.
> The RWDT exists on various shmobile SoCs.
> From digging into the datasheets, I had discovered two variants:
> 1. 32-bit registers
> a. R-Car Gen2: using RST for restarting
> b. R-Mobile APE6: using SYSC for restarting
Those should be handled with this driver.
> 2. 8-bit registers (SH-Mobile AP4/AG5, R-Mobile A1)
>
> The differences are small: the variant with 8-bit registers has a smaller
> maximum timeout, and no magic value to be stored in the upper bits.
Do they also have 32kHz as input clock? Then they do need a ping every
8ms! Those should use the shwdt driver then which pings the device
frequently and runs a software watchdog on top to cope with the usual
watchdog granularity which is in the second range.
Thanks,
Wolfram
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [RFC 0/5] r8a7790: lager: add support for RCLK watchdog
2015-02-01 14:47 [RFC 0/5] r8a7790: lager: add support for RCLK watchdog Wolfram Sang
2015-02-02 9:32 ` Geert Uytterhoeven
2015-02-02 11:24 ` Wolfram Sang
@ 2015-02-02 11:50 ` Geert Uytterhoeven
2015-02-03 19:04 ` Wolfram Sang
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2015-02-02 11:50 UTC (permalink / raw)
To: linux-sh
Hi Wolfram,
On Mon, Feb 2, 2015 at 12:24 PM, Wolfram Sang <wsa@the-dreams.de> wrote:
>> I've just tried your series on Koelsch, and it suffers from the same problem.
>> Does it work on Lager for both CONFIG_SMP=y and CONFIG_SMP=n?
>
> I didn't. And what a surprise, it fails with SMP=y :( I'll having a
> look...
Good luck!
>> The differences are small: the variant with 8-bit registers has a smaller
>> maximum timeout, and no magic value to be stored in the upper bits.
>
> Do they also have 32kHz as input clock? Then they do need a ping every
> 8ms! Those should use the shwdt driver then which pings the device
> frequently and runs a software watchdog on top to cope with the usual
> watchdog granularity which is in the second range.
Yes, 32 kHz. But you still have the Clock Select and Expanded Clock Select
bits to increase the timeout.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [RFC 0/5] r8a7790: lager: add support for RCLK watchdog
2015-02-01 14:47 [RFC 0/5] r8a7790: lager: add support for RCLK watchdog Wolfram Sang
` (2 preceding siblings ...)
2015-02-02 11:50 ` Geert Uytterhoeven
@ 2015-02-03 19:04 ` Wolfram Sang
2015-02-03 19:49 ` Geert Uytterhoeven
2015-02-03 20:11 ` Wolfram Sang
5 siblings, 0 replies; 7+ messages in thread
From: Wolfram Sang @ 2015-02-03 19:04 UTC (permalink / raw)
To: linux-sh
[-- Attachment #1: Type: text/plain, Size: 1064 bytes --]
On Mon, Feb 02, 2015 at 12:50:24PM +0100, Geert Uytterhoeven wrote:
> Hi Wolfram,
>
> On Mon, Feb 2, 2015 at 12:24 PM, Wolfram Sang <wsa@the-dreams.de> wrote:
> >> I've just tried your series on Koelsch, and it suffers from the same problem.
> >> Does it work on Lager for both CONFIG_SMP=y and CONFIG_SMP=n?
> >
> > I didn't. And what a surprise, it fails with SMP=y :( I'll having a
> > look...
>
> Good luck!
Weelllll....
I think there are multiple issues and they mostly come from the fact
that a watchdog reset does not initialize the RST module. Rebooting even
fails when I only use CPU0 with SMP=y. I could fix this very hackish by
resetting the A15 boot address (CA15BAR) to the default value in the
watchdog probe function. That alone sadly doesn't help. Once I activate
the other CPUs, it will still lock up.
Pity, but before I get too side-tracked from what I originally wanted to
do, it seems that I simply have to run my tests with SMP=n. I guess this
also renders the watchdog driver pretty useless for upstream now :(
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [RFC 0/5] r8a7790: lager: add support for RCLK watchdog
2015-02-01 14:47 [RFC 0/5] r8a7790: lager: add support for RCLK watchdog Wolfram Sang
` (3 preceding siblings ...)
2015-02-03 19:04 ` Wolfram Sang
@ 2015-02-03 19:49 ` Geert Uytterhoeven
2015-02-03 20:11 ` Wolfram Sang
5 siblings, 0 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2015-02-03 19:49 UTC (permalink / raw)
To: linux-sh
Hi Wolfram,
On Tue, Feb 3, 2015 at 8:04 PM, Wolfram Sang <wsa@the-dreams.de> wrote:
> On Mon, Feb 02, 2015 at 12:50:24PM +0100, Geert Uytterhoeven wrote:
>> Hi Wolfram,
>>
>> On Mon, Feb 2, 2015 at 12:24 PM, Wolfram Sang <wsa@the-dreams.de> wrote:
>> >> I've just tried your series on Koelsch, and it suffers from the same problem.
>> >> Does it work on Lager for both CONFIG_SMP=y and CONFIG_SMP=n?
>> >
>> > I didn't. And what a surprise, it fails with SMP=y :( I'll having a
>> > look...
>>
>> Good luck!
>
> Weelllll....
>
> I think there are multiple issues and they mostly come from the fact
> that a watchdog reset does not initialize the RST module. Rebooting even
> fails when I only use CPU0 with SMP=y. I could fix this very hackish by
> resetting the A15 boot address (CA15BAR) to the default value in the
> watchdog probe function. That alone sadly doesn't help. Once I activate
> the other CPUs, it will still lock up.
>
> Pity, but before I get too side-tracked from what I originally wanted to
> do, it seems that I simply have to run my tests with SMP=n. I guess this
> also renders the watchdog driver pretty useless for upstream now :(
Indeed. Unfortunately your findings are 100% in-line with mine.
Thanks for confirming!
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [RFC 0/5] r8a7790: lager: add support for RCLK watchdog
2015-02-01 14:47 [RFC 0/5] r8a7790: lager: add support for RCLK watchdog Wolfram Sang
` (4 preceding siblings ...)
2015-02-03 19:49 ` Geert Uytterhoeven
@ 2015-02-03 20:11 ` Wolfram Sang
5 siblings, 0 replies; 7+ messages in thread
From: Wolfram Sang @ 2015-02-03 20:11 UTC (permalink / raw)
To: linux-sh
[-- Attachment #1: Type: text/plain, Size: 126 bytes --]
> Indeed. Unfortunately your findings are 100% in-line with mine.
Were your findings available somewhere? I missed them :(
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread