Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp3543249imc; Wed, 13 Mar 2019 22:46:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqwjQIfEJD8zDFTW9xlp5b4Jv5loA8gS6vHXIEixZ7ve+1Us54R0fdfilyNP6sOujwF0DTdM X-Received: by 2002:a63:1ce:: with SMTP id 197mr43231923pgb.47.1552542366706; Wed, 13 Mar 2019 22:46:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552542366; cv=none; d=google.com; s=arc-20160816; b=FRYR+5fXttWv00yqFao6Ybir/BtA5G0ovTBZf7ol1U7Ava84ax58h514jkQl0bHevV ylAiaMCbmvJmtZDSidlc+3LOiFfBKedn1/4RDCUItnaKKOFiE9Xs1Oy3dcdtEK2yIoaH qw9NGhz40WR4IspuJCKgDtTGbrOhA3Z7e6jEELusWtTvNmVyFCi863PfWc8Q96BA68KD MptZPSWq3PBKrKXdpuWO+PN/4kwu+vmYX2vJyR4qDv9NtaS2qypVl6qYiR0TmfRi6W3h OOYwlv69OfBioMM3M80l9Ln0sV3NAszVNTuwgKqAdqHkum2v/JG1hKdnRc8vW77zI+v7 axbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dmarc-filter :dkim-signature:dkim-signature; bh=t+JXFaq0Z7bUSyscLwzfu/nQP8EyEbPTCEOOvkP/gyw=; b=G4wQklvvGrLqgGGG+WzEXTY8TtebPdP9YmXNAgNGMc48s3FAjV07keaYbydmXBr9t9 Jqa/tUJ7dBGeVegmnu3LcRAXAmGNw0bvtP7yiJ9sm87IRtcEb0QsvHRGbS6rOup5B0R+ tFLnDf8K5XXYJtnJrOv2nEhtvPXIK9uX5a9fPLJTWwraOBjUnSMnP0jARBwRWyBh2Yzo 8SAZOZiiA4/d+cOqgDw9jRj8/RGbeqqo03Seo3FQ4PRSSgLHhiRAkLm56JfHiX4HDFHZ Qa4qmvGrssrPEuF/TQR+mAW96NVhE9RBjHole2gJeDqntJo5ER0jNLah1+0//jiUdUjo s/vw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=Xk2cGNjY; dkim=pass header.i=@codeaurora.org header.s=default header.b=JjC9H1dI; 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 q16si3866212plr.390.2019.03.13.22.45.50; Wed, 13 Mar 2019 22:46:06 -0700 (PDT) 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=@codeaurora.org header.s=default header.b=Xk2cGNjY; dkim=pass header.i=@codeaurora.org header.s=default header.b=JjC9H1dI; 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 S1726824AbfCNFpZ (ORCPT + 99 others); Thu, 14 Mar 2019 01:45:25 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:38882 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726486AbfCNFpZ (ORCPT ); Thu, 14 Mar 2019 01:45:25 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 7AD94609EF; Thu, 14 Mar 2019 05:35:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1552541706; bh=QIt4dwIxDZtjIOhPMYl9C3L6oJO2HtLuKJjUu/Y0adU=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=Xk2cGNjYq1dkUzGEnQb/q2R3zQ2lSXOxNW0mZtLqIvLs+0Q3mpXHdb7nhy6mS6CzK RgDQWhum0CwfUT9Z2Udr8IY72K7NjXOs/AQVNP0FCaGFYT3MolwId36/ODfFGwYoLE aCUOHxt7avKR8JeSAJaC45N/FAF9klUgFGMekws8= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_INVALID,DKIM_SIGNED autolearn=no autolearn_force=no version=3.4.0 Received: from [10.206.25.9] (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: riteshh@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id D597C602A7; Thu, 14 Mar 2019 05:35:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1552541705; bh=QIt4dwIxDZtjIOhPMYl9C3L6oJO2HtLuKJjUu/Y0adU=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=JjC9H1dIoK/bfXvYzfkPOBOWUUc6+Tuu4ZOu0VBcMZg937oR9OTR4q31DXuqWtI+H tyIdgieG54h53bdD3vPGkatqwjpmuUUDEGGOuK29yANX7Ke45PCwx3g5/TfXsxT+dn COOtMgwhGT5mRe5LZskdrVwzfiY9w01TEjAaqJVI= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org D597C602A7 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=riteshh@codeaurora.org Subject: Re: [PATCH V3 07/10] mmc: tegra: add Tegra186 WAR for CQE To: Sowjanya Komatineni , adrian.hunter@intel.com, ulf.hansson@linaro.org, robh+dt@kernel.org, mark.rutland@arm.com Cc: thierry.reding@gmail.com, jonathanh@nvidia.com, anrao@nvidia.com, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, devicetree@vger.kernel.org References: <1552513552-23423-1-git-send-email-skomatineni@nvidia.com> <1552513552-23423-7-git-send-email-skomatineni@nvidia.com> From: Ritesh Harjani Message-ID: <55701d04-1e55-e0a0-ecd7-d31eaec5240d@codeaurora.org> Date: Thu, 14 Mar 2019 11:04:59 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.5.3 MIME-Version: 1.0 In-Reply-To: <1552513552-23423-7-git-send-email-skomatineni@nvidia.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/14/2019 3:15 AM, Sowjanya Komatineni wrote: > Tegra186 CQHCI host has a known bug where CQHCI controller selects > DATA_PRESENT_SELECT bit to 1 for DCMDs with R1B response type and > since DCMD does not trigger any data transfer, DCMD task complete > happens leaving the DATA FSM of host controller in wait state for > the data. > > This effects the data transfer tasks issued after the DCMDs with > R1b response type resulting in timeout. > > SW WAR is to set CMD_TIMING to 1 in DCMD task descriptor. This bug > and SW WAR is applicable only for Tegra186 and not for Tegra194. > > This patch implements this WAR thru NVQUIRK_CQHCI_DCMD_R1B_CMD_TIMING > for Tegra186 and also implements update_dcmd_desc of cqhci_host_ops > interface to set CMD_TIMING bit depending on the NVQUIRK. > > Tested-by: Jon Hunter > Signed-off-by: Sowjanya Komatineni Thanks, Reviewed-by: Ritesh Harjani > --- > drivers/mmc/host/sdhci-tegra.c | 17 ++++++++++++++++- > 1 file changed, 16 insertions(+), 1 deletion(-) > > diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c > index f1aa0591112a..2f08b6e480df 100644 > --- a/drivers/mmc/host/sdhci-tegra.c > +++ b/drivers/mmc/host/sdhci-tegra.c > @@ -106,6 +106,7 @@ > #define NVQUIRK_HAS_PADCALIB BIT(6) > #define NVQUIRK_NEEDS_PAD_CONTROL BIT(7) > #define NVQUIRK_DIS_CARD_CLK_CONFIG_TAP BIT(8) > +#define NVQUIRK_CQHCI_DCMD_R1B_CMD_TIMING BIT(9) > > /* SDMMC CQE Base Address for Tegra Host Ver 4.1 and Higher */ > #define SDHCI_TEGRA_CQE_BASE_ADDR 0xF000 > @@ -1123,6 +1124,18 @@ static void tegra_sdhci_voltage_switch(struct sdhci_host *host) > tegra_host->pad_calib_required = true; > } > > +static void sdhci_tegra_update_dcmd_desc(struct mmc_host *mmc, > + struct mmc_request *mrq, u64 *data) > +{ > + struct sdhci_pltfm_host *pltfm_host = sdhci_priv(mmc_priv(mmc)); > + struct sdhci_tegra *tegra_host = sdhci_pltfm_priv(pltfm_host); > + const struct sdhci_tegra_soc_data *soc_data = tegra_host->soc_data; > + > + if (soc_data->nvquirks & NVQUIRK_CQHCI_DCMD_R1B_CMD_TIMING && > + mrq->cmd->flags & MMC_RSP_R1B) > + *data |= CQHCI_CMD_TIMING(1); > +} > + > static void sdhci_tegra_cqe_enable(struct mmc_host *mmc) > { > struct cqhci_host *cq_host = mmc->cqe_private; > @@ -1164,6 +1177,7 @@ static const struct cqhci_host_ops sdhci_tegra_cqhci_ops = { > .enable = sdhci_tegra_cqe_enable, > .disable = sdhci_cqe_disable, > .dumpregs = sdhci_tegra_dumpregs, > + .update_dcmd_desc = sdhci_tegra_update_dcmd_desc, > }; > > static const struct sdhci_ops tegra_sdhci_ops = { > @@ -1345,7 +1359,8 @@ static const struct sdhci_tegra_soc_data soc_data_tegra186 = { > NVQUIRK_HAS_PADCALIB | > NVQUIRK_DIS_CARD_CLK_CONFIG_TAP | > NVQUIRK_ENABLE_SDR50 | > - NVQUIRK_ENABLE_SDR104, > + NVQUIRK_ENABLE_SDR104 | > + NVQUIRK_CQHCI_DCMD_R1B_CMD_TIMING, > .min_tap_delay = 84, > .max_tap_delay = 136, > };