Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1735526 > unrolled thread
| Started by | Andrew Jeffery <andrew@aj.id.au> |
|---|---|
| First post | 2017-09-20 07:40 +0200 |
| Last post | 2017-09-20 08:20 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH v2 4/4] watchdog: aspeed: Move init to arch_initcall Andrew Jeffery <andrew@aj.id.au> - 2017-09-20 07:40 +0200
Re: [PATCH v2 4/4] watchdog: aspeed: Move init to arch_initcall Joel Stanley <joel@jms.id.au> - 2017-09-20 08:20 +0200
| From | Andrew Jeffery <andrew@aj.id.au> |
|---|---|
| Date | 2017-09-20 07:40 +0200 |
| Subject | [PATCH v2 4/4] watchdog: aspeed: Move init to arch_initcall |
| Message-ID | <urFTQ-79w-17@gated-at.bofh.it> |
Probing at device_initcall time lead to perverse cases where the
watchdog was probed after, say, I2C devices, which then leaves a
potentially running watchdog at the mercy of I2C device behaviour and
bus conditions.
Load the watchdog driver early to ensure that the kernel is patting it
well before initialising peripherals.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
---
drivers/watchdog/aspeed_wdt.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/drivers/watchdog/aspeed_wdt.c b/drivers/watchdog/aspeed_wdt.c
index 6c6dd3f4c48d..ca5b91e2eb92 100644
--- a/drivers/watchdog/aspeed_wdt.c
+++ b/drivers/watchdog/aspeed_wdt.c
@@ -316,7 +316,18 @@ static struct platform_driver aspeed_watchdog_driver = {
.of_match_table = of_match_ptr(aspeed_wdt_of_table),
},
};
-module_platform_driver(aspeed_watchdog_driver);
+
+static int __init aspeed_wdt_init(void)
+{
+ return platform_driver_register(&aspeed_watchdog_driver);
+}
+arch_initcall(aspeed_wdt_init);
+
+static void __exit aspeed_wdt_exit(void)
+{
+ platform_driver_unregister(&aspeed_watchdog_driver);
+}
+module_exit(aspeed_wdt_exit);
MODULE_DESCRIPTION("Aspeed Watchdog Driver");
MODULE_LICENSE("GPL");
--
2.11.0
[toc] | [next] | [standalone]
| From | Joel Stanley <joel@jms.id.au> |
|---|---|
| Date | 2017-09-20 08:20 +0200 |
| Message-ID | <urGwy-7DX-5@gated-at.bofh.it> |
| In reply to | #1735526 |
On Wed, Sep 20, 2017 at 3:00 PM, Andrew Jeffery <andrew@aj.id.au> wrote: > Probing at device_initcall time lead to perverse cases where the > watchdog was probed after, say, I2C devices, which then leaves a > potentially running watchdog at the mercy of I2C device behaviour and > bus conditions. > > Load the watchdog driver early to ensure that the kernel is patting it > well before initialising peripherals. > > Signed-off-by: Andrew Jeffery <andrew@aj.id.au> I agree that we need to make sure the watchdog driver is loaded earlier. I think this is the correct method, but I'll defer to Guenter on this one. Cheers, Joel
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web