From patchwork Tue Dec 17 02:50:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Bao D. Nguyen" X-Patchwork-Id: 11296429 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 38E6C14B7 for ; Tue, 17 Dec 2019 02:52:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 16A6924655 for ; Tue, 17 Dec 2019 02:52:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="key not found in DNS" (0-bit key) header.d=mg.codeaurora.org header.i=@mg.codeaurora.org header.b="IEOnxz/Y" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727121AbfLQCwp (ORCPT ); Mon, 16 Dec 2019 21:52:45 -0500 Received: from mail25.static.mailgun.info ([104.130.122.25]:46181 "EHLO mail25.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727056AbfLQCwp (ORCPT ); Mon, 16 Dec 2019 21:52:45 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1576551164; h=References: In-Reply-To: References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=CI6IVlVS4tT6rEmE0t64F3K7dLcEuCRxMVil12OQwn0=; b=IEOnxz/YudVKaUaQs8jvy4zlFCh8LSLAYnDlyQ4BJsHxnqt/fxm2Hj2iPAeGSmc67axw/Eaj poJgqs8AH8ufRGCDDfzltjKcCHjx1CNR+V6miAr/911ckAiMnRUJcom0oSFE4JjQPqP/aVbm b+7XlAbzNPH+JS2pNLf28TejHd4= X-Mailgun-Sending-Ip: 104.130.122.25 X-Mailgun-Sid: WyJiYTcxMiIsICJsaW51eC1tbWNAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by mxa.mailgun.org with ESMTP id 5df842fb.7f73b8035420-smtp-out-n03; Tue, 17 Dec 2019 02:52:43 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 947CCC4479F; Tue, 17 Dec 2019 02:52:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.0 tests=ALL_TRUSTED,SPF_NONE, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from pacamara-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: nguyenb) by smtp.codeaurora.org (Postfix) with ESMTPSA id E05EAC43383; Tue, 17 Dec 2019 02:52:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org E05EAC43383 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=nguyenb@codeaurora.org From: "Bao D. Nguyen" To: ulf.hansson@linaro.org, robh+dt@kernel.org Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, asutoshd@codeaurora.org, cang@codeaurora.org, Sahitya Tummala , "Bao D. Nguyen" Subject: [ 6/9] mmc: sdhci-msm: Ignore data timeout error for R1B commands Date: Mon, 16 Dec 2019 18:50:39 -0800 Message-Id: <22061d3479b876e8590b966162d6385a47f851b1.1576540908.git.nguyenb@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org From: Sahitya Tummala Ignore data timeout error for R1B commands as there will be no data associated and the busy timeout value for these commands could be lager than the maximum timeout value that controller can handle. Signed-off-by: Sahitya Tummala Signed-off-by: Bao D. Nguyen --- drivers/mmc/host/sdhci.c | 15 +++++++++------ drivers/mmc/host/sdhci.h | 7 +++++++ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index c04e1ac..0a05d74 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -2925,12 +2925,6 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) * above in sdhci_cmd_irq(). */ if (data_cmd && (data_cmd->flags & MMC_RSP_BUSY)) { - if (intmask & SDHCI_INT_DATA_TIMEOUT) { - host->data_cmd = NULL; - data_cmd->error = -ETIMEDOUT; - __sdhci_finish_mrq(host, data_cmd->mrq); - return; - } if (intmask & SDHCI_INT_DATA_END) { host->data_cmd = NULL; /* @@ -2944,6 +2938,15 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) __sdhci_finish_mrq(host, data_cmd->mrq); return; } + if (host->quirks2 & + SDHCI_QUIRK2_IGNORE_DATATOUT_FOR_R1BCMD) + return; + if (intmask & SDHCI_INT_DATA_TIMEOUT) { + host->data_cmd = NULL; + data_cmd->error = -ETIMEDOUT; + __sdhci_finish_mrq(host, data_cmd->mrq); + return; + } } /* diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index 0ed3e0e..1a88f74 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h @@ -482,6 +482,13 @@ struct sdhci_host { * block count. */ #define SDHCI_QUIRK2_USE_32BIT_BLK_CNT (1<<18) +/* + * Ignore data timeout error for R1B commands as there will be no + * data associated and the busy timeout value for these commands + * could be lager than the maximum timeout value that controller + * can handle. + */ +#define SDHCI_QUIRK2_IGNORE_DATATOUT_FOR_R1BCMD (1<<19) int irq; /* Device IRQ */ void __iomem *ioaddr; /* Mapped address */