Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp2449007ybf; Mon, 2 Mar 2020 08:51:47 -0800 (PST) X-Google-Smtp-Source: ADFU+vsZYqfeHhOtIGGk9+Ax9+si++aqoYvac45Y1xfPGHmHb+t1XSOy9+LjAreG8a8v61vyXR7l X-Received: by 2002:a9d:2f05:: with SMTP id h5mr84463otb.316.1583167907538; Mon, 02 Mar 2020 08:51:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583167907; cv=none; d=google.com; s=arc-20160816; b=omEjCzY8c9lEhhdQTnAJiNtDCk24J0rmitx5NzblbAqkA1eg9XbCBsqIXrzvlggoAc SsQbwuHu6jdguTiWMi/8zLTZ8Poo+dqIwaDitZ2YavI8+l/Xm1O6dTX438kln4f7lGYU SKurF/+qyfzMOzKUeFuwwtsggwl5VJNLmbmURF5uNYhwEHJyvNVHKKxidbsDMKKBhmVu mqvXKQXHvmRZf9Tuvg0vvpH4lFLIJgDHxXPOEELa9/9CTHPIdgaeylM++hw9m1vT8cI5 zpwVJ0L46xjNx5Mo4LGWdA9mMW9/S9Po71FCFRIp1vOEtCVj/6PlYcljSmH82EsK2S8B y9DQ== 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=FwQQQHxuz3c6VL7U4BBPixCOrvkb1+9h0SeP1AGJNyU=; b=xaOnct7VI3AuFgrkjl1rCAfE+QwXUmCSOi12mMzqR2jn6r2Cx+F59yMniM7V630PCs 0tGrPgbfzuKEm/A64VHd1B3ERMWieCch0bm3pYtshndDAXT0myfuBf6bBlFRrnpM2GbC 3NI36kPPdisOvhgPfz+5SPmSkcCIm6geMYoPu+J8GXOp9JJbyQWf6ZN8MhnEDQiOv+Fl z3iwWSo4zL9QuCDrcgxP3gcjQi4dXj3uUd2rgrzBFnmyVVRx4TIgQlY0+ntBUesUV68C h8eZ3Z6v+3QWo/VYcwiT2/yZ6L8U4uL9c16KDegFncir6ea8CGh+uHbMVZL48vA3EsoI 0tVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=x0ReNb3Y; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a23si889821otl.228.2020.03.02.08.51.35; Mon, 02 Mar 2020 08:51:47 -0800 (PST) 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=@linaro.org header.s=google header.b=x0ReNb3Y; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727192AbgCBQvY (ORCPT + 99 others); Mon, 2 Mar 2020 11:51:24 -0500 Received: from mail-ua1-f68.google.com ([209.85.222.68]:46084 "EHLO mail-ua1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727092AbgCBQvY (ORCPT ); Mon, 2 Mar 2020 11:51:24 -0500 Received: by mail-ua1-f68.google.com with SMTP id h22so1817052uap.13 for ; Mon, 02 Mar 2020 08:51:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=FwQQQHxuz3c6VL7U4BBPixCOrvkb1+9h0SeP1AGJNyU=; b=x0ReNb3YU4Sguq0VaQfFbFXH0kpNCmamyKbSHMsHnjWCLKswOZajP3kZVsS4iIuPTP EV/thxYeCx0pzmVnY0G6ynukRR8GkHvBh0a9wq+5rgPWkbqw1aGH5erQeMcK7gVnt8lj SdcZrdo+KyXM7dD7+P/KC3hNHdPQl0TpJoPaR47UX1Z31aXiaU15E8lmRdJhURyJmlMx qS1sx5LmQB/6C0MPKqLQ3bVOvPOTt7cBhj9zuzvNYnckFu8Qd6Mpperu6t9faSHWGA/W sjqClCrQxfSJGGIWO/9e7weyeDQJeg6/uFpUAsmR4Ly1l92n9mcAuBFyXlARpHwuc4ho B/vA== 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=FwQQQHxuz3c6VL7U4BBPixCOrvkb1+9h0SeP1AGJNyU=; b=ie+W/HUpYnm2WTLVTDYOXRAukp9xF3JDYWRvN1BgCW82BTlr0aXSA/nB9iQgBAKG3E XSw5g+tNF12gEu+UbbkwWOy0Of8R/PUfkeJadXLzaN2mWnoXKyALTfn+xXu/doTIRlZD IPEFfHW/K4Wn8plJF2fEpzWW5sTO9OGLkSGPlbA/C9PACcOrOVJlZcYnyS5PXI8O4GwA BoWaD8f2UaBwM29Dyf9N+yEGhDyAz2pTAU9s9gNR8Jk82zIoQID2UY+3YfBxI5etBks2 x0MFQ+JV2jafMmU0Mm0h6ybFkK1I1fegphjlvRLtKVKRJ1batMCJwQcwHNJv3cckJ/eS uN+g== X-Gm-Message-State: ANhLgQ1eNwwjcS1g/qszLFRZQfU3zkxYRK1LV9Z/pQPE/evyuPQd0zi+ 9OK8daChFT8W1bw+lMCdxMLd0nl7GbujZjJEBOwVuw== X-Received: by 2002:ab0:7802:: with SMTP id x2mr384034uaq.100.1583167881874; Mon, 02 Mar 2020 08:51:21 -0800 (PST) MIME-Version: 1.0 References: <6523119a-50ac-973a-d1cd-ab1569259411@nvidia.com> <0963b60f-15e7-4bc6-10df-6fc8003e4d42@nvidia.com> <34fd84d7-387b-b6f3-7fb3-aa490909e205@ti.com> In-Reply-To: <34fd84d7-387b-b6f3-7fb3-aa490909e205@ti.com> From: Ulf Hansson Date: Mon, 2 Mar 2020 17:50:45 +0100 Message-ID: Subject: Re: LKFT: arm x15: mmc1: cache flush error -110 To: Faiz Abbas Cc: Jon Hunter , Bitan Biswas , Sowjanya Komatineni , Adrian Hunter , Naresh Kamboju , Jens Axboe , Alexei Starovoitov , linux-block , lkft-triage@lists.linaro.org, open list , "linux-mmc@vger.kernel.org" , Arnd Bergmann , John Stultz , Thierry Reding , Anders Roxell , Kishon 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 On Mon, 2 Mar 2020 at 14:11, Faiz Abbas wrote: > > Uffe, > > On 26/02/20 8:51 pm, Ulf Hansson wrote: > > + Anders, Kishon > > > > On Tue, 25 Feb 2020 at 17:24, Jon Hunter wrote: > >> > >> > >> On 25/02/2020 14:26, Ulf Hansson wrote: > >> > >> ... > >> > >>> However, from the core point of view, the response is still requested, > >>> only that we don't want the driver to wait for the card to stop > >>> signaling busy. Instead we want to deal with that via "polling" from > >>> the core. > >>> > >>> This is a rather worrying behaviour, as it seems like the host driver > >>> doesn't really follow this expectations from the core point of view. > >>> And mmc_flush_cache() is not the only case, as we have erase, bkops, > >>> sanitize, etc. Are all these working or not really well tested? > >> > >> I don't believe that they are well tested. We have a simple test to > >> mount an eMMC partition, create a file, check the contents, remove the > >> file and unmount. The timeouts always occur during unmounting. > >> > >>> Earlier, before my three patches, if the provided timeout_ms parameter > >>> to __mmc_switch() was zero, which was the case for > >>> mmc_mmc_flush_cache() - this lead to that __mmc_switch() simply > >>> ignored validating host->max_busy_timeout, which was wrong. In any > >>> case, this also meant that an R1B response was always used for > >>> mmc_flush_cache(), as you also indicated above. Perhaps this is the > >>> critical part where things can go wrong. > >>> > >>> BTW, have you tried erase commands for sdhci tegra driver? If those > >>> are working fine, do you have any special treatments for these? > >> > >> That I am not sure, but I will check. > > > > Great, thanks. Looking forward to your report. > > > > So, from my side, me and Anders Roxell, have been collaborating on > > testing the behaviour on a TI Beagleboard x15 (remotely with limited > > debug options), which is using the sdhci-omap variant. I am trying to > > get hold of an Nvidia jetson-TX2, but not found one yet. These are the > > conclusions from the observed behaviour on the Beagleboard for the > > CMD6 cache flush command. > > > > First, the reported host->max_busy_timeout is 2581 (ms) for the > > sdhci-omap driver in this configuration. > > > > 1. As we all know by now, the cache flush command (CMD6) fails with > > -110 currently. This is when MMC_CACHE_FLUSH_TIMEOUT_MS is set to 30 * > > 1000 (30s), which means __mmc_switch() drops the MMC_RSP_BUSY flag > > from the command. > > > > 2. Changing the MMC_CACHE_FLUSH_TIMEOUT_MS to 2000 (2s), means that > > the MMC_RSP_BUSY flag becomes set by __mmc_switch, because of the > > timeout_ms parameter is less than max_busy_timeout (2000 < 2581). > > Then everything works fine. > > > > 3. Updating the code to again use 30s as the > > MMC_CACHE_FLUSH_TIMEOUT_MS, but instead forcing the MMC_RSP_BUSY to be > > set, even when the timeout_ms becomes greater than max_busy_timeout. > > This also works fine. > > > > Clearly this indicates a problem that I think needs to be addressed in > > the sdhci driver. However, of course I can revert the three discussed > > patches to fix the problem, but that would only hide the issues and I > > am sure we would then get back to this issue, sooner or later. > > > > To fix the problem in the sdhci driver, I would appreciate if someone > > from TI and Nvidia can step in to help, as I don't have the HW on my > > desk. > > > > Comments or other ideas of how to move forward? > > > > Sorry I missed this earlier. > > I don't have an X15 with me here but I'm trying to set one up in our > remote farm. In the meantime, I tried to reproduce this issue on two > platforms (dra72-evm and am57xx-evm) and wasn't able to see the issue > because those eMMC's don't even have a cache. I will keep you updated > when I do get a board with a eMMC that has a cache. > > Is there a way to reproduce this CMD6 issue with another operation? Yes, most definitely. Let me cook a debug patch for you that should trigger the problem for another CMD6 operation. I will post something later this evening or in the mornings (Swedish timezone). Kind regards Uffe