Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp616136imu; Fri, 11 Jan 2019 06:15:49 -0800 (PST) X-Google-Smtp-Source: ALg8bN487jWJkjYxhoKjd2SJBmZNeBzgtpN4eDaWjHPTdfHR4BZtxEzvdP+aIrAPiSTbFW/4SLW0 X-Received: by 2002:a65:49cd:: with SMTP id t13mr13700926pgs.376.1547216149387; Fri, 11 Jan 2019 06:15:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547216149; cv=none; d=google.com; s=arc-20160816; b=u6k2DEwxmnENHqgbRFEfKRSH+8e5Mt73yIKFnxXt0koGb8SXps/523i7l9O7BoMowK qYxp86JlsDNMfAMpNrlOTfajQLux32mDI+IFyiLO1vwGroq0ErQt76JiLgyCyuGv9UiG wYH2m4fN3Bb5VlaDzuvhNNXYFgNWc1T1S5bM9xPakLTpcZEsmB6dJbN6FhjpRNzpcmFb qMDGQM56k4bF/ZW/hztASaRrXQusNRCH3aZX5U3SZNfsyAaNMXKlptoRPB6vEFv78CrQ CSKi/WiON/brYrV5HbFWzRAJOWa42YR2aNznLWJtjwXqRXINeCGdaij8cFa2rsPBTCog 7enw== 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=BEnPQFhax64Og/c5c4caRoYtVP88OtvDRiQ9NsO7jx8=; b=Aqmfl1mywS5jUzRJ1kC7sFhdSB0lScaVQR9fA7Z3AvY9iJLSpeLQoB5PH2t6w97oOD BrCLDEmqoA5dls7cQqoE1YNjiNwCtSbVgsBTjD/lhlow4XIrM1aomCia2IDMiyRJwHaG EIgNxlM/9c5dSVE75CbBA2wqmJPRpWjo+1oudaASbkJpEULEsn5BveMQQG/7yCOmhO2I Qkwzi+4Ew831Fw7U3C0qbv88zOsq5/c0Mw2BExkyHAkWQe+C6OR/we1P/zJ2X+ROa9Ps voHxTf1vK8cCAfE+I9l3pF2RWKkRn5dNTFQjnWQ0kT+GveNhtTMonpJKSOJCHiqaL0as HW0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=KGnVx3nA; 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 l96si25508704plb.292.2019.01.11.06.15.33; Fri, 11 Jan 2019 06:15:49 -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=KGnVx3nA; 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 S1732178AbfAKLGY (ORCPT + 99 others); Fri, 11 Jan 2019 06:06:24 -0500 Received: from fllv0016.ext.ti.com ([198.47.19.142]:60384 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730987AbfAKLGV (ORCPT ); Fri, 11 Jan 2019 06:06:21 -0500 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id x0BB6F1P075092; Fri, 11 Jan 2019 05:06:15 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1547204775; bh=BEnPQFhax64Og/c5c4caRoYtVP88OtvDRiQ9NsO7jx8=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=KGnVx3nAtJ+cpfwapvqeviUAvUSQemi4G8E5FIIIcpxgWb2cgB7AXBIQlbM01ymaF jZK+4fDebSH5xpQbowOR//avE/52xBuHcHs5wFSFwPxZgbWDcHssBXINHX9/fPJnzE y7b9OkPDvBVOkcr0+G5HNvpqJ8pFuxlKhpevE274= Received: from DFLE110.ent.ti.com (dfle110.ent.ti.com [10.64.6.31]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x0BB6Fmq119337 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 11 Jan 2019 05:06:15 -0600 Received: from DFLE102.ent.ti.com (10.64.6.23) by DFLE110.ent.ti.com (10.64.6.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Fri, 11 Jan 2019 05:06:15 -0600 Received: from dlep32.itg.ti.com (157.170.170.100) by DFLE102.ent.ti.com (10.64.6.23) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1591.10 via Frontend Transport; Fri, 11 Jan 2019 05:06:15 -0600 Received: from a0230074-OptiPlex-7010.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id x0BB5xEu024503; Fri, 11 Jan 2019 05:06:12 -0600 From: Faiz Abbas To: , , CC: , , , , , , Subject: [PATCH 4/7] mmc: sdhci: Add quirk for disabling DTO during erase command Date: Fri, 11 Jan 2019 16:38:48 +0530 Message-ID: <20190111110851.6805-5-faiz_abbas@ti.com> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20190111110851.6805-1-faiz_abbas@ti.com> References: <20190111110851.6805-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 controllers might prematurely issue a data timeout during an erase command. Add a quirk to disable the interrupt when an erase command is issued. Signed-off-by: Faiz Abbas --- drivers/mmc/host/sdhci.c | 8 ++++++++ drivers/mmc/host/sdhci.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 4a9044c06e21..cfd716aee552 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -1560,6 +1560,14 @@ void sdhci_send_command(struct sdhci_host *host, struct mmc_command *cmd) /* Initially, a command has no error */ cmd->error = 0; + if (cmd->opcode == MMC_ERASE && + (host->quirks2 & SDHCI_QUIRK2_DISABLE_DTO_FOR_ERASE)) { + mask = sdhci_readl(host, SDHCI_INT_ENABLE); + mask &= ~SDHCI_INT_DATA_TIMEOUT; + sdhci_writel(host, mask, SDHCI_INT_ENABLE); + sdhci_writel(host, mask, SDHCI_SIGNAL_ENABLE); + } + if ((host->quirks2 & SDHCI_QUIRK2_STOP_WITH_TC) && cmd->opcode == MMC_STOP_TRANSMISSION) cmd->flags |= MMC_RSP_BUSY; diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index 7a52823ebef4..d0c6d4fe5371 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h @@ -479,6 +479,8 @@ struct sdhci_host { * block count. */ #define SDHCI_QUIRK2_USE_32BIT_BLK_CNT (1<<18) +/* Controller needs to disable DTO for erase command */ +#define SDHCI_QUIRK2_DISABLE_DTO_FOR_ERASE (1<<19) int irq; /* Device IRQ */ void __iomem *ioaddr; /* Mapped address */ -- 2.19.2