Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp17926093ybl; Thu, 2 Jan 2020 14:57:55 -0800 (PST) X-Google-Smtp-Source: APXvYqzArC1aA2hbp1bIE3BYa/dUGbHjkXCV01vIO24CebLZcXR4MXo+jt3PY0+kzyobbsl2RKHm X-Received: by 2002:a9d:470a:: with SMTP id a10mr39298540otf.370.1578005875846; Thu, 02 Jan 2020 14:57:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578005875; cv=none; d=google.com; s=arc-20160816; b=jAiacd5vLQ3gAvEN3v31RT9PiM7hGMEfHcpnEfu1uowTmR+UrONomVbT+Wy0GEtQEr rZJ66vUKjOq0+h+fvRf41+FgHLicrXlry31vjNNh7t5reJxmibJhT213/1vp4rHs3Ww3 49DBCGXVhF/wng4PlFHf2/QtsiJmpxXz4rEsKbbUo0XQ5Sgv3RF+2KOw5wdto7wGrzUr qHAh03x0VobNSAyaR0RnqLmsnQawD0X08rBd13bLqa31MwCXR2+viOpbmlSyM6eXf5yv JjQdnDl2QUFAy3AR+X2ztAenDb7sbTWJBdKkMDcjTadcP7QORONyUYK0aD//6cb7VS9h ygcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=zmTsUvG1NzZ81itOTEuvHhcacTZJFXCy4TEw9IUK6LM=; b=ei1NgN6c261ny+K7+DdNondAgOTrw1L5K6GmHTn+J7B4eDpBRV3gW92TwcEg5V2kFq BjAFkihWh6GCbWSoPqsCrr7/KCrG7S0rcRvdOxLkRm1+wyfxwOua9/5GVxCU66m5fzpJ TWNfUOdHDZ3AXH4zQTYSV54syu/3VO6vhApLMH9tZOgRrYftl6w6A4lGp7BgvH3wTEwT 41nCd0Z0BuZbsxTPBBGXsJxavxoTnIxNY++c8/uKRxg7CjxcA5xVN2KUfMIsZjvvBdYB vitPugrdw/1PoUpEj/uqdT23Ud0r3en8g3TdVDJOZz0fONVzz2rWEw00413hEMp9y2VR p+mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Qs65n6Ae; 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 s128si27134770oig.204.2020.01.02.14.57.44; Thu, 02 Jan 2020 14:57:55 -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; dkim=pass header.i=@kernel.org header.s=default header.b=Qs65n6Ae; 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 S1728145AbgABWSg (ORCPT + 99 others); Thu, 2 Jan 2020 17:18:36 -0500 Received: from mail.kernel.org ([198.145.29.99]:33856 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728470AbgABWSc (ORCPT ); Thu, 2 Jan 2020 17:18:32 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C2F7322B48; Thu, 2 Jan 2020 22:18:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578003512; bh=okv38Ret50vgljluGPpeQLZqSgaaVFFyHEQwC3S3k44=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Qs65n6AeHHjfKA9dvWgB0EZ/ch71JHe05mryPCl2cBZlwUCaNl7SLTw0Ve3wqFByS cdS8Y00avTjlWLZcOa2+SortO/YybuL/ZwcUf8BbwbUZ03+X40oSHNAi/FHyvyAVqX jXh9snhQ380V5nFTjbgUahInYgVBJNEFO5XQqANo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yangbo Lu , Ulf Hansson , Sasha Levin Subject: [PATCH 5.4 191/191] mmc: sdhci-of-esdhc: re-implement erratum A-009204 workaround Date: Thu, 2 Jan 2020 23:07:53 +0100 Message-Id: <20200102215850.119555468@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200102215829.911231638@linuxfoundation.org> References: <20200102215829.911231638@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yangbo Lu [ Upstream commit f667216c5c7c967c3e568cdddefb51fe606bfe26 ] The erratum A-009204 workaround patch was reverted because of incorrect implementation. 8b6dc6b mmc: sdhci-of-esdhc: Revert "mmc: sdhci-of-esdhc: add erratum A-009204 support" This patch is to re-implement the workaround (add a 5 ms delay before setting SYSCTL[RSTD] to make sure all the DMA transfers are finished). Signed-off-by: Yangbo Lu Link: https://lore.kernel.org/r/20191219032335.26528-1-yangbo.lu@nxp.com Fixes: 5dd195522562 ("mmc: sdhci-of-esdhc: add erratum A-009204 support") Cc: stable@vger.kernel.org Signed-off-by: Ulf Hansson Signed-off-by: Sasha Levin --- drivers/mmc/host/sdhci-of-esdhc.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/mmc/host/sdhci-of-esdhc.c b/drivers/mmc/host/sdhci-of-esdhc.c index 14f0cb7fa374..fcfb50f84c8b 100644 --- a/drivers/mmc/host/sdhci-of-esdhc.c +++ b/drivers/mmc/host/sdhci-of-esdhc.c @@ -80,6 +80,7 @@ struct sdhci_esdhc { bool quirk_tuning_erratum_type1; bool quirk_tuning_erratum_type2; bool quirk_ignore_data_inhibit; + bool quirk_delay_before_data_reset; bool in_sw_tuning; unsigned int peripheral_clock; const struct esdhc_clk_fixup *clk_fixup; @@ -735,6 +736,11 @@ static void esdhc_reset(struct sdhci_host *host, u8 mask) struct sdhci_esdhc *esdhc = sdhci_pltfm_priv(pltfm_host); u32 val; + if (esdhc->quirk_delay_before_data_reset && + (mask & SDHCI_RESET_DATA) && + (host->flags & SDHCI_REQ_USE_DMA)) + mdelay(5); + sdhci_reset(host, mask); sdhci_writel(host, host->ier, SDHCI_INT_ENABLE); @@ -1197,6 +1203,10 @@ static void esdhc_init(struct platform_device *pdev, struct sdhci_host *host) if (match) esdhc->clk_fixup = match->data; np = pdev->dev.of_node; + + if (of_device_is_compatible(np, "fsl,p2020-esdhc")) + esdhc->quirk_delay_before_data_reset = true; + clk = of_clk_get(np, 0); if (!IS_ERR(clk)) { /* -- 2.20.1