Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752316AbdIBFNt (ORCPT ); Sat, 2 Sep 2017 01:13:49 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:55144 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751095AbdIBFNs (ORCPT ); Sat, 2 Sep 2017 01:13:48 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 55C086087C 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: [RFC 4/4] mmc: sdhci-msm: Handle unexpected interrupt case on enabling legacy IRQs on CQE halt To: Adrian Hunter , 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-5-git-send-email-riteshh@codeaurora.org> <3f31712a-56bf-24c1-7823-f33d7c7f665a@intel.com> From: Ritesh Harjani Message-ID: <9dce21e1-4693-6d44-8613-66d08e2136fa@codeaurora.org> Date: Sat, 2 Sep 2017 10:43:40 +0530 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <3f31712a-56bf-24c1-7823-f33d7c7f665a@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed 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: 1810 Lines: 63 On 8/31/2017 1:05 PM, Adrian Hunter wrote: > On 30/08/17 16:04, Ritesh Harjani wrote: >> There is a case when enabling the legacy IRQs and halting CQE is >> resuling into a command response interrupt without any command in >> progress. This patch handles such case here. >> >> Error signature without this patch:- >> mmc0: Got command interrupt 0x00000001 even though no command operation >> was in progress. >> >> Signed-off-by: Ritesh Harjani > > Seems fine, but this is a necessary part of enabling i.e. put all the > sdhci-msm changes into one patch. Yes, sure. > >> --- >> drivers/mmc/host/sdhci-msm.c | 11 +++++++++++ >> 1 file changed, 11 insertions(+) >> >> diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c >> index baa3409..8fdc2c0 100644 >> --- a/drivers/mmc/host/sdhci-msm.c >> +++ b/drivers/mmc/host/sdhci-msm.c >> @@ -1124,10 +1124,21 @@ void sdhci_msm_cqe_enable(struct mmc_host *mmc) >> void sdhci_msm_cqe_disable(struct mmc_host *mmc, bool recovery) >> { >> struct sdhci_host *host = mmc_priv(mmc); >> + unsigned long flags; >> + u32 ctrl; >> >> if (host->flags & SDHCI_USE_64_BIT_DMA) >> host->desc_sz = 16; >> >> + spin_lock_irqsave(&host->lock, flags); >> + > > Could use a comment here. Ok. Thanks. > >> + ctrl = sdhci_readl(host, SDHCI_INT_ENABLE); >> + ctrl |= SDHCI_INT_RESPONSE; >> + sdhci_writel(host, ctrl, SDHCI_INT_ENABLE); >> + sdhci_writel(host, SDHCI_INT_RESPONSE, SDHCI_INT_STATUS); >> + >> + spin_unlock_irqrestore(&host->lock, flags); >> + >> sdhci_cqe_disable(mmc, recovery); >> } >> >> > -- Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.