Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp13971706ybl; Mon, 30 Dec 2019 01:23:33 -0800 (PST) X-Google-Smtp-Source: APXvYqzycn/z445Ll5dgm83RzricTgVSyyvXrGxM2Ngw+47ln8ehHhBFVW1SW6bAyTYXnllVWRAA X-Received: by 2002:a05:6830:13d9:: with SMTP id e25mr71022977otq.134.1577697813673; Mon, 30 Dec 2019 01:23:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577697813; cv=none; d=google.com; s=arc-20160816; b=rh5qIUGA8U7OKkLC48Xy4R27bfG2/RECZ5EMtuK53VCLCWcLgdLXLNfVzRiclIl91z y1q5I7uCy73H9n0B7adqoj6JYZvXzqg2+1Iysm0z10RFeTBn30yNPakEN0ilVDfd+n1G Mbg+LrbcDshIvctXlLv6wguskL+NMhLaQAG3f5xEAZTimreywNY5MB4vWTB0M4ffaepQ 9/acJhZ94LGco2YuuJobatIndo2rCnBk8g+gHp6qRCz8HIcZn9lX7BlD8+6CmvIztLDL DS9EltrCIuZmKtOjqHeZ3ntbirdjGgx3fSbBM5fW6CHxJWO8sVaaP9y/Ep2yF6JpYLeb LOyw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=OJA99jZBbljYKu/eIbyE5SJxvJXIQvpqRdw8rl7bW6M=; b=RY1n1ZkfHdsbyyob5oOeQN2csTQTx8ogW3B/JovdsBBBmujgpBvQoZBjWvEDG29ztg 8A1rJvGKKrsiHuaR7OfZeTptlpjq42j+jHdd0/Cau4GpwMG/XobO8xNzHzcBrlsxdV/y ri9N5WzOpcOjisXV0QjH1EXQKoTrRXDkJV5WDMGqGERWP61MLfYNrHdn/HaFh90U35Qe jXkxnp6gDW1mhMfkXykTCEd0xAwwuu2awGLqzf4lBxZSThnYTnW5JLGJX6XoXlZ5fQGB G2WUJFdQmH61G5M2ODTXrR59/VWfbA9JfmoNfv0r9jA1fHi4LNQV/iThlj57giX10lSl oQbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=HD174iY7; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b10si21232385oic.153.2019.12.30.01.23.20; Mon, 30 Dec 2019 01:23:33 -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=@ti.com header.s=ti-com-17Q1 header.b=HD174iY7; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727334AbfL3JWh (ORCPT + 99 others); Mon, 30 Dec 2019 04:22:37 -0500 Received: from fllv0016.ext.ti.com ([198.47.19.142]:42192 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727162AbfL3JWg (ORCPT ); Mon, 30 Dec 2019 04:22:36 -0500 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id xBU9MTaE003658; Mon, 30 Dec 2019 03:22:29 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1577697749; bh=OJA99jZBbljYKu/eIbyE5SJxvJXIQvpqRdw8rl7bW6M=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=HD174iY7G0vpuvI91CRG7pjKaNXMAvNZPYvSld6eMFuVv+pPIatYRh2UhQU0pj+EM trJ4y3dnPrpINaKCzO6YEEdHEIRaUCMlO4YD+a7U8NcLfXHpVCSA1CBZsL9E8sFH0G x5Whv3aqPci1p+rC0OgWQMap401VWV4lLdcD0AoA= Received: from DLEE109.ent.ti.com (dlee109.ent.ti.com [157.170.170.41]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id xBU9MTdD130939 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 30 Dec 2019 03:22:29 -0600 Received: from DLEE100.ent.ti.com (157.170.170.30) by DLEE109.ent.ti.com (157.170.170.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3; Mon, 30 Dec 2019 03:22:28 -0600 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE100.ent.ti.com (157.170.170.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3 via Frontend Transport; Mon, 30 Dec 2019 03:22:28 -0600 Received: from a0230074-OptiPlex-7010.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id xBU9MOJj109856; Mon, 30 Dec 2019 03:22:27 -0600 From: Faiz Abbas To: , CC: , , , Subject: [PATCH 1/3] mmc: sdhci: Add Quirk to reset data lines after tuning Date: Mon, 30 Dec 2019 14:53:41 +0530 Message-ID: <20191230092343.30692-2-faiz_abbas@ti.com> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20191230092343.30692-1-faiz_abbas@ti.com> References: <20191230092343.30692-1-faiz_abbas@ti.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some arasan controllers have data leftover in the buffer after tuning procedure is complete which interferes with future data commands. Add a quirk to reset the data after tuning is finished. Signed-off-by: Faiz Abbas --- drivers/mmc/host/sdhci.c | 3 +++ drivers/mmc/host/sdhci.h | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 1b1c26da3fe0..e4b478efb560 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -2316,6 +2316,9 @@ EXPORT_SYMBOL_GPL(sdhci_start_tuning); void sdhci_end_tuning(struct sdhci_host *host) { + if (host->quirks2 & SDHCI_QUIRK2_RESET_DATA_POST_TUNING) + sdhci_reset(host, SDHCI_RESET_DATA); + sdhci_writel(host, host->ier, SDHCI_INT_ENABLE); sdhci_writel(host, host->ier, SDHCI_SIGNAL_ENABLE); } diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index fe83ece6965b..28826124f7c3 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h @@ -484,6 +484,10 @@ struct sdhci_host { * block count. */ #define SDHCI_QUIRK2_USE_32BIT_BLK_CNT (1<<18) +/* + * Controller needs to reset data lines once tuning is complete + */ +#define SDHCI_QUIRK2_RESET_DATA_POST_TUNING (1<<19) int irq; /* Device IRQ */ void __iomem *ioaddr; /* Mapped address */ -- 2.19.2