public inbox for linux-watchdog@vger.kernel.org
 help / color / mirror / Atom feed
From: "Måns Rullgård" <mans@mansr.com>
To: Lars-Peter Clausen <lars@metafoo.de>
Cc: Guenter Roeck <linux@roeck-us.net>,
	Ralf Baechle <ralf@linux-mips.org>,
	Wim Van Sebroeck <wim@iguana.be>,
	Paul Burton <paul.burton@imgtec.com>,
	Paul Cercueil <paul@crapouillou.net>,
	Maarten ter Huurne <maarten@treewalker.org>,
	linux-mips@linux-mips.org, linux-watchdog@vger.kernel.org
Subject: Re: [PATCH 1/3] MIPS: Use do_kernel_restart() as the default restart handler
Date: Sun, 11 Jan 2015 12:45:08 +0000	[thread overview]
Message-ID: <yw1x4mrxfpuz.fsf@unicorn.mansr.com> (raw)
In-Reply-To: <54B26F5C.8050202@metafoo.de> (Lars-Peter Clausen's message of "Sun, 11 Jan 2015 13:41:00 +0100")

Lars-Peter Clausen <lars@metafoo.de> writes:

> On 01/11/2015 01:30 PM, Måns Rullgård wrote:
>> Lars-Peter Clausen <lars@metafoo.de> writes:
>>
>>> On 01/11/2015 01:15 PM, Måns Rullgård wrote:
>>>> Guenter Roeck <linux@roeck-us.net> writes:
>>>>
>>>>> On 01/10/2015 12:08 PM, Måns Rullgård wrote:
>>>>>> Lars-Peter Clausen <lars@metafoo.de> writes:
>>>>>>
>>>>>>> Use the recently introduced do_kernel_restart() function as the default restart
>>>>>>> handler if the platform did not explicitly provide a restart handler. This
>>>>>>> allows use restart handler that have been registered by device drivers to
>>>>>>> restart the machine.
>>>>>>>
>>>>>>> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
>>>>>>> ---
>>>>>>>     arch/mips/kernel/reset.c |    2 +-
>>>>>>>     1 file changed, 1 insertion(+), 1 deletion(-)
>>>>>>>
>>>>>>> diff --git a/arch/mips/kernel/reset.c b/arch/mips/kernel/reset.c
>>>>>>> index 07fc524..36cd80c 100644
>>>>>>> --- a/arch/mips/kernel/reset.c
>>>>>>> +++ b/arch/mips/kernel/reset.c
>>>>>>> @@ -19,7 +19,7 @@
>>>>>>>      * So handle all using function pointers to machine specific
>>>>>>>      * functions.
>>>>>>>      */
>>>>>>> -void (*_machine_restart)(char *command);
>>>>>>> +void (*_machine_restart)(char *command) = do_kernel_restart;
>>>>>>>     void (*_machine_halt)(void);
>>>>>>>     void (*pm_power_off)(void);
>>>>>>
>>>>>> There is already a similar patch posted by Kevin Cernekee:
>>>>>> http://www.linux-mips.org/archives/linux-mips/2014-12/msg00410.html
>>>>>>
>>>>> Personally I prefer the earlier patch, though I guess that is personal
>>>>> preference.
>>>>
>>>> They both achieve the same thing, though Kevin's is more in line with
>>>> what ARM does.  Missing from both is a fallback while(1) loop in case no
>>>> restart handlers are registered.  With the restart moved to the watchdog
>>>> driver, there's a possibility that this might happen.
>>>>
>>>
>>> In my opinion if such a fallback is needed it should be put into the
>>> kernel core reboot implementation and not into individual restart
>>> handler implementations.
>>>
>>> My first version of this patch was do_kernel_restart() followed by a
>>> machine_halt() (so it goes to sleep instead of busy looping) as a
>>> fallback. But I couldn't find a good reason why that should be done at
>>> the individual restart handler level, so I dropped it.
>>
>> ARM does it its arch machine_restart() function.  MIPS should probably
>> follow suit.
>>
>
> That's just cargo culting...

True.

> Either it is required, then it should probably be moved into the core
> kernel, or it is not required in which case it can be removed from the
> ARM machine_restart() implementation.

The quickest way to find out is probably to send a patch adding such
code to the end of kernel_restart().

-- 
Måns Rullgård
mans@mansr.com

  reply	other threads:[~2015-01-11 12:45 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-10 18:29 [PATCH 1/3] MIPS: Use do_kernel_restart() as the default restart handler Lars-Peter Clausen
2015-01-10 18:29 ` [PATCH 2/3] MIPS: qi_lb60: Register watchdog device Lars-Peter Clausen
2015-01-11  1:24   ` Guenter Roeck
2015-01-11  1:37     ` Maarten ter Huurne
2015-01-11 16:17       ` Guenter Roeck
2015-01-10 18:29 ` [PATCH 3/3] MIPS: jz4740: Move reset code to the watchdog driver Lars-Peter Clausen
2015-01-11  1:18   ` Guenter Roeck
2015-01-11  1:43     ` Maarten ter Huurne
2015-01-11  9:41       ` Lars-Peter Clausen
2015-01-11 16:16         ` Guenter Roeck
2015-01-10 20:08 ` [PATCH 1/3] MIPS: Use do_kernel_restart() as the default restart handler Måns Rullgård
2015-01-11  1:19   ` Guenter Roeck
2015-01-11 12:15     ` Måns Rullgård
2015-01-11 12:25       ` Lars-Peter Clausen
2015-01-11 12:30         ` Måns Rullgård
2015-01-11 12:41           ` Lars-Peter Clausen
2015-01-11 12:45             ` Måns Rullgård [this message]
2015-01-11 16:13         ` Guenter Roeck

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=yw1x4mrxfpuz.fsf@unicorn.mansr.com \
    --to=mans@mansr.com \
    --cc=lars@metafoo.de \
    --cc=linux-mips@linux-mips.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=maarten@treewalker.org \
    --cc=paul.burton@imgtec.com \
    --cc=paul@crapouillou.net \
    --cc=ralf@linux-mips.org \
    --cc=wim@iguana.be \
    /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