From: John Stultz <john.stultz@linaro.org>
To: Colin Cross <ccross@android.com>
Cc: Zoran Markovic <zoran.markovic@linaro.org>,
lkml <linux-kernel@vger.kernel.org>,
Linux PM list <linux-pm@vger.kernel.org>,
Android Kernel Team <kernel-team@android.com>,
Todd Poynor <toddpoynor@google.com>, San Mehat <san@google.com>,
Benoit Goby <benoit@android.com>, Pavel Machek <pavel@ucw.cz>,
"Rafael J. Wysocki" <rjw@sisk.pl>,
Len Brown <len.brown@intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [RFC PATCHv2 2/2] PM: compile-time configuration of device suspend/resume watchdogs.
Date: Mon, 13 May 2013 09:03:14 -0700 [thread overview]
Message-ID: <51910EC2.8090501@linaro.org> (raw)
In-Reply-To: <CAMbhsRT2rc5A3zeKA2Om+y-Kv2HVh0pa6YjQ9BLC2jBBfWfxsA@mail.gmail.com>
On 05/10/2013 11:23 PM, Colin Cross wrote:
> On Fri, May 10, 2013 at 2:28 PM, Zoran Markovic
> <zoran.markovic@linaro.org> wrote:
>> +#ifdef CONFIG_DPM_WD
>> +/**
>> + * dpm_wd_action - recovery from suspend/resume watchdog timeout
>> + * @wd: Watchdog. Must be allocated on the stack.
>> + */
>> +#if defined(CONFIG_DPM_WD_ACTION_STACKTRACE)
>> +static inline void dpm_wd_action(struct dpm_watchdog *wd)
>> +{
>> + show_stack(wd->tsk, NULL);
>> +}
>> +#elif defined(CONFIG_DPM_WD_ACTION_PANIC)
>> +static inline void dpm_wd_action(struct dpm_watchdog *wd)
>> +{
>> + panic("%s: unrecoverable failure\n", dev_name(wd->dev));
> The panic here is not very useful, it's going to print the stack of
> the task that was running when the timer fired which is likely to be
> the idle task if the suspend task is deadlocked. This should call
> show_stack and panic. If you take out the log action, then all this
> can stay inline with the handler and be:
>
> dev_emerg(wd->dev, "**** DPM device timeout ****\n");
> show_stack(wd->tsk, NULL);
> #ifdef CONFIG_DPM_WD_ACTION_PANIC
> panic("%s: unrecoverable failure\n", dev_name(wd->dev));
> #endif
#ifdefs in functions are usually to be avoided. Thus why I suggested he
use the config dependent dpm_wd_action() function to handle this.
thanks
-john
next prev parent reply other threads:[~2013-05-13 16:03 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-10 21:28 [RFC PATCHv2 0/2] power: device suspend/resume watchdog Zoran Markovic
2013-05-10 21:28 ` [RFC PATCHv2 1/2] drivers: power: Add watchdog timer to catch drivers which lockup during suspend/resume Zoran Markovic
2013-05-11 6:13 ` Colin Cross
2013-05-12 0:39 ` Rafael J. Wysocki
2013-05-12 19:15 ` Colin Cross
2013-05-13 11:26 ` Rafael J. Wysocki
2013-05-28 18:26 ` Zoran Markovic
2013-05-28 20:49 ` Rafael J. Wysocki
2013-05-31 21:13 ` Zoran Markovic
2013-06-05 22:17 ` Zoran Markovic
2013-06-05 22:29 ` Rafael J. Wysocki
2013-06-06 14:12 ` Alan Stern
2013-06-10 21:25 ` Colin Cross
2013-05-10 21:28 ` [RFC PATCHv2 2/2] PM: compile-time configuration of device suspend/resume watchdogs Zoran Markovic
2013-05-11 6:23 ` Colin Cross
2013-05-13 16:03 ` John Stultz [this message]
2013-05-11 9:28 ` Pavel Machek
2013-05-11 22:21 ` Colin Cross
2013-05-12 0:05 ` Pavel Machek
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=51910EC2.8090501@linaro.org \
--to=john.stultz@linaro.org \
--cc=benoit@android.com \
--cc=ccross@android.com \
--cc=gregkh@linuxfoundation.org \
--cc=kernel-team@android.com \
--cc=len.brown@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=pavel@ucw.cz \
--cc=rjw@sisk.pl \
--cc=san@google.com \
--cc=toddpoynor@google.com \
--cc=zoran.markovic@linaro.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;
as well as URLs for NNTP newsgroup(s).