[LEDE-DEV] [PATCH] cns3xxx: restore mpcore watchdog
tharvey at gateworks.com
Mon Jan 16 13:37:09 PST 2017
On Tue, Jan 10, 2017 at 5:34 AM, Koen Vandeputte
<koen.vandeputte at ncentric.com> wrote:
> Adds the mpcore watchdog driver for kernel 4.4 as it was originally
> present up to kernel 3.12
> - Disabled by default for now, but can be simply enabled in kernelconfig
> - Currently does not contain the latest patches as mentioned here:
Thanks for submitting this - I agree with Felix that we should add
back the functionality if possible.
The issue mentioned in the commit which removed the driver from
mainline linux  regarding 'Nothing ensures the userspace ioctl()
will end-up kicking the watchdog on the right CPU.' is addressed by
the fact that the watchdog register base defined in laguna.c  as
the register 'CNS3XXX_TC11MP_TWD_BASE + 0x100' always points to the
CPU0 watchdog as opposed to CNS3XXX_TC11MP_TWD_BASE which would be
aliased to the watchdog of whatever CPU core the process is running.
However, I found after a bit of digging I found that this mainline
driver requires other patches to make the watchdog reliable which
apparently never got accepted upstream    . While these
patches were apparently never accepted upstream they were in the
OpenWrt git repo for the 3.10 kernel and below and not surprisingly
got removed when the kernel bumped past 3.10. These patches also need
to be re-added (at least definitely ) as without them you'll find
that the timer count is too large and the watchdog will unexpectedly
trip typically within a matter of several minutes.
With these additional patches added I would say that we should also
enable the watchdog in the kernel config.
How do you want to proceed? I could ack your patch (as it adds the
base driver back from mainline but doesn't enable it) then followup
with a patch that adds back the additional patches (to
target/platform/cns3xxx unless there are other targets that use the
arm11mpcore processor and want the twd fixes?) and enables the
watchdog kernel driver. Note that the patches affect other files so we
can't simply merge them all into the files directory.
More information about the Lede-dev