Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759604AbbFBQmv (ORCPT ); Tue, 2 Jun 2015 12:42:51 -0400 Received: from bh-25.webhostbox.net ([208.91.199.152]:38789 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758907AbbFBQmo (ORCPT ); Tue, 2 Jun 2015 12:42:44 -0400 Message-ID: <556DDCFF.8000200@roeck-us.net> Date: Tue, 02 Jun 2015 09:42:39 -0700 From: Guenter Roeck User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: =?windows-1252?Q?Heiko_St=FCbner?= , Ulf Hansson , Alexandre Courbot , Marek Szyprowski CC: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: Usage of restart_handler in pwrseq_emmc References: <1789396.sexGZzDeEb@diego> In-Reply-To: <1789396.sexGZzDeEb@diego> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-Authenticated_sender: linux@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: authenticated_id: linux@roeck-us.net X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1474 Lines: 38 On 06/02/2015 08:29 AM, Heiko St?bner wrote: > Hi, > > I'm confused by the pwrseq-emmc registering a restart_handler for resetting an > emmc in a panic-reboot case at priority 129 to "schedules it just before > system reboot". > >>From what I remember from the restart-handler discussion the actuall usage is > traversing the ordered list until one registered handler sucessfully restarts > the system and not to have arbitary actions in there not related to the actual > restart process? > > The actual documentation in kernel/reboot.c supports this assumption, > describing register_restart_handler as "Register function to be called to > reset the system". > > > Additionally, 128 isn't even _the_ priority to reboot the system as described > above and some drivers use higher priorities per default, see in > drivers/power/reset arm-versatile-reboot.c; at91-reset.c; rmobile-reset.c and > some more. > > > So I guess this should use some other mechanism (reboot notifier) instead of > restart_handlers? > Looks like it. Assuming that a restart handler with priority 129 will always be executed is a bad idea, and having it do anything but restart the system is an even worse idea and is really asking for trouble. Guenter -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/