From: Sekhar Nori <nsekhar@ti.com>
To: "Kumar, Anil" <anilkumar.v@ti.com>
Cc: devicetree-discuss@lists.ozlabs.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
davinci-linux-open-source@linux.davincidsp.com,
linux@arm.linux.org.uk, khilman@deeprootsystems.com, hs@denx.de,
mporter@ti.com, broonie@opensource.wolfsonmicro.com,
mchehab@redhat.com, vaibhav.bedia@ti.com, b-cousson@ti.com,
tony@atomide.com, grant.likely@secretlab.ca,
rob.herring@calxeda.com
Subject: Re: [PATCH V2 2/2] ARM: davinci: restart: fix wdt to machine restart with DT
Date: Thu, 7 Feb 2013 23:45:53 +0530 [thread overview]
Message-ID: <5113EF59.80508@ti.com> (raw)
In-Reply-To: <1360123204-9978-3-git-send-email-anilkumar.v@ti.com>
On 2/6/2013 9:30 AM, Kumar, Anil wrote:
> In non DT case da8xx_register_watchdog() is called to register platform device
> "da8xx_wdt_device" by board file. But in DT case it is not called and wdt
> device get registered via wdt DT node.
>
> Currently code is passing platform device "da8xx_wdt_device" in
> "davinci_watchdog_reset" function in both DT and non DT case and that
> leads to crash in DT boot.
>
> Update restart function to make it generic DaVinci machine restart
s/DaVinci/da8xx. Also, subject can simply be "ARM: davinci: da850 DT:
add support for machine reboot" since reboot never worked with DT
before, "fix" isn't really appropriate.
> in case of DT and non DT boot.
>
> Signed-off-by: Kumar, Anil <anilkumar.v@ti.com>
> ---
> :100644 100644 2d5502d... 1df68fd... M arch/arm/mach-davinci/devices-da8xx.c
> :100644 100644 700d311... ef9f70e... M arch/arm/mach-davinci/include/mach/da8xx.h
> arch/arm/mach-davinci/devices-da8xx.c | 14 ++++++++++++--
> arch/arm/mach-davinci/include/mach/da8xx.h | 1 -
> 2 files changed, 12 insertions(+), 3 deletions(-)
>
> diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c
> index 2d5502d..1df68fd 100644
> --- a/arch/arm/mach-davinci/devices-da8xx.c
> +++ b/arch/arm/mach-davinci/devices-da8xx.c
> @@ -359,7 +359,7 @@ static struct resource da8xx_watchdog_resources[] = {
> },
> };
>
> -struct platform_device da8xx_wdt_device = {
> +static struct platform_device da8xx_wdt_device = {
Making of da8xx_wdt_device static should find a mention in description.
> .name = "watchdog",
> .id = -1,
> .num_resources = ARRAY_SIZE(da8xx_watchdog_resources),
> @@ -368,7 +368,17 @@ struct platform_device da8xx_wdt_device = {
>
> void da8xx_restart(char mode, const char *cmd)
> {
> - davinci_watchdog_reset(&da8xx_wdt_device);
> + struct device *dev = NULL;
> + struct platform_device *wdt_device = NULL;
No need to initialize these variables here.
> +
> + dev = bus_find_device_by_name(&platform_bus_type, NULL, "watchdog");
> + if (!dev) {
> + pr_err("wdt device not found to machine reboot\n");
Rather: "%s: failed to find watchdog device", __func__
Thanks,
Sekhar
next prev parent reply other threads:[~2013-02-07 18:15 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-06 4:00 [PATCH V2 0/2] ARM: davinci: da850: add wdt DT node Kumar, Anil
2013-02-06 4:00 ` [PATCH V2 1/2] " Kumar, Anil
[not found] ` <1360123204-9978-2-git-send-email-anilkumar.v-l0cyMroinI0@public.gmane.org>
2013-02-07 18:06 ` Sekhar Nori
[not found] ` <1360123204-9978-1-git-send-email-anilkumar.v-l0cyMroinI0@public.gmane.org>
2013-02-06 4:00 ` [PATCH V2 2/2] ARM: davinci: restart: fix wdt to machine restart with DT Kumar, Anil
2013-02-07 18:15 ` Sekhar Nori [this message]
[not found] ` <5113EF59.80508-l0cyMroinI0@public.gmane.org>
2013-02-08 3:04 ` Kumar, Anil
[not found] ` <F3DBB1B3EF102E4994C89758CFCA32412C59EA-Er742YJ7I/eIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
2013-02-09 17:23 ` Sekhar Nori
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=5113EF59.80508@ti.com \
--to=nsekhar@ti.com \
--cc=anilkumar.v@ti.com \
--cc=b-cousson@ti.com \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=davinci-linux-open-source@linux.davincidsp.com \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=grant.likely@secretlab.ca \
--cc=hs@denx.de \
--cc=khilman@deeprootsystems.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=mchehab@redhat.com \
--cc=mporter@ti.com \
--cc=rob.herring@calxeda.com \
--cc=tony@atomide.com \
--cc=vaibhav.bedia@ti.com \
/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).