From: Sebastian Reichel <sre@kernel.org>
To: Jun Nie <jun.nie@linaro.org>
Cc: Haojian Zhuang <haojian.zhuang@linaro.org>,
Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>,
David Woodhouse <dwmw2@infradead.org>,
linux-pm@vger.kernel.org, Shawn Guo <shawn.guo@linaro.org>,
"wan.zhijun" <wan.zhijun@zte.com.cn>,
Jason Liu <jason.liu@linaro.org>
Subject: Re: [PATCH v2] power/reset: zx: Register restart handler
Date: Tue, 14 Jul 2015 08:27:26 +0200 [thread overview]
Message-ID: <20150714062725.GA3915@earth> (raw)
In-Reply-To: <CABymUCPmXH2VhU-rtpuq2eavbb1oAzAk_6gXqSPBJCvPcF5ZrA@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1074 bytes --]
Hi,
On Tue, Jul 14, 2015 at 09:42:39AM +0800, Jun Nie wrote:
> 2015-07-13 20:00 GMT+08:00 Sebastian Reichel <sre@kernel.org>:
> > On Mon, Jul 06, 2015 at 04:35:30PM +0800, Jun Nie wrote:
> >> Register with kernel restart handler instead of setting arm_pm_restart
> >> directly.
> >>
> >> [...]
> >>
> >> +static int zx_restart_handler(struct notifier_block *this,
> >> + unsigned long mode, void *cmd)
> >> +{
> >> + writel_relaxed(1, base + 0xb0);
> >> + writel_relaxed(1, pcu_base + 0x34);
> >> +
> >> + while (1)
> >> + cpu_do_idle();
> >
> > mdelay(some_time);
> > pr_emerg("Unable to restart system\n");
>
> I do not think these code can be executed as reset will happen after
> register writing and while loop will stop any further code execution.
> Please point out issue if any.
Please remove the while loop. Instead wait for a reasonable amount
of time. If something goes wrong print an error message and return
NOTIFY_DONE. You can see an example in syscon-reboot.c
-- Sebastian
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
prev parent reply other threads:[~2015-07-14 6:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-06 8:35 [PATCH v2] power/reset: zx: Register restart handler Jun Nie
2015-07-13 12:00 ` Sebastian Reichel
2015-07-14 1:42 ` Jun Nie
2015-07-14 6:27 ` Sebastian Reichel [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=20150714062725.GA3915@earth \
--to=sre@kernel.org \
--cc=dbaryshkov@gmail.com \
--cc=dwmw2@infradead.org \
--cc=haojian.zhuang@linaro.org \
--cc=jason.liu@linaro.org \
--cc=jun.nie@linaro.org \
--cc=linux-pm@vger.kernel.org \
--cc=shawn.guo@linaro.org \
--cc=wan.zhijun@zte.com.cn \
/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).