From patchwork Wed Oct 21 15:15:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Martinez Canillas X-Patchwork-Id: 7457401 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8A375BEEA4 for ; Wed, 21 Oct 2015 15:16:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A96292052F for ; Wed, 21 Oct 2015 15:16:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7018520874 for ; Wed, 21 Oct 2015 15:16:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755328AbbJUPPv (ORCPT ); Wed, 21 Oct 2015 11:15:51 -0400 Received: from lists.s-osg.org ([54.187.51.154]:42156 "EHLO lists.s-osg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755320AbbJUPPu (ORCPT ); Wed, 21 Oct 2015 11:15:50 -0400 Received: from localhost.localdomain (211.178.21.95.dynamic.jazztel.es [95.21.178.211]) by lists.s-osg.org (Postfix) with ESMTPSA id 0405346269; Wed, 21 Oct 2015 08:15:46 -0700 (PDT) From: Javier Martinez Canillas To: linux-kernel@vger.kernel.org Cc: Markus Reichl , Anand Moon , linux-samsung-soc@vger.kernel.org, Krzysztof Kozlowski , Alim Akhtar , Javier Martinez Canillas , Marek Szyprowski , linux-mmc@vger.kernel.org, Alexandre Courbot , Ulf Hansson Subject: [PATCH] mmc: pwrseq: Use highest priority for eMMC restart handler Date: Wed, 21 Oct 2015 17:15:40 +0200 Message-Id: <1445440540-21525-1-git-send-email-javier@osg.samsung.com> X-Mailer: git-send-email 2.4.3 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Tested-by: Douglas Anderson --- 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; register_restart_handler(&pwrseq->reset_nb); pwrseq->pwrseq.ops = &mmc_pwrseq_emmc_ops;