Received: by 10.223.185.116 with SMTP id b49csp698329wrg; Wed, 21 Feb 2018 05:35:28 -0800 (PST) X-Google-Smtp-Source: AH8x225HQLZmHSk6qpWbUyeVNXMArqfAHqUlCzvOTVYlP7wIAVwlMkouNHM5G9kksbXjkL6CyFbj X-Received: by 2002:a17:902:c24:: with SMTP id 33-v6mr3217603pls.24.1519220128763; Wed, 21 Feb 2018 05:35:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519220128; cv=none; d=google.com; s=arc-20160816; b=Tq9GGQiLJ7UeT7IaEek4c47pLYUZOyDmkc3RFwczrL5NPyHky2AFwQHuguChHxIPS8 QfYmNcjNiYVt5rZJEeY2Dtf7U/yF39W1a9aglHIyAZ8NSUtoVqNipaE9fQEvIVbejarZ /4ofEg0Imrl6s6Os1HYAbKKZWhrOqNXVueC2Pi7elzXDJSvLxFBFe5CslvwKrCqSzePp YEnoQjbZy9ceLQf1ub026T2mhW1G7bM51NziV+IZYdgMYikLV4Xh98zaqIoERkO5T40J KuMvzyKMVOVyIwns8/+kRboFyapEXS05900FyToXBT5wOHXhg7SrfgEJjyMOraUkhysX JlNQ== 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=1tM63cIlhnrPG1+r8Q9DMmOd5/KZKehmOodDv80CQxk=; b=N1YIeQ5VDhd1pf61VgDJAvgkSnITCpHVe1LKwuuacE8u8O568HlsGahD3Wd75Iif4s hWi46dfvHCQGgXguWo1YB1XnBANO3XWTxJVMNzFvBUKtmbkUPgOJSA+iUDoY6tmfRWXL 241lLpj22rr/A3OcHS39aM0IxX1QRKFpI48S9RoTyhPtr7O2ULa8MjxubUMi5PP+GHSq VDksVfI/CZRmdpFLMpDiiWnahp4R/xfwpDkdAFidXUfFg+fUcVJbxW7BSjGxQFfAxJCS aO5gpRwty2P+N7A20J1a6++jxHcuDhF/8G1rrOiQ+qFi48CDgb2I1AdcI43ZwV0yhn8n dipA== 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 z7si2767939pgv.91.2018.02.21.05.35.14; Wed, 21 Feb 2018 05:35:28 -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 S936490AbeBUNP2 (ORCPT + 99 others); Wed, 21 Feb 2018 08:15:28 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:45958 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965693AbeBUNNL (ORCPT ); Wed, 21 Feb 2018 08:13:11 -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 512C210A2; Wed, 21 Feb 2018 13:13:10 +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.15 163/163] mmc: sdhci-of-esdhc: fix the mmc error after sleep on ls1046ardb Date: Wed, 21 Feb 2018 13:49:52 +0100 Message-Id: <20180221124538.908072794@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180221124529.931834518@linuxfoundation.org> References: <20180221124529.931834518@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.15-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 @@ -589,10 +589,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); + } } /* The SCFG, Supplemental Configuration Unit, provides SoC specific @@ -785,10 +793,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;