Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752047AbbFCKB0 (ORCPT ); Wed, 3 Jun 2015 06:01:26 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:54937 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750955AbbFCKBS (ORCPT ); Wed, 3 Jun 2015 06:01:18 -0400 MIME-version: 1.0 Content-type: text/plain; charset=utf-8; format=flowed X-AuditID: cbfec7f4-f79c56d0000012ee-85-556ed06be40b Content-transfer-encoding: 8BIT Message-id: <556ED06B.9030601@samsung.com> Date: Wed, 03 Jun 2015 12:01:15 +0200 From: Marek Szyprowski User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 To: =?UTF-8?B?SGVpa28gU3TDvGJuZXI=?= , Ulf Hansson , Alexandre Courbot , Guenter Roeck 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> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrKLMWRmVeSWpSXmKPExsVy+t/xK7rZF/JCDWY/sLT4/vAUq8X/R69Z LS7vmsNmceR/P6PFk4VnmCyOrw13YPO4c20Pm0dv8zs2j53fG9g9tl+bx+zxeZNcAGsUl01K ak5mWWqRvl0CV8bvoz+ZCo7xVuz7MZG9gfE/VxcjJ4eEgInEj2cfmSBsMYkL99azdTFycQgJ LGWUePzlFztIgldAUOLH5HssXYwcHMwC8hJHLmWDhJkFzCS+vDzMClH/nFFi1eF2Foh6LYkP 666CDWURUJU40fkCzGYTMJToetvFBmKLCsRI9G3tZQZpFhFYyyjx+9QMRoip1hI/f7SygtjC QNet23mSGcQWElCTuPH5HVicU0BdYt7lxawTGAVmIblvFsJ9s5Dct4CReRWjaGppckFxUnqu oV5xYm5xaV66XnJ+7iZGSGB/2cG4+JjVIUYBDkYlHt4ZEXmhQqyJZcWVuYcYJTiYlUR4b50F CvGmJFZWpRblxxeV5qQWH2KU5mBREuedu+t9iJBAemJJanZqakFqEUyWiYNTqoGx299auG/y ZafOAzd6D0rOUvPk5JiTy2ie+/yUtvi/LpMTkj5CReHL/vAv/Veje3u51MrmubOeRpaoSp77 UWq/pPDnrXYVhsWPYzza+j+9cq8+elzXe8Kl/TPP9HutbO962CkSzaPE9OuKmpNv51yJRTtn /Vg6U1A95NkHcXmm/2d/bn4yp2W3EktxRqKhFnNRcSIATUkPEGgCAAA= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1931 Lines: 53 Hello, On 2015-06-02 17:29, Heiko Stübner wrote: > 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? The first problem with reboot notifiers is that they are called too early - before device_shutdown(), what interferes with the code in mmc_bus_shutdown and causes lockup. The second problem is that reboot notifiers are not called from emergency_restart() path. I agree that 129 value for priority might not be the best, maybe according to documentation, 255 value should be used to ensure that the handler will be called first before any real restart handler. If you have any idea how to avoid restart handler and ensure proper eMMC card reboot sequence on any system reboot, I'm open for suggestions. Best regards -- Marek Szyprowski, PhD Samsung R&D Institute Poland -- 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/