Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932944AbcK1PwD (ORCPT ); Mon, 28 Nov 2016 10:52:03 -0500 Received: from mail-wm0-f52.google.com ([74.125.82.52]:35829 "EHLO mail-wm0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754869AbcK1PvO (ORCPT ); Mon, 28 Nov 2016 10:51:14 -0500 From: Georgi Djakov Subject: Re: [PATCH] mmc: sdhci-msm: Add sdhci_reset() implementation To: Ritesh Harjani , adrian.hunter@intel.com, ulf.hansson@linaro.org References: <20161122155005.16910-1-georgi.djakov@linaro.org> <95ef8403-5e3c-4219-f45e-e289cf59f1b8@codeaurora.org> Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Message-ID: Date: Mon, 28 Nov 2016 17:51:05 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <95ef8403-5e3c-4219-f45e-e289cf59f1b8@codeaurora.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1471 Lines: 43 On 11/24/2016 06:06 PM, Ritesh Harjani wrote: > Hi Georgi, > > I collected some info on this problem. May be below info might help you. > > I think "Reset 0x1" problem is occurring because of below call stack. > SDHCI_RESET_ALL to SDHCI_SOFTWARE_RESET register will anyway trigger the > sdhci_msm_pwr_irq. > > But I think the problem is that the above occurs in spinlock context > and because of only one core the IRQ will never be serviced, hence you > were seeing (Reset 0x1) error. > Hi Ritesh, Thanks for looking into this. So yes, its called in spinlock context and what we need to do is just handle the power irq after writing to reset register. [..] > > To prove above I tried this and the problem goes away. But I still dont > think that the below approach is correct. As it will still trigger a > pwr_irq as well. > > > diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c > index 62aedf1..01e611c 100644 > --- a/drivers/mmc/host/sdhci.c > +++ b/drivers/mmc/host/sdhci.c > @@ -174,6 +174,8 @@ void sdhci_reset(struct sdhci_host *host, u8 mask) > /* Reset-all turns off SD Bus Power */ > if (host->quirks2 & SDHCI_QUIRK2_CARD_ON_NEEDS_BUS_ON) > sdhci_runtime_pm_bus_off(host); > + if (host->ops->voltage_switch) > + host->ops->voltage_switch(host); > } > Yes, our own reset() function that additionally handles the irq will work. Thanks, Georgi