From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932360AbbJVAgL (ORCPT ); Wed, 21 Oct 2015 20:36:11 -0400 Received: from mailout4.w1.samsung.com ([210.118.77.14]:64445 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755585AbbJVAgI (ORCPT ); Wed, 21 Oct 2015 20:36:08 -0400 X-AuditID: cbfec7f5-f794b6d000001495-c8-56282f7260e0 Subject: Re: [PATCH] mmc: pwrseq: Use highest priority for eMMC restart handler To: Javier Martinez Canillas , linux-kernel@vger.kernel.org References: <1445440540-21525-1-git-send-email-javier@osg.samsung.com> Cc: Markus Reichl , Anand Moon , linux-samsung-soc@vger.kernel.org, Alim Akhtar , Marek Szyprowski , linux-mmc@vger.kernel.org, Alexandre Courbot , Ulf Hansson From: Krzysztof Kozlowski X-Enigmail-Draft-Status: N1110 Message-id: <56282F71.2070408@samsung.com> Date: Thu, 22 Oct 2015 09:36:01 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-version: 1.0 In-reply-to: <1445440540-21525-1-git-send-email-javier@osg.samsung.com> Content-type: text/plain; charset=windows-1252 Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpkkeLIzCtJLcpLzFFi42I5/e/4Nd0ifY0wg22PVC2+PzzFavFg3jY2 izdv1zBZvH5haHF51xw2iyP/+xktZpzfx2SxbuMtdouXR34wWqw9cpfd4vjacAduj1t36j12 zrrL7nHn2h42j97md2weW/qB3L4tqxg9Pm+SC2CP4rJJSc3JLEst0rdL4MpY0z6VpeCtaMXJ TUsZGxjvCXYxcnJICJhInHt5nhHCFpO4cG89WxcjF4eQwFJGicnzzjFCOF8YJdr3XmEHqRIW 8JdY8aADzBYRCJX4d/E2WLeQgJvE5i+7wLqZBbYySexY8JwJJMEmYCyxefkSNogVchK93ZNY uhg5OHgFtCT+3XEGCbMIqEpMOzyZBcQWFYiQmDihgRXE5hUQlPgx+R5YnFPAXWL2rsdMIK3M AnoS9y9qgYSZBeQlNq95yzyBUXAWko5ZCFWzkFQtYGRexSiaWppcUJyUnmukV5yYW1yal66X nJ+7iRESMV93MC49ZnWIUYCDUYmHV+O/epgQa2JZcWXuIUYJDmYlEd5H2hphQrwpiZVVqUX5 8UWlOanFhxilOViUxHln7nofIiSQnliSmp2aWpBaBJNl4uCUamDc1ZfmqNFcbHLguH2QWK/s AXupSZdurpjX/XHv6TPrkldWLZmy7O+EGZdO3Zos4VY3s/TTUxGGx0s+/dg5aV3rHkVVz3Ph XFInnU+fUzxwY0IA78aA1pUiD198rFv+1IpJ/PLjnzVij6S1Zs2Zw/yuNsqqJMw96/YBI4tV i886XV9Wa/+6xi1jixJLcUaioRZzUXEiACUenteUAgAA Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 22.10.2015 00:15, Javier Martinez Canillas wrote: > The pwrseq_emmc driver does a eMMC card reset before a system reboot to > allow broken or limited ROM boot-loaders (that don't have an eMMC reset > logic) to be able to read the second stage from the eMMC. > > But this has to be called before a system reboot handler and while most > of them use the priority 128, there are other restart handlers (such as > the syscon-reboot one) that use a higher priority. So, use the highest > priority to make sure that the eMMC hw is reset before a system reboot. > > Signed-off-by: Javier Martinez Canillas > Tested-by: Markus Reichl > Tested-by: Anand Moon > Reviewed-by: Alim Akhtar > > --- > Hello, > > This patch was needed since a recent series from Alim [0] added > syscon reboot and poweroff support to Exynos SoCs and removed > the reset handler in the Exynos Power Management Unit (PMU) code. > > But the PMU and syscon-reboot restart handler have a different > priority so [0] breaks restart when eMMC is used on these boards. > > [0]: http://www.spinics.net/lists/arm-kernel/msg454396.html > > So this patch must be merged before [0] to avoid regressions. > > Best regards, > Javier > > drivers/mmc/core/pwrseq_emmc.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/mmc/core/pwrseq_emmc.c b/drivers/mmc/core/pwrseq_emmc.c > index 137c97fb7aa8..ad4f94ec7e8d 100644 > --- a/drivers/mmc/core/pwrseq_emmc.c > +++ b/drivers/mmc/core/pwrseq_emmc.c > @@ -84,11 +84,11 @@ struct mmc_pwrseq *mmc_pwrseq_emmc_alloc(struct mmc_host *host, > > /* > * register reset handler to ensure emmc reset also from > - * emergency_reboot(), priority 129 schedules it just before > - * system reboot > + * emergency_reboot(), priority 255 is the highest priority > + * so it will be executed before any system reboot handler. > */ > pwrseq->reset_nb.notifier_call = mmc_pwrseq_emmc_reset_nb; > - pwrseq->reset_nb.priority = 129; > + pwrseq->reset_nb.priority = 255; I see the problem which you are trying to solve but this may be tricker then just kicking the number. Some of restart handlers are registered with priority 192. I found few of such, like: at91_restart_nb, zynq_slcr_restart_nb, rmobile_reset_nb (maybe more, I did not grep too much). I guess they chose the "192" priority on purpose. Effectively, now the emmc handler will be executed before their handlers... is it an issue? Maybe some testing on these platforms is necessary? Best regards, Krzysztof > register_restart_handler(&pwrseq->reset_nb); > > pwrseq->pwrseq.ops = &mmc_pwrseq_emmc_ops; >