Received: by 10.223.185.116 with SMTP id b49csp973137wrg; Wed, 21 Feb 2018 09:55:18 -0800 (PST) X-Google-Smtp-Source: AH8x2243Mi67dbhFF49IS7ACgJqIrb0s53iSx8jDsEjOl9MA0rKSkY9BeKw6w4p1ugBcTEg93XS1 X-Received: by 10.101.64.197 with SMTP id u5mr1288729pgp.23.1519235718580; Wed, 21 Feb 2018 09:55:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519235718; cv=none; d=google.com; s=arc-20160816; b=l9Krh2lh1AeQWdHYs7U3EuP9zqbYzKr8NL1NEW+V4DzS7ym8R12Ah7488oaoCzYBNY o8a/qpPFLtIDov8J/si5yGV1usFAh6uUYZfrOcUaSIoXM0vArobRbfXpS3DNx8lAyGSb FiQg+j6yerFph3ETE5aTvJl88iU3gyIV3pku1vfQfs41YD577nQVilEE1V1P1BfgfwJa 64cvkNveCR/jH6mNgbNpXkYD6euKCtIjb6OYFmy0qw5m8BsTXQbc/yZFNIAQZFwUjMvN eE6Fnk6CJzGPLNEbjnBr3WrwWXcmvivFo+linGSmnXAZ7M3AOQEOUFdlJP81mPYfWlvU gHjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=/PfMogpv8FnI1HE76417pMF3MrfecPkVV7ERajFE/3Q=; b=hasd2+Ma5YgRQemcE039DQmypqcIjJIsYKobVJaOg7a+2J8DNy0LrgGPadM/lEunv7 2+2z5DKapQ2PlNIMDOFaN02LZHXnLxDtoNBGH7UHwnmPa6zemmtXptTIDtdSX46xGcAK hBB+9c0cQNG3Bf3hBQ0jGkA9ORKPV30bJYtxhskE7sKkA1qmKGeTWaYoiYEZiCvjiupV CbcNrUH50xWNMLiJNV3cPtRBAqdFIwD5HXfmWEOikLY9qBS6ToLWG+9CX6UMvvXTt21T oIRAV/O/aKSMQaezfRcQjiSba7vMbu/ZrGmbL+auVmcbO+ZWL8kqClZgR0tvDkULF3yY FW2g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e7-v6si2646841plk.133.2018.02.21.09.55.04; Wed, 21 Feb 2018 09:55:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934701AbeBUM5e (ORCPT + 99 others); Wed, 21 Feb 2018 07:57:34 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:35790 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934650AbeBUM5b (ORCPT ); Wed, 21 Feb 2018 07:57:31 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 2F0C2E2F; Wed, 21 Feb 2018 12:57:31 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "yinbo.zhu" , Yangbo Lu , Adrian Hunter , Ulf Hansson , Rasmus Villemoes Subject: [PATCH 4.9 77/77] mmc: sdhci-of-esdhc: fix the mmc error after sleep on ls1046ardb Date: Wed, 21 Feb 2018 13:49:26 +0100 Message-Id: <20180221124435.417056678@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180221124432.172390020@linuxfoundation.org> References: <20180221124432.172390020@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: yinbo.zhu commit f2bc600008bd6f7f5d0b6b56238d14f95cd454d2 upstream. When system wakes up from sleep on ls1046ardb, the SD operation fails with mmc error messages since ESDHC_TB_EN bit couldn't be cleaned by eSDHC_SYSCTL[RSTA]. It's proper to clean this bit in esdhc_reset() rather than in probe. Signed-off-by: yinbo.zhu Acked-by: Yangbo Lu Acked-by: Adrian Hunter Signed-off-by: Ulf Hansson Cc: Rasmus Villemoes Signed-off-by: Greg Kroah-Hartman --- drivers/mmc/host/sdhci-of-esdhc.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) --- a/drivers/mmc/host/sdhci-of-esdhc.c +++ b/drivers/mmc/host/sdhci-of-esdhc.c @@ -489,10 +489,18 @@ static void esdhc_pltfm_set_bus_width(st static void esdhc_reset(struct sdhci_host *host, u8 mask) { + u32 val; + sdhci_reset(host, mask); sdhci_writel(host, host->ier, SDHCI_INT_ENABLE); sdhci_writel(host, host->ier, SDHCI_SIGNAL_ENABLE); + + if (mask & SDHCI_RESET_ALL) { + val = sdhci_readl(host, ESDHC_TBCTL); + val &= ~ESDHC_TB_EN; + sdhci_writel(host, val, ESDHC_TBCTL); + } } #ifdef CONFIG_PM_SLEEP @@ -584,10 +592,6 @@ static void esdhc_init(struct platform_d pltfm_host = sdhci_priv(host); esdhc = sdhci_pltfm_priv(pltfm_host); - val = sdhci_readl(host, ESDHC_TBCTL); - val &= ~ESDHC_TB_EN; - sdhci_writel(host, val, ESDHC_TBCTL); - host_ver = sdhci_readw(host, SDHCI_HOST_VERSION); esdhc->vendor_ver = (host_ver & SDHCI_VENDOR_VER_MASK) >> SDHCI_VENDOR_VER_SHIFT;