From: Arnd Bergmann Subject: Re: [PATCH] mmc: sdhci: remove mdelay in eMMC tuning Date: Wed, 14 May 2014 14:18:23 +0200 Message-ID: <5285574.Jh25nVnT1D@wuerfel> References: <1399427558-8478-1-git-send-email-nsanders@chromium.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Return-path: Received: from mout.kundenserver.de ([212.227.126.131]:57111 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750919AbaENMS3 (ORCPT ); Wed, 14 May 2014 08:18:29 -0400 In-Reply-To: Sender: linux-mmc-owner@vger.kernel.org List-Id: linux-mmc@vger.kernel.org To: Grant Grundler Cc: Ulf Hansson , Chris Ball , Nick Sanders , linux-mmc , Doug Anderson , Chang-Eun Choi-SSI On Tuesday 13 May 2014 18:13:30 Grant Grundler wrote: > On Wed, May 7, 2014 at 1:35 AM, Ulf Hansson wrote: > > On 7 May 2014 03:52, Nick Sanders wrote: > >> This patch removes an unneccesary 1ms mdelay in the HS200 tuning > >> loop, called 40 times per retuning. Currently this causes a latency > >> of >40ms on any emmc accesses triggering wake from runtime PM, > >> which can occur for a significant portion of reads on a mostly idle system. > > > > Aha, so you are actually using "MMC_CAP_RUNTIME_RESUME" here - cool :-). > > > > I suppose those patches that enables the "cap" has not reached > > mainline yet. Any plans on sending them? > > > >> > >> The delay is left in place for SD Cards, which use > >> MMC_SEND_TUNING_BLOCK rather than MMC_SEND_TUNING_BLOCK_HS200. > >> I'm not able to find evidence that this is required for SD in the > >> specs I have access to, however this delay has been present from > >> initial checkin for SD so I have preserved the original behavior for > >> compatibility. > >> > >> This has been verified to fix observed glitching on local audio > >> playback and recording on apps with inbuilt assumptions on storage > >> latency. > >> > >> Signed-off-by: Nick Sanders > >> Reviewed-by: Grant Grundler > >> Reviewed-by: Doug Anderson > > > > Acked-by: Ulf Hansson > > Ulf, > Is your ACK enough to get this to land upstream or does cjb need to > respond it's been accepted? > > It doesn't appear to have landed in mmc-next branch yet: > http://git.kernel.org/cgit/linux/kernel/git/cjb/mmc.git/log/?h=mmc-next > > apologies if it appears I am being impatient...but it's been almost a week now. > I just stumbled over this thread. Looking at the callers of the execute_tuning() function, I see that all three come from non-atomic context. How about an add-on patch to turn the mdelay(1) into an msleep(1)? That would be much friendlier to other tasks running concurrently. Arnd