From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from unicorn.mansr.com ([81.2.72.234]:60193 "EHLO unicorn.mansr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750922AbbAKMao convert rfc822-to-8bit (ORCPT ); Sun, 11 Jan 2015 07:30:44 -0500 From: =?iso-8859-1?Q?M=E5ns_Rullg=E5rd?= To: Lars-Peter Clausen Cc: Guenter Roeck , Ralf Baechle , Wim Van Sebroeck , Paul Burton , Paul Cercueil , Maarten ter Huurne , 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 References: <1420914550-18335-1-git-send-email-lars@metafoo.de> <54B1CF9B.3060606@roeck-us.net> <54B26BB4.50707@metafoo.de> Date: Sun, 11 Jan 2015 12:30:42 +0000 In-Reply-To: <54B26BB4.50707@metafoo.de> (Lars-Peter Clausen's message of "Sun, 11 Jan 2015 13:25:24 +0100") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Sender: linux-watchdog-owner@vger.kernel.org List-Id: linux-watchdog@vger.kernel.org Lars-Peter Clausen writes: > On 01/11/2015 01:15 PM, M=E5ns Rullg=E5rd wrote: >> Guenter Roeck writes: >> >>> On 01/10/2015 12:08 PM, M=E5ns Rullg=E5rd wrote: >>>> Lars-Peter Clausen writes: >>>> >>>>> Use the recently introduced do_kernel_restart() function as the d= efault restart >>>>> handler if the platform did not explicitly provide a restart hand= ler. This >>>>> allows use restart handler that have been registered by device dr= ivers to >>>>> restart the machine. >>>>> >>>>> Signed-off-by: Lars-Peter Clausen >>>>> --- >>>>> 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) =3D 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.htm= l >>>> >>> Personally I prefer the earlier patch, though I guess that is perso= nal >>> preference. >> >> They both achieve the same thing, though Kevin's is more in line wit= h >> what ARM does. Missing from both is a fallback while(1) loop in cas= e no >> restart handlers are registered. With the restart moved to the watc= hdog >> 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 a= t > the individual restart handler level, so I dropped it. ARM does it its arch machine_restart() function. MIPS should probably follow suit. --=20 M=E5ns Rullg=E5rd mans@mansr.com -- To unsubscribe from this list: send the line "unsubscribe linux-watchdo= g" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html