public inbox for linux-aspeed@lists.ozlabs.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: linux-aspeed@lists.ozlabs.org
Subject: [v2,4/4] watchdog: aspeed: Move init to arch_initcall
Date: Sun, 22 Oct 2017 09:13:33 -0700	[thread overview]
Message-ID: <20171022161333.GA20816@roeck-us.net> (raw)
In-Reply-To: <20170920053020.6860-5-andrew@aj.id.au>

On Wed, Sep 20, 2017 at 03:00:20PM +0930, Andrew Jeffery 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>

At some point we'll need to come up with a generic means to handle those
situations. Until then, I don't have a better idea.

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  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");

      parent reply	other threads:[~2017-10-22 16:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-20  5:30 [PATCH v2 0/4] watchdog: aspeed: Retain enabled state and move to arch_initcall Andrew Jeffery
2017-09-20  5:30 ` [PATCH v2 1/4] watchdog: aspeed: Retain watchdog enabled state Andrew Jeffery
2017-09-20  6:07   ` Joel Stanley
2017-10-22 16:09   ` [v2,1/4] " Guenter Roeck
2017-09-20  5:30 ` [PATCH v2 2/4] watchdog: aspeed: Fix 'Apseed' typo in Kconfig Andrew Jeffery
2017-09-20  6:07   ` Joel Stanley
2017-09-20  5:30 ` [PATCH v2 3/4] watchdog: aspeed: Remove specific reference to AST2400 " Andrew Jeffery
2017-09-20  6:08   ` Joel Stanley
2017-09-20  5:30 ` [PATCH v2 4/4] watchdog: aspeed: Move init to arch_initcall Andrew Jeffery
2017-09-20  6:13   ` Joel Stanley
2017-10-17 11:35     ` Andrew Jeffery
2017-10-22 16:22       ` Guenter Roeck
2017-10-22 16:13   ` Guenter Roeck [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171022161333.GA20816@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=linux-aspeed@lists.ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox