From: Guenter Roeck <linux@roeck-us.net>
To: One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk>,
Harini Katakam <harinik@xilinx.com>
Cc: grant.likely@linaro.org, robh+dt@kernel.org, pawel.moll@arm.com,
mark.rutland@arm.com, ijc+devicetree@hellion.org.uk,
galak@codeaurora.org, rob@landley.net, michals@xilinx.com,
linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org,
devicetree@vger.kernel.org, linux-doc@vger.kernel.org
Subject: Re: [PATCH 1/2] watchdog: Add Cadence WDT driver
Date: Mon, 31 Mar 2014 17:24:26 -0700 [thread overview]
Message-ID: <533A073A.6060807@roeck-us.net> (raw)
In-Reply-To: <20140331113020.03be6894@alan.etchedpixels.co.uk>
On 03/31/2014 03:30 AM, One Thousand Gnomes wrote:
>
>> + wdt->cdns_wdt_notifier.notifier_call = &cdns_wdt_notify_sys;
>> + /* Register the reboot notifier */
>> + ret = register_reboot_notifier(&wdt->cdns_wdt_notifier);
>> + if (ret != 0) {
>> + dev_err(&pdev->dev, "cannot register reboot notifier err=%d)\n",
>> + ret);
>> + return ret;
>
> Your ordering is wrong. If the box reboots between here and the spin lock
> in it further down it'll crash in your notifier.
>
Not only that, the callback also ends up using watchdog_get_drvdata()
which is only set after registering the notifier.
Guenter
> As
>
>> + spin_lock_init(&wdt->io_lock);
>
> is needed before the code your notifier calls will work.
>
>> + dev_info(&pdev->dev, "Xilinx Watchdog Timer at %p with timeout %ds%s\n",
>> + wdt->regs, cdns_wdt_device->timeout,
>> + nowayout ? ", nowayout" : "");
>
> dev_dbg
>
> if every driver felt the need to announce itself on boot you'd have pages
> and pages of junk.
>
> Alan
> --
> To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
next prev parent reply other threads:[~2014-04-01 0:24 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-28 10:31 [PATCH 1/2] watchdog: Add Cadence WDT driver Harini Katakam
2014-03-28 10:32 ` [PATCH 2/2] devicetree: Add Cadence WDT devicetree bindings documentation Harini Katakam
2014-03-31 10:30 ` [PATCH 1/2] watchdog: Add Cadence WDT driver One Thousand Gnomes
2014-04-01 0:24 ` Guenter Roeck [this message]
2014-04-01 0:32 ` Guenter Roeck
2014-04-01 7:35 ` Harini Katakam
2014-04-01 11:20 ` Michal Simek
2014-04-02 0:32 ` Guenter Roeck
2014-04-02 5:47 ` Michal Simek
-- strict thread matches above, loose matches on Subject: below --
2014-03-28 10:36 Harini Katakam
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=533A073A.6060807@roeck-us.net \
--to=linux@roeck-us.net \
--cc=devicetree@vger.kernel.org \
--cc=galak@codeaurora.org \
--cc=gnomes@lxorguk.ukuu.org.uk \
--cc=grant.likely@linaro.org \
--cc=harinik@xilinx.com \
--cc=ijc+devicetree@hellion.org.uk \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=michals@xilinx.com \
--cc=pawel.moll@arm.com \
--cc=rob@landley.net \
--cc=robh+dt@kernel.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