Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp76422ybf; Wed, 26 Feb 2020 09:06:43 -0800 (PST) X-Google-Smtp-Source: APXvYqxdubLATNd5p2ZM0jJOjQX3VqlE1Egp5tA38dmw97VzQ+KpcKYlGSSUGr30ugI2bfU1RYqC X-Received: by 2002:a9d:760d:: with SMTP id k13mr3681553otl.42.1582736802899; Wed, 26 Feb 2020 09:06:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582736802; cv=none; d=google.com; s=arc-20160816; b=EAuq/jrb2X21Bh3Rv5VupixdWV1sJ4Z4PKthvLbpIjPFJ9PWEhk5NastWeOqEQMf7S KWYkzXGGoG+qjXz2dt9d6CG3OaIds+JfR7gJ+ln+3VaERLTP6FE3jI1dl39jASO2ttmn tUNqOReq3lW/b5fAqIGsrEHSsfKfyM8JjPBK9ctgXOq16lJvXfELqVpE3og2gj9KV26W NYeDCSipJ5+ZoEhHK4dQwDwKv3/AWF6xkeVS93FnW5h1nBsPBE095gnFhnqitJHQdiwb nB7Sti14yvIRkz9FdVcjGWNAfHtKWi5fp4+Euy1ywa0WqQZ+VKD7r+Qc6ftECK6CCgQI uMRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=6D+i0xe21mqqX6n5OUovAjoW11aRjUA9+tewaNzxrek=; b=UCTCqksUtDutlxIJMV/54/oAxAyNsq/GZqxT/ZcYUR9b715Qp/0sC+QNHJmaztCyQ+ H8Ugzm5VBGCZo8oOCoqCxLnIsqGrMqip0bGVwPcroB+U9B36stjLtqzRUrkZEULMUWvp QwJKYKDsgsvntr4zTywudCex69a7WHVoc6v63CbQo4IPE+fLp/i+ymUE4w/Y9AKGBISP JZkBq8Rpb6YBHhSqMkKNWQ6Fq0E9xLMQHHBEQ+jxlOh3m26UHUJwPQ3Dj1XoJfr314qM IV8ghJvYv/O8rOeDPW4xeprwxnX0No66ymIJqnXIyilHVIbfVDkx9URy7lpxc0UPBa+5 p39g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b="p/bZ0fff"; 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=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l19si1430623oii.54.2020.02.26.09.06.29; Wed, 26 Feb 2020 09:06:42 -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=@nvidia.com header.s=n1 header.b="p/bZ0fff"; 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=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728186AbgBZRFC (ORCPT + 99 others); Wed, 26 Feb 2020 12:05:02 -0500 Received: from hqnvemgate24.nvidia.com ([216.228.121.143]:17429 "EHLO hqnvemgate24.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727470AbgBZRFC (ORCPT ); Wed, 26 Feb 2020 12:05:02 -0500 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate24.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Wed, 26 Feb 2020 09:03:42 -0800 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Wed, 26 Feb 2020 09:05:00 -0800 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Wed, 26 Feb 2020 09:05:00 -0800 Received: from [10.21.133.51] (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Wed, 26 Feb 2020 17:04:56 +0000 Subject: Re: LKFT: arm x15: mmc1: cache flush error -110 To: Ulf Hansson , Faiz Abbas , Bitan Biswas CC: Sowjanya Komatineni , Adrian Hunter , Naresh Kamboju , "Jens Axboe" , Alexei Starovoitov , linux-block , , open list , "linux-mmc@vger.kernel.org" , Arnd Bergmann , John Stultz , Thierry Reding , Anders Roxell , Kishon References: <6523119a-50ac-973a-d1cd-ab1569259411@nvidia.com> <0963b60f-15e7-4bc6-10df-6fc8003e4d42@nvidia.com> From: Jon Hunter Message-ID: Date: Wed, 26 Feb 2020 17:04:54 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1582736623; bh=6D+i0xe21mqqX6n5OUovAjoW11aRjUA9+tewaNzxrek=; h=X-PGP-Universal:Subject:To:CC:References:From:Message-ID:Date: User-Agent:MIME-Version:In-Reply-To:X-Originating-IP: X-ClientProxiedBy:Content-Type:Content-Language: Content-Transfer-Encoding; b=p/bZ0fff0n82hLSAwmcx0IFIA2eqFqLqQpyfZXDEcFPIUummqVfxXcQTIuqyWF1/i SK/uMll2Si5bisQfKYh75ukgPugxg8f5/KJxFg5Tvyqxit8Zt0NkpaME9B18VW1yuW JS0E1SOHEMh+5MYI7tHYpzV4sOHKWFn5VCNdIRLYbxNidMpYk2T5S5Ys9L511i8e9C /p/NOzHkP9Ju5PZj83rIjEHNOtbqWncEHAArlMGWO6iKfvDzpmcDdRWl7Guy+uXUQT /ShWW4i3pz16zR9rs4UhROn0VeKrSGkYunKEGxUh6mwVYDBCjAseQt3DxiwjneA60T GUOFOGxsNEouA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 26/02/2020 15:21, 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 no I don't believe that we have explicitly tried erase commands and no there is nothing special that we are doing for erase. > 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. OK, let me check to see who can help from our side. Cheers Jon -- nvpublic