Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5183181ybi; Tue, 28 May 2019 08:51:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqwyPxet8rG1fahUU9lpPC6TW9g1rOR9iChD/nIcpQeTEXzo+824cZ0giHaEbxdWsXUjHjBm X-Received: by 2002:a63:1657:: with SMTP id 23mr79342635pgw.98.1559058709927; Tue, 28 May 2019 08:51:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559058709; cv=none; d=google.com; s=arc-20160816; b=uFLxEdrkLj0NqqLeqVq9AecmXfsajEyGzAXGVeudlU1OBRvOLN6Mb70ehfDITQ3E+T vmGjmaRy5INgSMB5SlfHaaZhsCfJHlIop3AJdTsx3Mz/xhvUHsVdnfP96XhfF7DhV/B6 ipzQbK618LYnYrqIdSSsQrCy3+sO4sEXmI+XyrFvXBvZVU+RAhI+RmsaySsaeeQ0X+15 kTV0ydECCdqHgh9QqA2ZkyEPh7vOq7tPU83E4Z8RWp7dfz30X6QNJByEYI1z4zWlbe4c MB5TBZ0auikikKhQtaDY3zYL6uX/D3BIjNwHH1XsBXwg3McyxYILykYW2OrlAXybhD9a R2+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=rVVCM3oss6fFLEowwE8V1IlUxZzOfvY2hKZ39Ilquf4=; b=t6Pj/q2DiRczSbQDhMN0w7GsAVcvjXEIA07pgo1Pz5MqUp41HeuXkCRAzhNH8xOXw7 l0XPTcIJ7oy4WaGDdZQBgr7I2puC1tc1YSc9qIqJmQlxmFyXY0Fgm/7WmSpHNLevX6rB QnOAXt2tvJ6yQ8leUTzoKuxvnkuQ1W4AyLyZgx7P+QxnmMGCKQ7mDOFO8Cl9QycO4YQQ 3d1QpmXDm6/mOHnuoMBwzhs2xlKpNBE4kUUbApdVDaSDSPjt0s5A8SYtV9uhJ3FKiluL 6qF4Td9lDPgHdYxQBLdsQtkemaE6OP70cDB3pMaBkHz2S/YJZALn00eHTAIJCzJnfzlb GixQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=IqZUUEJi; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w67si27359232pfb.125.2019.05.28.08.51.34; Tue, 28 May 2019 08:51:49 -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=@chromium.org header.s=google header.b=IqZUUEJi; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726894AbfE1PtD (ORCPT + 99 others); Tue, 28 May 2019 11:49:03 -0400 Received: from mail-vs1-f68.google.com ([209.85.217.68]:46458 "EHLO mail-vs1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726511AbfE1PtC (ORCPT ); Tue, 28 May 2019 11:49:02 -0400 Received: by mail-vs1-f68.google.com with SMTP id x8so422303vsx.13 for ; Tue, 28 May 2019 08:49:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=rVVCM3oss6fFLEowwE8V1IlUxZzOfvY2hKZ39Ilquf4=; b=IqZUUEJieiqEbr+TQYYtAXgNVwAK7MzBBm9XlY9GGI+WKamSi1KFzW43xncmxVl8Ui N5P4dPR+/E+LhBunyC95WAbkS0Og8TTm+OpBRx5yLU8NnS++izYync66K3+ssPoVmVBp 41R+hbkwY2q8btHusadzE8i4NyCimBvpQ5KV4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=rVVCM3oss6fFLEowwE8V1IlUxZzOfvY2hKZ39Ilquf4=; b=HigTfoXRnuMgakzVPBS3C2nRxx42ZrYZ0tsdgehz+jsa5stEaoBMOByrXwLECL5f4b rypcymsnzCkmnEAC4RbfjzmoqMOyK9Kq2gh29F2KAvFbyzinR6DFHy0KrP04clIsL/k3 TAcHAlvWx8zO4gToEcP261RDw2HBHfAcIH4JYQtOQ9dFJPIBJlmJwAvgQcGRRuaI/aO/ 8iUeR5adg418IbWcBeyEMT8AtapANbfOl/IgPpcGI/+ovUrgRmVGZhfcwwIkzRs7CF5G CYQxS5oC61ZUqA7X0nFjGQkk8Jtmo5facrkKc2q7hzErk5IDywj1fbpoeFZp8u6IhfJt zLlw== X-Gm-Message-State: APjAAAUdjrm8s7KjW2aLSk8F/5CVgmpq0EmLsDQ2eqCRtrOh0nbsXCEt 7XrVmhsFrCJnOzbSCyavYxHj0pMrk00= X-Received: by 2002:a67:7dd1:: with SMTP id y200mr40503606vsc.213.1559058541202; Tue, 28 May 2019 08:49:01 -0700 (PDT) Received: from mail-vs1-f53.google.com (mail-vs1-f53.google.com. [209.85.217.53]) by smtp.gmail.com with ESMTPSA id p20sm4977512uaa.4.2019.05.28.08.49.00 for (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Tue, 28 May 2019 08:49:00 -0700 (PDT) Received: by mail-vs1-f53.google.com with SMTP id o5so467284vsq.4 for ; Tue, 28 May 2019 08:49:00 -0700 (PDT) X-Received: by 2002:a67:f60b:: with SMTP id k11mr68126066vso.111.1559058141025; Tue, 28 May 2019 08:42:21 -0700 (PDT) MIME-Version: 1.0 References: <20190517225420.176893-1-dianders@chromium.org> <20190517225420.176893-3-dianders@chromium.org> <05af228c-139b-2b7f-f626-36fb34634be5@broadcom.com> <4f39e152-04ba-a64e-985a-df93e6d15ff8@intel.com> <2d6fa51d-27af-4f90-2bd6-144112ce75ad@intel.com> In-Reply-To: <2d6fa51d-27af-4f90-2bd6-144112ce75ad@intel.com> From: Doug Anderson Date: Tue, 28 May 2019 08:42:08 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 2/3] mmc: core: API for temporarily disabling auto-retuning due to errors To: Adrian Hunter Cc: Arend Van Spriel , Ulf Hansson , Kalle Valo , "open list:ARM/Rockchip SoC..." , Double Lo , Brian Norris , Madhan Mohan R , Matthias Kaehlcke , Wright Feng , Chi-Hsien Lin , Jiong Wu , Ritesh Harjani , Linux MMC List , LKML , Shawn Lin , Wolfram Sang , Avri Altman , Martin Hicks Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Tue, May 28, 2019 at 4:45 AM Adrian Hunter wrote: > > On 28/05/19 2:21 PM, Arend Van Spriel wrote: > > > > > > On 5/28/2019 12:04 PM, Adrian Hunter wrote: > >> On 26/05/19 9:42 PM, Arend Van Spriel wrote: > >>> On 5/18/2019 12:54 AM, Douglas Anderson wrote: > >>>> Normally when the MMC core sees an "-EILSEQ" error returned by a host > >>>> controller then it will trigger a retuning of the card. This is > >>>> generally a good idea. > >>> > >>> Probably a question for Adrian, but how is this retuning scheduled. I recall > >>> seeing something in mmc_request_done. How about deferring the retuning upon > >>> a release host or is that too sdio specific. > >> > >> Below is what I have been carrying the last 4 years. But according to > >> Douglas' > >> patch, the release would need to be further down. See 2nd diff below. > >> Would that work? > > > > That makes sense. The loop is needed because the device can be a bit bone > > headed. So indeed after the loop the device should be awake and able to > > handle CMD19. IMO I'd rather not _defer_ the re-tuning. I believe the correct thing is to not schedule the re-tuning at all in response to the IO errors. That's what my patch does. Specifically the IO errors that come up in this case are not due to being "out of tune". They are due to the fact that the other SDIO card may be in a transitory state and putting garbage on the bus. Scheduling a retuning for later would be just a waste of time and needlessly tie up the bus for the retune. ...or am I confused? > What if tuning is needed to read SBSDIO_FUNC1_SLEEPCSR successfully? Personally I think this would be pretty unlikely. If we're at this point we've already talked to the card quite a bit so we should have a tuning that's pretty good. If we're just slightly out of tune then we should still get through the loop with a few retries and then we can detect that we're out of tune later, with a more reliable command. However, if you're worried about this, I can always re-enable the old behavior if we have already looped a few times. I suppose I could increase the loop duration/count slightly too... Please let me know one way or the other. -Doug