diff for duplicates of <20131031063001.088351233@linux.com> diff --git a/a/1.txt b/N1/1.txt index 5eaae49..fa5276c 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -1,129 +1,3 @@ -From: Domenico Andreoli <domenico.andreoli@linux.com> - -Proof of concept: sp805 as provider of reset hooks. - -Cc: Russell King <linux@arm.linux.org.uk> -Cc: Arnd Bergmann <arnd@arndb.de> -Cc: Olof Johansson <olof@lixom.net> -Cc: Wim Van Sebroeck <wim@iguana.be> -Cc: linux-arm-kernel@lists.infradead.org -Signed-off-by: Domenico Andreoli <domenico.andreoli@linux.com> ---- - drivers/watchdog/Kconfig | 9 ++++++++ - drivers/watchdog/sp805_wdt.c | 48 +++++++++++++++++++++++++++++++++++++++++++ - 2 files changed, 57 insertions(+) - -Index: b/drivers/watchdog/Kconfig -=================================================================== ---- a/drivers/watchdog/Kconfig -+++ b/drivers/watchdog/Kconfig -@@ -110,11 +110,20 @@ config WM8350_WATCHDOG - config ARM_SP805_WATCHDOG - tristate "ARM SP805 Watchdog" - depends on ARM && ARM_AMBA -+ select MACHINE_RESET - select WATCHDOG_CORE - help - ARM Primecell SP805 Watchdog timer. This will reboot your system when - the timeout is reached. - -+config ARM_SP805_WATCHDOG_RESTART_HOOK -+ bool "ARM SP805 system restart hook" -+ depends on ARM_SP805_WATCHDOG -+ help -+ Register hook to reboot the system based on the SP805 Watchdog. -+ -+ This can be overriden with cmdline option restart_hook=0. -+ - config AT91RM9200_WATCHDOG - tristate "AT91RM9200 watchdog" - depends on ARCH_AT91RM9200 -Index: b/drivers/watchdog/sp805_wdt.c -=================================================================== ---- a/drivers/watchdog/sp805_wdt.c -+++ b/drivers/watchdog/sp805_wdt.c -@@ -28,6 +28,8 @@ - #include <linux/spinlock.h> - #include <linux/types.h> - #include <linux/watchdog.h> -+#include <linux/machine_reset.h> -+#include <linux/delay.h> - - /* default timeout in seconds */ - #define DEFAULT_TIMEOUT 60 -@@ -77,6 +79,11 @@ module_param(nowayout, bool, 0); - MODULE_PARM_DESC(nowayout, - "Set to 1 to keep watchdog running after device release"); - -+static bool restart_hook = IS_ENABLED(CONFIG_ARM_SP805_WATCHDOG_RESTART_HOOK); -+module_param(restart_hook, bool, 0); -+MODULE_PARM_DESC(restart_hook, -+ "Set to 1 to install a machine restart handler based on this watchdog"); -+ - /* This routine finds load value that will reset system in required timout */ - static int wdt_setload(struct watchdog_device *wdd, unsigned int timeout) - { -@@ -189,6 +196,33 @@ static int wdt_disable(struct watchdog_d - return 0; - } - -+/* trigger watchdog timer */ -+static void wdt_atomic_trigger(struct watchdog_device *wdd) -+{ -+ struct sp805_wdt *wdt = watchdog_get_drvdata(wdd); -+ -+ spin_lock(&wdt->lock); -+ -+ writel_relaxed(UNLOCK, wdt->base + WDTLOCK); -+ writel_relaxed(0, wdt->base + WDTCONTROL); -+ udelay(20); -+ writel_relaxed(INT_MASK, wdt->base + WDTINTCLR); -+ udelay(20); -+ -+ /* Expire after 5 cycles */ -+ writel_relaxed(5, wdt->base + WDTLOAD); -+ -+ writel_relaxed(INT_ENABLE | RESET_ENABLE, wdt->base + WDTCONTROL); -+ writel_relaxed(LOCK, wdt->base + WDTLOCK); -+ -+ /* Flush posted writes. */ -+ readl_relaxed(wdt->base + WDTLOCK); -+ spin_unlock(&wdt->lock); -+ -+ /* Wait the bite */ -+ udelay(400); -+} -+ - static const struct watchdog_info wdt_info = { - .options = WDIOF_MAGICCLOSE | WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING, - .identity = MODULE_NAME, -@@ -201,8 +235,15 @@ static const struct watchdog_ops wdt_ops - .ping = wdt_ping, - .set_timeout = wdt_setload, - .get_timeleft = wdt_timeleft, -+/* .atomic_trigger = wdt_atomic_trigger, */ - }; - -+static void sp805_wdt_machine_restart(void *wdd, enum reboot_mode mode, -+ const char *cmd) -+{ -+ wdt_atomic_trigger(wdd); -+} -+ - static int - sp805_wdt_probe(struct amba_device *adev, const struct amba_id *id) - { -@@ -247,6 +288,13 @@ sp805_wdt_probe(struct amba_device *adev - watchdog_set_drvdata(&wdt->wdd, wdt); - wdt_setload(&wdt->wdd, DEFAULT_TIMEOUT); - -+ if (restart_hook) { -+ struct reset_hook hook; -+ reset_hook_init(&hook); -+ hook.restart = sp805_wdt_machine_restart; -+ set_machine_reset(RESET_RESTART, &hook, &wdt->wdd); -+ } -+ - ret = watchdog_register_device(&wdt->wdd); - if (ret) { - dev_err(&adev->dev, "watchdog_register_device() failed: %d\n", +An embedded and charset-unspecified text was scrubbed... +Name: sp805-machine-reset.patch +URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20131031/b02aec4d/attachment.ksh> diff --git a/a/content_digest b/N1/content_digest index a4db816..7a94b17 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -1,147 +1,12 @@ "ref\020131031062708.520968323@linux.com\0" - "From\0Domenico Andreoli <domenico.andreoli@linux.com>\0" + "From\0domenico.andreoli@linux.com (Domenico Andreoli)\0" "Subject\0[PATCH 11/11] ARM: sp805: use the common machine reset handling\0" "Date\0Thu, 31 Oct 2013 07:27:19 +0100\0" - "To\0linux-arch@vger.kernel.org\0" - "Cc\0linux-arm-kernel@lists.infradead.org" - linux-mips@lvger.kernel.org - Russell King <linux@arm.linux.org.uk> - Arnd Bergmann <arnd@arndb.de> - Olof Johansson <olof@lixom.net> - Ralf Baechle <ralf@linux-mips.org> - Wim Van Sebroeck <wim@iguana.be> - " Domenico Andreoli <domenico.andreoli@linux.com>\0" + "To\0linux-arm-kernel@lists.infradead.org\0" "\00:1\0" - "fn\0sp805-machine-reset.patch\0" "b\0" - "From: Domenico Andreoli <domenico.andreoli@linux.com>\n" - "\n" - "Proof of concept: sp805 as provider of reset hooks.\n" - "\n" - "Cc: Russell King <linux@arm.linux.org.uk>\n" - "Cc: Arnd Bergmann <arnd@arndb.de>\n" - "Cc: Olof Johansson <olof@lixom.net>\n" - "Cc: Wim Van Sebroeck <wim@iguana.be>\n" - "Cc: linux-arm-kernel@lists.infradead.org\n" - "Signed-off-by: Domenico Andreoli <domenico.andreoli@linux.com>\n" - "---\n" - " drivers/watchdog/Kconfig | 9 ++++++++\n" - " drivers/watchdog/sp805_wdt.c | 48 +++++++++++++++++++++++++++++++++++++++++++\n" - " 2 files changed, 57 insertions(+)\n" - "\n" - "Index: b/drivers/watchdog/Kconfig\n" - "===================================================================\n" - "--- a/drivers/watchdog/Kconfig\n" - "+++ b/drivers/watchdog/Kconfig\n" - "@@ -110,11 +110,20 @@ config WM8350_WATCHDOG\n" - " config ARM_SP805_WATCHDOG\n" - " \ttristate \"ARM SP805 Watchdog\"\n" - " \tdepends on ARM && ARM_AMBA\n" - "+\tselect MACHINE_RESET\n" - " \tselect WATCHDOG_CORE\n" - " \thelp\n" - " \t ARM Primecell SP805 Watchdog timer. This will reboot your system when\n" - " \t the timeout is reached.\n" - " \n" - "+config ARM_SP805_WATCHDOG_RESTART_HOOK\n" - "+\tbool \"ARM SP805 system restart hook\"\n" - "+\tdepends on ARM_SP805_WATCHDOG\n" - "+\thelp\n" - "+\t Register hook to reboot the system based on the SP805 Watchdog.\n" - "+\n" - "+\t This can be overriden with cmdline option restart_hook=0.\n" - "+\n" - " config AT91RM9200_WATCHDOG\n" - " \ttristate \"AT91RM9200 watchdog\"\n" - " \tdepends on ARCH_AT91RM9200\n" - "Index: b/drivers/watchdog/sp805_wdt.c\n" - "===================================================================\n" - "--- a/drivers/watchdog/sp805_wdt.c\n" - "+++ b/drivers/watchdog/sp805_wdt.c\n" - "@@ -28,6 +28,8 @@\n" - " #include <linux/spinlock.h>\n" - " #include <linux/types.h>\n" - " #include <linux/watchdog.h>\n" - "+#include <linux/machine_reset.h>\n" - "+#include <linux/delay.h>\n" - " \n" - " /* default timeout in seconds */\n" - " #define DEFAULT_TIMEOUT\t\t60\n" - "@@ -77,6 +79,11 @@ module_param(nowayout, bool, 0);\n" - " MODULE_PARM_DESC(nowayout,\n" - " \t\t\"Set to 1 to keep watchdog running after device release\");\n" - " \n" - "+static bool restart_hook = IS_ENABLED(CONFIG_ARM_SP805_WATCHDOG_RESTART_HOOK);\n" - "+module_param(restart_hook, bool, 0);\n" - "+MODULE_PARM_DESC(restart_hook,\n" - "+\t\t\"Set to 1 to install a machine restart handler based on this watchdog\");\n" - "+\n" - " /* This routine finds load value that will reset system in required timout */\n" - " static int wdt_setload(struct watchdog_device *wdd, unsigned int timeout)\n" - " {\n" - "@@ -189,6 +196,33 @@ static int wdt_disable(struct watchdog_d\n" - " \treturn 0;\n" - " }\n" - " \n" - "+/* trigger watchdog timer */\n" - "+static void wdt_atomic_trigger(struct watchdog_device *wdd)\n" - "+{\n" - "+\tstruct sp805_wdt *wdt = watchdog_get_drvdata(wdd);\n" - "+\n" - "+\tspin_lock(&wdt->lock);\n" - "+\n" - "+\twritel_relaxed(UNLOCK, wdt->base + WDTLOCK);\n" - "+\twritel_relaxed(0, wdt->base + WDTCONTROL);\n" - "+\tudelay(20);\n" - "+\twritel_relaxed(INT_MASK, wdt->base + WDTINTCLR);\n" - "+\tudelay(20);\n" - "+\n" - "+\t/* Expire after 5 cycles */\n" - "+\twritel_relaxed(5, wdt->base + WDTLOAD);\n" - "+\n" - "+\twritel_relaxed(INT_ENABLE | RESET_ENABLE, wdt->base + WDTCONTROL);\n" - "+\twritel_relaxed(LOCK, wdt->base + WDTLOCK);\n" - "+\n" - "+\t/* Flush posted writes. */\n" - "+\treadl_relaxed(wdt->base + WDTLOCK);\n" - "+\tspin_unlock(&wdt->lock);\n" - "+\n" - "+\t/* Wait the bite */\n" - "+\tudelay(400);\n" - "+}\n" - "+\n" - " static const struct watchdog_info wdt_info = {\n" - " \t.options = WDIOF_MAGICCLOSE | WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING,\n" - " \t.identity = MODULE_NAME,\n" - "@@ -201,8 +235,15 @@ static const struct watchdog_ops wdt_ops\n" - " \t.ping\t\t= wdt_ping,\n" - " \t.set_timeout\t= wdt_setload,\n" - " \t.get_timeleft\t= wdt_timeleft,\n" - "+/*\t.atomic_trigger\t= wdt_atomic_trigger, */\n" - " };\n" - " \n" - "+static void sp805_wdt_machine_restart(void *wdd, enum reboot_mode mode,\n" - "+\tconst char *cmd)\n" - "+{\n" - "+\twdt_atomic_trigger(wdd);\n" - "+}\n" - "+\n" - " static int\n" - " sp805_wdt_probe(struct amba_device *adev, const struct amba_id *id)\n" - " {\n" - "@@ -247,6 +288,13 @@ sp805_wdt_probe(struct amba_device *adev\n" - " \twatchdog_set_drvdata(&wdt->wdd, wdt);\n" - " \twdt_setload(&wdt->wdd, DEFAULT_TIMEOUT);\n" - " \n" - "+\tif (restart_hook) {\n" - "+\t\tstruct reset_hook hook;\n" - "+\t\treset_hook_init(&hook);\n" - "+\t\thook.restart = sp805_wdt_machine_restart;\n" - "+\t\tset_machine_reset(RESET_RESTART, &hook, &wdt->wdd);\n" - "+\t}\n" - "+\n" - " \tret = watchdog_register_device(&wdt->wdd);\n" - " \tif (ret) {\n" - " \t\tdev_err(&adev->dev, \"watchdog_register_device() failed: %d\\n\"," + "An embedded and charset-unspecified text was scrubbed...\n" + "Name: sp805-machine-reset.patch\n" + URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20131031/b02aec4d/attachment.ksh> -e50b8d5a1fb6214d174b84c4c68b9fe3cfd46e6671a8344d9b21858ef777906d +1aab3eca0f524f8f98aa8660e42b32355ad6472b6fb2a57de497a52a44fd61d1
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.