summaryrefslogtreecommitdiff
path: root/drivers/watchdog/imx_sc_wdt.c
AgeCommit message (Collapse)Author
2021-06-21watchdog: imx_sc_wdt: fix pretimeoutStefan Eichenberger
If the WDIOF_PRETIMEOUT flag is not set when registering the device the driver will not show the sysfs entries or register the default governor. By moving the registering after the decision whether pretimeout is supported this gets fixed. Signed-off-by: Stefan Eichenberger <eichest@gmail.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Dong Aisheng <aisheng.dong@nxp.com> Link: https://lore.kernel.org/r/20210519080311.142928-1-eichest@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2020-05-25watchdog: imx_sc_wdt: Fix reboot on crashFabio Estevam
Currently when running the samples/watchdog/watchdog-simple.c application and forcing a kernel crash by doing: # ./watchdog-simple & # echo c > /proc/sysrq-trigger The system does not reboot as expected. Fix it by calling imx_sc_wdt_set_timeout() to configure the i.MX8QXP watchdog with a proper timeout. Cc: <stable@vger.kernel.org> Fixes: 986857acbc9a ("watchdog: imx_sc: Add i.MX system controller watchdog support") Reported-by: Breno Lima <breno.lima@nxp.com> Signed-off-by: Fabio Estevam <festevam@gmail.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Tested-by: Breno Lima <breno.lima@nxp.com> Link: https://lore.kernel.org/r/20200412230122.5601-1-festevam@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2020-03-18watchdog: imx_sc_wdt: Remove unused includesAnson Huang
There is nothing in use from init.h/reboot.h, remove them. Signed-off-by: Anson Huang <Anson.Huang@nxp.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/1582250430-8872-1-git-send-email-Anson.Huang@nxp.com Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2019-11-05watchdog: imx_sc_wdt: Pretimeout should follow SCU firmware formatAnson Huang
SCU firmware calculates pretimeout based on current time stamp instead of watchdog timeout stamp, need to convert the pretimeout to SCU firmware's timeout value. Fixes: 15f7d7fc5542 ("watchdog: imx_sc: Add pretimeout support") Signed-off-by: Anson Huang <Anson.Huang@nxp.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2019-09-17watchdog: imx_sc: this patch just fixes whitespacesOliver Graute
Fix only whitespace errors in imx_sc_wdt_probe() Signed-off-by: Oliver Graute <oliver.graute@kococonnector.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20190905143644.20952-1-oliver.graute@kococonnector.com Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2019-09-17watchdog: imx_sc: Remove unnecessary error logAnson Huang
An error message is already displayed by watchdog_register_device() when failed, so no need to have error log again for failure of calling devm_watchdog_register_device(). Signed-off-by: Anson Huang <Anson.Huang@nxp.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20190812084434.13316-1-Anson.Huang@nxp.com Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2019-07-08watchdog: imx_sc: Add pretimeout supportAnson Huang
i.MX system controller watchdog can support pretimeout IRQ via general SCU MU IRQ, it depends on IMX_SCU and driver MUST be probed after SCU IPC ready, then enable corresponding SCU IRQ group and register SCU IRQ notifier, when watchdog pretimeout IRQ fires, SCU MU IRQ will be handled and watchdog pretimeout notifier will be called to handle the event. Signed-off-by: Anson Huang <Anson.Huang@nxp.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2019-07-08watchdog: imx_sc_wdt: drop warning after registering deviceWolfram Sang
The core will print out details now. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2019-05-05watchdog: imx_sc_wdt: drop warning after calling watchdog_init_timeoutWolfram Sang
The core will print out details now. Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2019-05-05watchdog: imx_sc_wdt: Use 'dev' instead of dereferencing it repeatedlyGuenter Roeck
Introduce local variable 'struct device *dev' and use it instead of dereferencing it repeatedly. The conversion was done automatically with coccinelle using the following semantic patches. The semantic patches and the scripts used to generate this commit log are available at https://github.com/groeck/coccinelle-patches Cc: Shawn Guo <shawnguo@kernel.org> Cc: Sascha Hauer <s.hauer@pengutronix.de> Cc: Pengutronix Kernel Team <kernel@pengutronix.de> Cc: Fabio Estevam <festevam@gmail.com> Cc: NXP Linux Team <linux-imx@nxp.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Shawn Guo <shawnguo@kernel.org> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2019-05-05watchdog: imx_sc: Add i.MX system controller watchdog supportAnson Huang
i.MX8QXP is an ARMv8 SoC which has a Cortex-M4 system controller inside, the system controller is in charge of controlling power, clock and watchdog etc.. This patch adds i.MX system controller watchdog driver support, watchdog operation needs to be done in secure EL3 mode via ARM-Trusted-Firmware, using SMC call, CPU will trap into ARM-Trusted-Firmware and then it will request system controller to do watchdog operation via IPC. Signed-off-by: Anson Huang <Anson.Huang@nxp.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>