* [PATCH 0/4] ARM: shmobile: koelsch: Add DA9063 watchdog restart support
@ 2014-12-09 11:22 Geert Uytterhoeven
2014-12-09 11:22 ` [PATCH 1/4] watchdog: da9063: Add restart handler support Geert Uytterhoeven
` (4 more replies)
0 siblings, 5 replies; 14+ messages in thread
From: Geert Uytterhoeven @ 2014-12-09 11:22 UTC (permalink / raw)
To: Wim Van Sebroeck, Wolfram Sang, Simon Horman, Magnus Damm
Cc: Support Opensource, Guenter Roeck, Lee Jones, linux-watchdog,
linux-i2c, linux-sh, Geert Uytterhoeven
Hi Wim, Wolfram, Simon, Magnus,
This patch series add restart support for r8a7791/koelsch through the watchdog
in the DA9063 PMIC. Restart can be triggered in two ways:
1. Timeout of the watchdog timer,
2. Manual system restart, shutting down the DA9063.
Dependencies:
- There are no strict merge order dependencies,
- While manual restart depends on patch 1, patches 3 and 4 can be merged
now, as restart on watchdog timeout works without patch 1.
Patches:
- Patch 1 is intended for the watchdog tree (based on watchdog/next),
- Patch 2 is intended for the i2c tree (based on i2c/next),
- Patches 3 and 4 are intended for the shmobile tree (based on
renesas-devel-20141209-v3.18).
This was tested on r8a7791/koelsch.
I expect this restart method to be usable on r8a7791/lager and r8a7794/alt,
too.
Thanks!
Geert Uytterhoeven (4):
watchdog: da9063: Add restart handler support
DT: i2c: Add devices handled by the da9063 MFD driver
ARM: shmobile: koelsch: Add DA9063 PMIC device node for system restart
ARM: shmobile: Enable DA9063 watchdog in multiplatform defconfig
.../devicetree/bindings/i2c/trivial-devices.txt | 1 +
arch/arm/boot/dts/r8a7791-koelsch.dts | 7 +++++
arch/arm/configs/shmobile_defconfig | 3 ++
drivers/watchdog/da9063_wdt.c | 32 +++++++++++++++++++++-
4 files changed, 42 insertions(+), 1 deletion(-)
--
1.9.1
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] 14+ messages in thread
* [PATCH 1/4] watchdog: da9063: Add restart handler support
2014-12-09 11:22 [PATCH 0/4] ARM: shmobile: koelsch: Add DA9063 watchdog restart support Geert Uytterhoeven
@ 2014-12-09 11:22 ` Geert Uytterhoeven
2014-12-09 12:37 ` Opensource [Steve Twiss]
2014-12-09 11:22 ` [PATCH 2/4] DT: i2c: Add devices handled by the da9063 MFD driver Geert Uytterhoeven
` (3 subsequent siblings)
4 siblings, 1 reply; 14+ messages in thread
From: Geert Uytterhoeven @ 2014-12-09 11:22 UTC (permalink / raw)
To: Wim Van Sebroeck, Wolfram Sang, Simon Horman, Magnus Damm
Cc: Support Opensource, Guenter Roeck, Lee Jones, linux-watchdog,
linux-i2c, linux-sh, Geert Uytterhoeven
Register a restart handler for the da9063 watchdog. System restart is
triggered by sending the shutdown command to the PMIC.
As more-suitable restart handlers may exist, the priority of the
watchdog restart handler is set to 128.
The actual restart method was inspired by a platform-specific patch from
the BSP by Hisashi Nakamura <hisashi.nakamura.ak@renesas.com>.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
Tested on r8a7791/koelsch
---
drivers/watchdog/da9063_wdt.c | 32 +++++++++++++++++++++++++++++++-
1 file changed, 31 insertions(+), 1 deletion(-)
diff --git a/drivers/watchdog/da9063_wdt.c b/drivers/watchdog/da9063_wdt.c
index 2cd6b2c2dd2a6980..e2fe2ebdebd4d6bb 100644
--- a/drivers/watchdog/da9063_wdt.c
+++ b/drivers/watchdog/da9063_wdt.c
@@ -20,6 +20,7 @@
#include <linux/delay.h>
#include <linux/mfd/da9063/registers.h>
#include <linux/mfd/da9063/core.h>
+#include <linux/reboot.h>
#include <linux/regmap.h>
/*
@@ -38,6 +39,7 @@ static const unsigned int wdt_timeout[] = { 0, 2, 4, 8, 16, 32, 65, 131 };
struct da9063_watchdog {
struct da9063 *da9063;
struct watchdog_device wdtdev;
+ struct notifier_block restart_handler;
};
static unsigned int da9063_wdt_timeout_to_sel(unsigned int secs)
@@ -119,6 +121,23 @@ static int da9063_wdt_set_timeout(struct watchdog_device *wdd,
return ret;
}
+static int da9063_wdt_restart_handler(struct notifier_block *this,
+ unsigned long mode, void *cmd)
+{
+ struct da9063_watchdog *wdt = container_of(this,
+ struct da9063_watchdog,
+ restart_handler);
+ int ret;
+
+ ret = regmap_write(wdt->da9063->regmap, DA9063_REG_CONTROL_F,
+ DA9063_SHUTDOWN);
+ if (ret)
+ dev_alert(wdt->da9063->dev, "Failed to shutdown (err = %d)\n",
+ ret);
+
+ return NOTIFY_DONE;
+}
+
static const struct watchdog_info da9063_watchdog_info = {
.options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING,
.identity = "DA9063 Watchdog",
@@ -163,14 +182,25 @@ static int da9063_wdt_probe(struct platform_device *pdev)
dev_set_drvdata(&pdev->dev, wdt);
ret = watchdog_register_device(&wdt->wdtdev);
+ if (ret)
+ return ret;
- return ret;
+ wdt->restart_handler.notifier_call = da9063_wdt_restart_handler;
+ wdt->restart_handler.priority = 128;
+ ret = register_restart_handler(&wdt->restart_handler);
+ if (ret)
+ dev_err(wdt->da9063->dev,
+ "Failed to register restart handler (err = %d)\n", ret);
+
+ return 0;
}
static int da9063_wdt_remove(struct platform_device *pdev)
{
struct da9063_watchdog *wdt = dev_get_drvdata(&pdev->dev);
+ unregister_restart_handler(&wdt->restart_handler);
+
watchdog_unregister_device(&wdt->wdtdev);
return 0;
--
1.9.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 2/4] DT: i2c: Add devices handled by the da9063 MFD driver
2014-12-09 11:22 [PATCH 0/4] ARM: shmobile: koelsch: Add DA9063 watchdog restart support Geert Uytterhoeven
2014-12-09 11:22 ` [PATCH 1/4] watchdog: da9063: Add restart handler support Geert Uytterhoeven
@ 2014-12-09 11:22 ` Geert Uytterhoeven
2014-12-09 12:40 ` Opensource [Steve Twiss]
[not found] ` <1418124169-7123-3-git-send-email-geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>
2014-12-09 11:22 ` [PATCH 3/4] ARM: shmobile: koelsch: Add DA9063 PMIC device node for system restart Geert Uytterhoeven
` (2 subsequent siblings)
4 siblings, 2 replies; 14+ messages in thread
From: Geert Uytterhoeven @ 2014-12-09 11:22 UTC (permalink / raw)
To: Wim Van Sebroeck, Wolfram Sang, Simon Horman, Magnus Damm
Cc: Support Opensource, Guenter Roeck, Lee Jones, linux-watchdog,
linux-i2c, linux-sh, Geert Uytterhoeven, devicetree
This allows checkpatch to validate more DTSes.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: devicetree@vger.kernel.org
---
Documentation/devicetree/bindings/i2c/trivial-devices.txt | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/i2c/trivial-devices.txt b/Documentation/devicetree/bindings/i2c/trivial-devices.txt
index e0beef4f8cff5cdf..3bc4ea3c5c4842ff 100644
--- a/Documentation/devicetree/bindings/i2c/trivial-devices.txt
+++ b/Documentation/devicetree/bindings/i2c/trivial-devices.txt
@@ -47,6 +47,7 @@ dallas,ds3232 Extremely Accurate I²C RTC with Integrated Crystal and SRAM
dallas,ds4510 CPU Supervisor with Nonvolatile Memory and Programmable I/O
dallas,ds75 Digital Thermometer and Thermostat
dlg,da9053 DA9053: flexible system level PMIC with multicore support
+dlg,da9063 DA9063: system PMIC for quad-core application processors
epson,rx8025 High-Stability. I2C-Bus INTERFACE REAL TIME CLOCK MODULE
epson,rx8581 I2C-BUS INTERFACE REAL TIME CLOCK MODULE
fsl,mag3110 MAG3110: Xtrinsic High Accuracy, 3D Magnetometer
--
1.9.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 3/4] ARM: shmobile: koelsch: Add DA9063 PMIC device node for system restart
2014-12-09 11:22 [PATCH 0/4] ARM: shmobile: koelsch: Add DA9063 watchdog restart support Geert Uytterhoeven
2014-12-09 11:22 ` [PATCH 1/4] watchdog: da9063: Add restart handler support Geert Uytterhoeven
2014-12-09 11:22 ` [PATCH 2/4] DT: i2c: Add devices handled by the da9063 MFD driver Geert Uytterhoeven
@ 2014-12-09 11:22 ` Geert Uytterhoeven
[not found] ` <1418124169-7123-4-git-send-email-geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>
[not found] ` <1418124169-7123-1-git-send-email-geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>
2014-12-10 0:33 ` [PATCH 0/4] ARM: shmobile: koelsch: Add DA9063 watchdog restart support Simon Horman
4 siblings, 1 reply; 14+ messages in thread
From: Geert Uytterhoeven @ 2014-12-09 11:22 UTC (permalink / raw)
To: Wim Van Sebroeck, Wolfram Sang, Simon Horman, Magnus Damm
Cc: Support Opensource, Guenter Roeck, Lee Jones, linux-watchdog,
linux-i2c, linux-sh, Geert Uytterhoeven, devicetree
Add a minimal device node for the DA9063 PMIC, which is connected to i2c6.
This allows the system to be restarted when the watchdog timer times
out, or when a system restart is requested.
Regulator support is not yet included, as no DT support code nor DT
binding documentation exists for the regulator functionality.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: devicetree@vger.kernel.org
---
Restart by watchdog timeout is working now.
Manual system restart depends on "[PATCH 1/4] watchdog: da9063: Add restart
handler support".
---
arch/arm/boot/dts/r8a7791-koelsch.dts | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/arch/arm/boot/dts/r8a7791-koelsch.dts b/arch/arm/boot/dts/r8a7791-koelsch.dts
index 6938377d3798644b..a400c27a813f1a8b 100644
--- a/arch/arm/boot/dts/r8a7791-koelsch.dts
+++ b/arch/arm/boot/dts/r8a7791-koelsch.dts
@@ -524,6 +524,13 @@
regulator-boot-on;
regulator-always-on;
};
+
+ pmic@58 {
+ compatible = "dlg,da9063";
+ reg = <0x58>;
+ interrupt-parent = <&irqc0>;
+ interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
+ };
};
&pci0 {
--
1.9.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 4/4] ARM: shmobile: Enable DA9063 watchdog in multiplatform defconfig
[not found] ` <1418124169-7123-1-git-send-email-geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>
@ 2014-12-09 11:22 ` Geert Uytterhoeven
0 siblings, 0 replies; 14+ messages in thread
From: Geert Uytterhoeven @ 2014-12-09 11:22 UTC (permalink / raw)
To: Wim Van Sebroeck, Wolfram Sang, Simon Horman, Magnus Damm
Cc: Support Opensource, Guenter Roeck, Lee Jones,
linux-watchdog-u79uwXL29TY76Z2rM5mHXA,
linux-i2c-u79uwXL29TY76Z2rM5mHXA, linux-sh-u79uwXL29TY76Z2rM5mHXA,
Geert Uytterhoeven
This allows to restart koelsch on watchdog timeout or manual system
restart request.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
Restart by watchdog timeout is working now.
Manual system restart depends on "[PATCH 1/4] watchdog: da9063: Add restart
handler support".
---
arch/arm/configs/shmobile_defconfig | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/arm/configs/shmobile_defconfig b/arch/arm/configs/shmobile_defconfig
index dfc1efcb4a866ef3..5863128b06be8551 100644
--- a/arch/arm/configs/shmobile_defconfig
+++ b/arch/arm/configs/shmobile_defconfig
@@ -106,6 +106,9 @@ CONFIG_GPIO_RCAR=y
CONFIG_THERMAL=y
CONFIG_CPU_THERMAL=y
CONFIG_RCAR_THERMAL=y
+CONFIG_WATCHDOG=y
+CONFIG_DA9063_WATCHDOG=y
+CONFIG_MFD_DA9063=y
CONFIG_REGULATOR=y
CONFIG_REGULATOR_DA9210=y
CONFIG_REGULATOR_GPIO=y
--
1.9.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* RE: [PATCH 1/4] watchdog: da9063: Add restart handler support
2014-12-09 11:22 ` [PATCH 1/4] watchdog: da9063: Add restart handler support Geert Uytterhoeven
@ 2014-12-09 12:37 ` Opensource [Steve Twiss]
[not found] ` <6ED8E3B22081A4459DAC7699F3695FB7D0B4C115-68WUHU125fLzLL1Oxlh9IgLouzNaz+3S@public.gmane.org>
0 siblings, 1 reply; 14+ messages in thread
From: Opensource [Steve Twiss] @ 2014-12-09 12:37 UTC (permalink / raw)
To: Geert Uytterhoeven, Wim Van Sebroeck, Wolfram Sang, Simon Horman,
Magnus Damm
Cc: Support Opensource, Guenter Roeck, Lee Jones,
linux-watchdog@vger.kernel.org, linux-i2c@vger.kernel.org,
linux-sh@vger.kernel.org
On 09 December 2014 11:23 Geert Uytterhoeven wrote:
Hi Geert,
> Subject: [PATCH 1/4] watchdog: da9063: Add restart handler support
>
> Register a restart handler for the da9063 watchdog. System restart is
> triggered by sending the shutdown command to the PMIC.
> As more-suitable restart handlers may exist, the priority of the
> watchdog restart handler is set to 128.
>
> The actual restart method was inspired by a platform-specific patch from
> the BSP by Hisashi Nakamura <hisashi.nakamura.ak@renesas.com>.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> Tested on r8a7791/koelsch
> ---
[...]
+static int da9063_wdt_restart_handler(struct notifier_block *this,
+ unsigned long mode, void *cmd)
+{
+ struct da9063_watchdog *wdt = container_of(this,
+ struct da9063_watchdog,
+ restart_handler);
+ int ret;
+
+ ret = regmap_write(wdt->da9063->regmap, DA9063_REG_CONTROL_F,
+ DA9063_SHUTDOWN);
I am stating the obvious here.
DA9063_REG_CONTROL_F, DA9063_SHUTDOWN will cause the sequencer to
power down to RESET Mode -- which means if this I2C command succeeds
there will be a sudden loss of power and any unsaved information will be
lost after this point.
This is exactly how I have done it in the past.
+ if (ret)
+ dev_alert(wdt->da9063->dev, "Failed to shutdown (err = %d)\n",
+ ret);
+
+ return NOTIFY_DONE;
+}
+
[...]
> static const struct watchdog_info da9063_watchdog_info = {
> .options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING,
> .identity = "DA9063 Watchdog",
> @@ -163,14 +182,25 @@ static int da9063_wdt_probe(struct
> platform_device *pdev)
> dev_set_drvdata(&pdev->dev, wdt);
>
> ret = watchdog_register_device(&wdt->wdtdev);
> + if (ret)
> + return ret;
>
> - return ret;
> + wdt->restart_handler.notifier_call = da9063_wdt_restart_handler;
> + wdt->restart_handler.priority = 128;
> + ret = register_restart_handler(&wdt->restart_handler);
> + if (ret)
> + dev_err(wdt->da9063->dev,
> + "Failed to register restart handler (err = %d)\n", ret);
(I guess this is intentional).. if the restart handler doesn't get registered then
this problem is just ignored and not counted as a real error.
> +
> + return 0;
> }
>
> static int da9063_wdt_remove(struct platform_device *pdev)
> {
> struct da9063_watchdog *wdt = dev_get_drvdata(&pdev->dev);
>
> + unregister_restart_handler(&wdt->restart_handler);
> +
> watchdog_unregister_device(&wdt->wdtdev);
>
> return 0;
Despite the above, these are just my comments.
It all looks fine to me.
Acked-by: Steve Twiss <stwiss.opensource@diasemi.com>
Regards,
Steve
^ permalink raw reply [flat|nested] 14+ messages in thread
* RE: [PATCH 2/4] DT: i2c: Add devices handled by the da9063 MFD driver
2014-12-09 11:22 ` [PATCH 2/4] DT: i2c: Add devices handled by the da9063 MFD driver Geert Uytterhoeven
@ 2014-12-09 12:40 ` Opensource [Steve Twiss]
[not found] ` <1418124169-7123-3-git-send-email-geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>
1 sibling, 0 replies; 14+ messages in thread
From: Opensource [Steve Twiss] @ 2014-12-09 12:40 UTC (permalink / raw)
To: Geert Uytterhoeven, Wim Van Sebroeck, Wolfram Sang, Simon Horman,
Magnus Damm
Cc: Support Opensource, Guenter Roeck, Lee Jones,
linux-watchdog@vger.kernel.org, linux-i2c@vger.kernel.org,
linux-sh@vger.kernel.org, devicetree@vger.kernel.org
T24gMDkgRGVjZW1iZXIgMjAxNCAxMToyMywgR2VlcnQgVXl0dGVyaG9ldmVuIHdyb3RlIA0KDQo+
IFN1YmplY3Q6IFtQQVRDSCAyLzRdIERUOiBpMmM6IEFkZCBkZXZpY2VzIGhhbmRsZWQgYnkgdGhl
IGRhOTA2MyBNRkQgZHJpdmVyDQo+IA0KPiBUaGlzIGFsbG93cyBjaGVja3BhdGNoIHRvIHZhbGlk
YXRlIG1vcmUgRFRTZXMuDQo+IA0KPiBTaWduZWQtb2ZmLWJ5OiBHZWVydCBVeXR0ZXJob2V2ZW4g
PGdlZXJ0K3JlbmVzYXNAZ2xpZGVyLmJlPg0KPiBDYzogZGV2aWNldHJlZUB2Z2VyLmtlcm5lbC5v
cmcNCj4gLS0tDQo+ICBEb2N1bWVudGF0aW9uL2RldmljZXRyZWUvYmluZGluZ3MvaTJjL3RyaXZp
YWwtZGV2aWNlcy50eHQgfCAxICsNCj4gIDEgZmlsZSBjaGFuZ2VkLCAxIGluc2VydGlvbigrKQ0K
PiANCj4gZGlmZiAtLWdpdCBhL0RvY3VtZW50YXRpb24vZGV2aWNldHJlZS9iaW5kaW5ncy9pMmMv
dHJpdmlhbC1kZXZpY2VzLnR4dA0KPiBiL0RvY3VtZW50YXRpb24vZGV2aWNldHJlZS9iaW5kaW5n
cy9pMmMvdHJpdmlhbC1kZXZpY2VzLnR4dA0KPiBpbmRleCBlMGJlZWY0ZjhjZmY1Y2RmLi4zYmM0
ZWEzYzVjNDg0MmZmIDEwMDY0NA0KPiAtLS0gYS9Eb2N1bWVudGF0aW9uL2RldmljZXRyZWUvYmlu
ZGluZ3MvaTJjL3RyaXZpYWwtZGV2aWNlcy50eHQNCj4gKysrIGIvRG9jdW1lbnRhdGlvbi9kZXZp
Y2V0cmVlL2JpbmRpbmdzL2kyYy90cml2aWFsLWRldmljZXMudHh0DQo+IEBAIC00Nyw2ICs0Nyw3
IEBAIGRhbGxhcyxkczMyMzIJCUV4dHJlbWVseSBBY2N1cmF0ZSBJwrJDIFJUQw0KPiB3aXRoIElu
dGVncmF0ZWQgQ3J5c3RhbCBhbmQgU1JBTQ0KPiAgZGFsbGFzLGRzNDUxMAkJQ1BVIFN1cGVydmlz
b3Igd2l0aCBOb252b2xhdGlsZSBNZW1vcnkgYW5kDQo+IFByb2dyYW1tYWJsZSBJL08NCj4gIGRh
bGxhcyxkczc1CQlEaWdpdGFsIFRoZXJtb21ldGVyIGFuZCBUaGVybW9zdGF0DQo+ICBkbGcsZGE5
MDUzCQlEQTkwNTM6IGZsZXhpYmxlIHN5c3RlbSBsZXZlbCBQTUlDIHdpdGggbXVsdGljb3JlDQo+
IHN1cHBvcnQNCj4gK2RsZyxkYTkwNjMJCURBOTA2Mzogc3lzdGVtIFBNSUMgZm9yIHF1YWQtY29y
ZSBhcHBsaWNhdGlvbg0KPiBwcm9jZXNzb3JzDQo+ICBlcHNvbixyeDgwMjUJCUhpZ2gtU3RhYmls
aXR5LiBJMkMtQnVzIElOVEVSRkFDRSBSRUFMIFRJTUUgQ0xPQ0sNCj4gTU9EVUxFDQo+ICBlcHNv
bixyeDg1ODEJCUkyQy1CVVMgSU5URVJGQUNFIFJFQUwgVElNRSBDTE9DSyBNT0RVTEUNCj4gIGZz
bCxtYWczMTEwCQlNQUczMTEwOiBYdHJpbnNpYyBIaWdoIEFjY3VyYWN5LCAzRCBNYWduZXRvbWV0
ZXINCg0KQWNrZWQtYnk6IFN0ZXZlIFR3aXNzIDxzdHdpc3Mub3BlbnNvdXJjZUBkaWFzZW1pLmNv
bT4NCg=
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/4] watchdog: da9063: Add restart handler support
[not found] ` <6ED8E3B22081A4459DAC7699F3695FB7D0B4C115-68WUHU125fLzLL1Oxlh9IgLouzNaz+3S@public.gmane.org>
@ 2014-12-09 16:22 ` Guenter Roeck
0 siblings, 0 replies; 14+ messages in thread
From: Guenter Roeck @ 2014-12-09 16:22 UTC (permalink / raw)
To: Opensource [Steve Twiss]
Cc: Geert Uytterhoeven, Wim Van Sebroeck, Wolfram Sang, Simon Horman,
Magnus Damm, Support Opensource, Lee Jones,
linux-watchdog-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-sh-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
On Tue, Dec 09, 2014 at 12:37:15PM +0000, Opensource [Steve Twiss] wrote:
> On 09 December 2014 11:23 Geert Uytterhoeven wrote:
>
[ ... ]
> > + ret = register_restart_handler(&wdt->restart_handler);
> > + if (ret)
> > + dev_err(wdt->da9063->dev,
> > + "Failed to register restart handler (err = %d)\n", ret);
>
> (I guess this is intentional).. if the restart handler doesn't get registered then
> this problem is just ignored and not counted as a real error.
>
This makes sense, since one doesn't want the watchdog driver to fail
loading just because the restart handler failed to register.
One option might be to make the message dev_warn instead of dev_err,
but that is really a nitpick.
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Thanks,
Guenter
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 0/4] ARM: shmobile: koelsch: Add DA9063 watchdog restart support
2014-12-09 11:22 [PATCH 0/4] ARM: shmobile: koelsch: Add DA9063 watchdog restart support Geert Uytterhoeven
` (3 preceding siblings ...)
[not found] ` <1418124169-7123-1-git-send-email-geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>
@ 2014-12-10 0:33 ` Simon Horman
2014-12-10 10:06 ` Geert Uytterhoeven
4 siblings, 1 reply; 14+ messages in thread
From: Simon Horman @ 2014-12-10 0:33 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Wim Van Sebroeck, Wolfram Sang, Magnus Damm, Support Opensource,
Guenter Roeck, Lee Jones, linux-watchdog, linux-i2c, linux-sh
On Tue, Dec 09, 2014 at 12:22:45PM +0100, Geert Uytterhoeven wrote:
> Hi Wim, Wolfram, Simon, Magnus,
>
> This patch series add restart support for r8a7791/koelsch through the watchdog
> in the DA9063 PMIC. Restart can be triggered in two ways:
> 1. Timeout of the watchdog timer,
> 2. Manual system restart, shutting down the DA9063.
>
> Dependencies:
> - There are no strict merge order dependencies,
> - While manual restart depends on patch 1, patches 3 and 4 can be merged
> now, as restart on watchdog timeout works without patch 1.
>
> Patches:
> - Patch 1 is intended for the watchdog tree (based on watchdog/next),
> - Patch 2 is intended for the i2c tree (based on i2c/next),
> - Patches 3 and 4 are intended for the shmobile tree (based on
> renesas-devel-20141209-v3.18).
Patches 3 and 4 look like they could be queued up for v3.20 now.
Shall I do so?
> This was tested on r8a7791/koelsch.
> I expect this restart method to be usable on r8a7791/lager and r8a7794/alt,
> too.
>
> Thanks!
>
> Geert Uytterhoeven (4):
> watchdog: da9063: Add restart handler support
> DT: i2c: Add devices handled by the da9063 MFD driver
> ARM: shmobile: koelsch: Add DA9063 PMIC device node for system restart
> ARM: shmobile: Enable DA9063 watchdog in multiplatform defconfig
>
> .../devicetree/bindings/i2c/trivial-devices.txt | 1 +
> arch/arm/boot/dts/r8a7791-koelsch.dts | 7 +++++
> arch/arm/configs/shmobile_defconfig | 3 ++
> drivers/watchdog/da9063_wdt.c | 32 +++++++++++++++++++++-
> 4 files changed, 42 insertions(+), 1 deletion(-)
>
> --
> 1.9.1
>
> 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] 14+ messages in thread
* Re: [PATCH 0/4] ARM: shmobile: koelsch: Add DA9063 watchdog restart support
2014-12-10 0:33 ` [PATCH 0/4] ARM: shmobile: koelsch: Add DA9063 watchdog restart support Simon Horman
@ 2014-12-10 10:06 ` Geert Uytterhoeven
2014-12-11 1:04 ` Simon Horman
0 siblings, 1 reply; 14+ messages in thread
From: Geert Uytterhoeven @ 2014-12-10 10:06 UTC (permalink / raw)
To: Simon Horman
Cc: Geert Uytterhoeven, Wim Van Sebroeck, Wolfram Sang, Magnus Damm,
Support Opensource, Guenter Roeck, Lee Jones,
Linux Watchdog Mailing List, Linux I2C, Linux-sh list
Hi Simon,
On Wed, Dec 10, 2014 at 1:33 AM, Simon Horman <horms@verge.net.au> wrote:
> On Tue, Dec 09, 2014 at 12:22:45PM +0100, Geert Uytterhoeven wrote:
>> This patch series add restart support for r8a7791/koelsch through the watchdog
>> in the DA9063 PMIC. Restart can be triggered in two ways:
>> 1. Timeout of the watchdog timer,
>> 2. Manual system restart, shutting down the DA9063.
>>
>> Dependencies:
>> - There are no strict merge order dependencies,
>> - While manual restart depends on patch 1, patches 3 and 4 can be merged
>> now, as restart on watchdog timeout works without patch 1.
>>
>> Patches:
>> - Patch 1 is intended for the watchdog tree (based on watchdog/next),
>> - Patch 2 is intended for the i2c tree (based on i2c/next),
>> - Patches 3 and 4 are intended for the shmobile tree (based on
>> renesas-devel-20141209-v3.18).
>
> Patches 3 and 4 look like they could be queued up for v3.20 now.
> Shall I do so?
Please do so.
You can easily test restart on watchdog timeout using:
$ cat > /dev/watchdog0
Koelsch should restart 8 seconds after you stop typing.
Thanks!
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] 14+ messages in thread
* Re: [PATCH 0/4] ARM: shmobile: koelsch: Add DA9063 watchdog restart support
2014-12-10 10:06 ` Geert Uytterhoeven
@ 2014-12-11 1:04 ` Simon Horman
0 siblings, 0 replies; 14+ messages in thread
From: Simon Horman @ 2014-12-11 1:04 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Geert Uytterhoeven, Wim Van Sebroeck, Wolfram Sang, Magnus Damm,
Support Opensource, Guenter Roeck, Lee Jones,
Linux Watchdog Mailing List, Linux I2C, Linux-sh list
On Wed, Dec 10, 2014 at 11:06:25AM +0100, Geert Uytterhoeven wrote:
> Hi Simon,
>
> On Wed, Dec 10, 2014 at 1:33 AM, Simon Horman <horms@verge.net.au> wrote:
> > On Tue, Dec 09, 2014 at 12:22:45PM +0100, Geert Uytterhoeven wrote:
> >> This patch series add restart support for r8a7791/koelsch through the watchdog
> >> in the DA9063 PMIC. Restart can be triggered in two ways:
> >> 1. Timeout of the watchdog timer,
> >> 2. Manual system restart, shutting down the DA9063.
> >>
> >> Dependencies:
> >> - There are no strict merge order dependencies,
> >> - While manual restart depends on patch 1, patches 3 and 4 can be merged
> >> now, as restart on watchdog timeout works without patch 1.
> >>
> >> Patches:
> >> - Patch 1 is intended for the watchdog tree (based on watchdog/next),
> >> - Patch 2 is intended for the i2c tree (based on i2c/next),
> >> - Patches 3 and 4 are intended for the shmobile tree (based on
> >> renesas-devel-20141209-v3.18).
> >
> > Patches 3 and 4 look like they could be queued up for v3.20 now.
> > Shall I do so?
>
> Please do so.
>
> You can easily test restart on watchdog timeout using:
>
> $ cat > /dev/watchdog0
>
> Koelsch should restart 8 seconds after you stop typing.
Thanks, I have queued them up.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 3/4] ARM: shmobile: koelsch: Add DA9063 PMIC device node for system restart
[not found] ` <1418124169-7123-4-git-send-email-geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>
@ 2014-12-21 10:52 ` Simon Horman
[not found] ` <20141221105133.GA30697-/R6kz+dDXgpPR4JQBCEnsQ@public.gmane.org>
0 siblings, 1 reply; 14+ messages in thread
From: Simon Horman @ 2014-12-21 10:52 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Wim Van Sebroeck, Wolfram Sang, Magnus Damm, Support Opensource,
Guenter Roeck, Lee Jones, linux-watchdog-u79uwXL29TY76Z2rM5mHXA,
linux-i2c-u79uwXL29TY76Z2rM5mHXA, linux-sh-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA
On Tue, Dec 09, 2014 at 12:22:48PM +0100, Geert Uytterhoeven wrote:
> Add a minimal device node for the DA9063 PMIC, which is connected to i2c6.
> This allows the system to be restarted when the watchdog timer times
> out, or when a system restart is requested.
>
> Regulator support is not yet included, as no DT support code nor DT
> binding documentation exists for the regulator functionality.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Cc: devicetree@vger.kernel.org
Hi,
I had this queued up for v3.20, however, when rebasing on top
of v3.19-rca (previous base was v3.18) I noticed that this patch
appears to cause booting koelsch with shmobile_defconfig to
stop at:
rcar_sound ec500000.rcar_sound: can't get dma channel
rcar_sound ec500000.rcar_sound: src[3] (Gen2) failed
rcar_sound ec500000.rcar_sound: ssi[1] fallback to PIO mode
rcar_sound ec500000.rcar_sound: probed
TCP: cubic registered
NET: Registered protocol family 10
da9063 6-0058: Failed to read IRQ status: -6
sit: IPv6 over IPv4 tunneling driver
NET: Registered protocol family 17
Key type dns_resolver registered
random: nonblocking pool is initialized
I have (hopefully temporarily) dropped this patch accordingly.
> ---
> Restart by watchdog timeout is working now.
> Manual system restart depends on "[PATCH 1/4] watchdog: da9063: Add restart
> handler support".
> ---
> arch/arm/boot/dts/r8a7791-koelsch.dts | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/arch/arm/boot/dts/r8a7791-koelsch.dts b/arch/arm/boot/dts/r8a7791-koelsch.dts
> index 6938377d3798644b..a400c27a813f1a8b 100644
> --- a/arch/arm/boot/dts/r8a7791-koelsch.dts
> +++ b/arch/arm/boot/dts/r8a7791-koelsch.dts
> @@ -524,6 +524,13 @@
> regulator-boot-on;
> regulator-always-on;
> };
> +
> + pmic@58 {
> + compatible = "dlg,da9063";
> + reg = <0x58>;
> + interrupt-parent = <&irqc0>;
> + interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
> + };
> };
>
> &pci0 {
> --
> 1.9.1
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 3/4] ARM: shmobile: koelsch: Add DA9063 PMIC device node for system restart
[not found] ` <20141221105133.GA30697-/R6kz+dDXgpPR4JQBCEnsQ@public.gmane.org>
@ 2014-12-22 13:21 ` Geert Uytterhoeven
0 siblings, 0 replies; 14+ messages in thread
From: Geert Uytterhoeven @ 2014-12-22 13:21 UTC (permalink / raw)
To: Simon Horman
Cc: Geert Uytterhoeven, Wim Van Sebroeck, Wolfram Sang, Magnus Damm,
Support Opensource, Guenter Roeck, Lee Jones,
Linux Watchdog Mailing List, Linux I2C, Linux-sh list,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Hi Simon,
On Sun, Dec 21, 2014 at 11:52 AM, Simon Horman <horms@verge.net.au> wrote:
> On Tue, Dec 09, 2014 at 12:22:48PM +0100, Geert Uytterhoeven wrote:
>> Add a minimal device node for the DA9063 PMIC, which is connected to i2c6.
>> This allows the system to be restarted when the watchdog timer times
>> out, or when a system restart is requested.
>>
>> Regulator support is not yet included, as no DT support code nor DT
>> binding documentation exists for the regulator functionality.
>>
>> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
>> Cc: devicetree@vger.kernel.org
>
> Hi,
>
> I had this queued up for v3.20, however, when rebasing on top
> of v3.19-rca (previous base was v3.18) I noticed that this patch
> appears to cause booting koelsch with shmobile_defconfig to
> stop at:
>
> rcar_sound ec500000.rcar_sound: can't get dma channel
> rcar_sound ec500000.rcar_sound: src[3] (Gen2) failed
> rcar_sound ec500000.rcar_sound: ssi[1] fallback to PIO mode
> rcar_sound ec500000.rcar_sound: probed
> TCP: cubic registered
> NET: Registered protocol family 10
> da9063 6-0058: Failed to read IRQ status: -6
> sit: IPv6 over IPv4 tunneling driver
> NET: Registered protocol family 17
> Key type dns_resolver registered
> random: nonblocking pool is initializered
I could reproduce the issue on both renesas-devel-20141221-v3.19-rc1
and renesas-drivers-2014-12-22-v3.19-rc1.
It doesn't happen on every boot, though.
What does happen on every boot is that the da9063-irq value in
/proc/interrupts is increasing fast. After a while, the kernel complains:
irq 125: nobody cared (try booting with the "irqpoll" option)
...
Disabling IRQ #125
None of the above happen in my local development branch...
It turns out I don't see the problem because I (still) have code to disable all
unused MSTP clocks during startup.
If MSTP407 (IRQC) is disabled, everything works fine.
If it's left enabled, spurious interrupts are coming in.
Changing the interrupt to IRQ_TYPE_LEVEL_HIGH doesn't help, and
irq-renesas-irqc.c does use irq_domain_xlate_twocell, so I'm a bit lost...
> I have (hopefully temporarily) dropped this patch accordingly.
>
>> ---
>> Restart by watchdog timeout is working now.
>> Manual system restart depends on "[PATCH 1/4] watchdog: da9063: Add restart
>> handler support".
>> ---
>> arch/arm/boot/dts/r8a7791-koelsch.dts | 7 +++++++
>> 1 file changed, 7 insertions(+)
>>
>> diff --git a/arch/arm/boot/dts/r8a7791-koelsch.dts b/arch/arm/boot/dts/r8a7791-koelsch.dts
>> index 6938377d3798644b..a400c27a813f1a8b 100644
>> --- a/arch/arm/boot/dts/r8a7791-koelsch.dts
>> +++ b/arch/arm/boot/dts/r8a7791-koelsch.dts
>> @@ -524,6 +524,13 @@
>> regulator-boot-on;
>> regulator-always-on;
>> };
>> +
>> + pmic@58 {
>> + compatible = "dlg,da9063";
>> + reg = <0x58>;
>> + interrupt-parent = <&irqc0>;
>> + interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
>> + };
>> };
>>
>> &pci0 {
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] 14+ messages in thread
* Re: [PATCH 2/4] DT: i2c: Add devices handled by the da9063 MFD driver
[not found] ` <1418124169-7123-3-git-send-email-geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>
@ 2015-01-13 10:15 ` Wolfram Sang
0 siblings, 0 replies; 14+ messages in thread
From: Wolfram Sang @ 2015-01-13 10:15 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Wim Van Sebroeck, Simon Horman, Magnus Damm, Support Opensource,
Guenter Roeck, Lee Jones, linux-watchdog-u79uwXL29TY76Z2rM5mHXA,
linux-i2c-u79uwXL29TY76Z2rM5mHXA, linux-sh-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA
[-- Attachment #1: Type: text/plain, Size: 254 bytes --]
On Tue, Dec 09, 2014 at 12:22:47PM +0100, Geert Uytterhoeven wrote:
> This allows checkpatch to validate more DTSes.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Cc: devicetree@vger.kernel.org
Applied to for-next, thanks!
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2015-01-13 10:15 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-09 11:22 [PATCH 0/4] ARM: shmobile: koelsch: Add DA9063 watchdog restart support Geert Uytterhoeven
2014-12-09 11:22 ` [PATCH 1/4] watchdog: da9063: Add restart handler support Geert Uytterhoeven
2014-12-09 12:37 ` Opensource [Steve Twiss]
[not found] ` <6ED8E3B22081A4459DAC7699F3695FB7D0B4C115-68WUHU125fLzLL1Oxlh9IgLouzNaz+3S@public.gmane.org>
2014-12-09 16:22 ` Guenter Roeck
2014-12-09 11:22 ` [PATCH 2/4] DT: i2c: Add devices handled by the da9063 MFD driver Geert Uytterhoeven
2014-12-09 12:40 ` Opensource [Steve Twiss]
[not found] ` <1418124169-7123-3-git-send-email-geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>
2015-01-13 10:15 ` Wolfram Sang
2014-12-09 11:22 ` [PATCH 3/4] ARM: shmobile: koelsch: Add DA9063 PMIC device node for system restart Geert Uytterhoeven
[not found] ` <1418124169-7123-4-git-send-email-geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>
2014-12-21 10:52 ` Simon Horman
[not found] ` <20141221105133.GA30697-/R6kz+dDXgpPR4JQBCEnsQ@public.gmane.org>
2014-12-22 13:21 ` Geert Uytterhoeven
[not found] ` <1418124169-7123-1-git-send-email-geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>
2014-12-09 11:22 ` [PATCH 4/4] ARM: shmobile: Enable DA9063 watchdog in multiplatform defconfig Geert Uytterhoeven
2014-12-10 0:33 ` [PATCH 0/4] ARM: shmobile: koelsch: Add DA9063 watchdog restart support Simon Horman
2014-12-10 10:06 ` Geert Uytterhoeven
2014-12-11 1:04 ` Simon Horman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).