Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750970AbdHaGKQ (ORCPT ); Thu, 31 Aug 2017 02:10:16 -0400 Received: from mga05.intel.com ([192.55.52.43]:27506 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750733AbdHaGKP (ORCPT ); Thu, 31 Aug 2017 02:10:15 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,451,1498546800"; d="scan'208";a="895777128" Subject: Re: [RFC 1/4] mmc: cqhci: Move CQHCI_ENABLE before setting TDLBA/TDLBAU To: Ritesh Harjani , ulf.hansson@linaro.org Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, stummala@codeaurora.org, asutoshd@codeaurora.org References: <1504098251-27739-1-git-send-email-riteshh@codeaurora.org> <1504098251-27739-2-git-send-email-riteshh@codeaurora.org> From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Message-ID: <82b52d84-6eb1-9f97-5e0a-bea6d25ddbda@intel.com> Date: Thu, 31 Aug 2017 09:01:34 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <1504098251-27739-2-git-send-email-riteshh@codeaurora.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1317 Lines: 41 On 30/08/17 16:04, Ritesh Harjani wrote: > Without this patch the CQHCI registers are getting reset > again. > > Signed-off-by: Ritesh Harjani > --- > drivers/mmc/host/cqhci.c | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) > > diff --git a/drivers/mmc/host/cqhci.c b/drivers/mmc/host/cqhci.c > index 8650a13..2a7351c 100644 > --- a/drivers/mmc/host/cqhci.c > +++ b/drivers/mmc/host/cqhci.c > @@ -262,6 +262,9 @@ static void __cqhci_enable(struct cqhci_host *cq_host) > > cqhci_writel(cq_host, cqcfg, CQHCI_CFG); > > + cqcfg |= CQHCI_ENABLE; > + cqhci_writel(cq_host, cqcfg, CQHCI_CFG); That doesn't follow the flow in the specification B.6.1. Command Queuing Initialization Sequence. Also in B.3.5 Task List, the spec. says "Changing the value of TDLBA is not allowed when command queue mode is enabled." So you will need to add a quirk for this. > + > cqhci_writel(cq_host, lower_32_bits(cq_host->desc_dma_base), > CQHCI_TDLBA); > cqhci_writel(cq_host, upper_32_bits(cq_host->desc_dma_base), > @@ -271,10 +274,6 @@ static void __cqhci_enable(struct cqhci_host *cq_host) > > cqhci_set_irqs(cq_host, 0); > > - cqcfg |= CQHCI_ENABLE; > - > - cqhci_writel(cq_host, cqcfg, CQHCI_CFG); > - > mmc->cqe_on = true; > > if (cq_host->ops->enable) >