Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp707538imm; Thu, 26 Jul 2018 10:33:25 -0700 (PDT) X-Google-Smtp-Source: AAOMgpek1yJ/0513WPCz4sRStMpqd4FNWnUCrneeQxRZmSHkrjuW1Fu8GM8FwQBMB/MmHHQJUvN0 X-Received: by 2002:a65:4587:: with SMTP id o7-v6mr2825656pgq.317.1532626405188; Thu, 26 Jul 2018 10:33:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532626405; cv=none; d=google.com; s=arc-20160816; b=s2Q2xhUHM/p593imcqiy9+u9kXgmKbNd3hp4pJ/aLdWC/R4Ex/w/E5k/3F2p6ZbDrP PED0rA93GcS+rZ2lfdK1cclVWLt4z4HCPam9Szde/YMioGC/Ex/mv8Z7UgR381/X2tOp 6XKA/9/OBLLpKoUB6D/v3dB6fisRh1axMU3n73wqpGVF1yDumFCB+XHpu2jOZykNwdqG lNZoDs+gpBFeZ6qkh4xRWA7o+5z3/zkmJK+0l7nfqvS/17qbwIwdXHb0OK/DNGUTDCmD ufHIZVdwD+NxJvwc7PUHzhQvRpOjBS4HvY8CYH+067Lj5SJLwuQybXmLFhThKz30PhOO 99EA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature:arc-authentication-results; bh=gGySqHsD7ddUdZi6Faj4tPcRc8bXjcjrTc1a6dliwD4=; b=cPafSBPJ8xmpUICo0BXW6FV4VhbbW7u8BlTECn4bk2mkKU92CVJ81DZ6czdnNTjlUG 7jzWtfGcO3j+mbah1kECZdRAWvyGK1mMhl5i98EHUFzF4JjY+7oRtQ6ftYpTSFdRaPWT k7Exs1rk/LjaLCpY++unnscftqILuPyIZANluUQSYplI3H/RVXlTxYKglQSsOsbIQSnd qOBYfDYOtqTKOXKNZmYDlG/sq8hmbhkT9u6sdt0qgMQfhMLOlak8CuggdSp7iiwZq+OG m9qoeNVzpWkIDbc8xivnc0YYwPeLjeX83arZ/S4E0AC2dcjaP97OOfbRlVm4I2ZUJ40V 2rlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@agner.ch header.s=dkim header.b=VAw7Ughd; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t1-v6si1745834pgg.643.2018.07.26.10.33.08; Thu, 26 Jul 2018 10:33:25 -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=@agner.ch header.s=dkim header.b=VAw7Ughd; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731859AbeGZRLy (ORCPT + 99 others); Thu, 26 Jul 2018 13:11:54 -0400 Received: from mail.kmu-office.ch ([178.209.48.109]:57772 "EHLO mail.kmu-office.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731709AbeGZRLy (ORCPT ); Thu, 26 Jul 2018 13:11:54 -0400 Received: from webmail.kmu-office.ch (unknown [IPv6:2a02:418:6a02::a3]) by mail.kmu-office.ch (Postfix) with ESMTPSA id 3FD8F5C21BC; Thu, 26 Jul 2018 17:51:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1532620274; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gGySqHsD7ddUdZi6Faj4tPcRc8bXjcjrTc1a6dliwD4=; b=VAw7UghdneQLRlx6RqgXMFwKOOQMiThNTqTzvoDPSoJkY76I8ud2scx+GMFW35CNxAmE+h CIyQPdyX741snEb9RVR3Cd1QRQAqaCtfVOXhp9/xxPHTViRxveTx0K+sh5wRNUlUP3UhG8 I967d0Do1nDH4c64bkCOH4aatjlN2gM= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Date: Thu, 26 Jul 2018 17:51:13 +0200 From: Stefan Agner To: Peter Geis Cc: adrian.hunter@intel.com, ulf.hansson@linaro.org, thierry.reding@gmail.com, jonathanh@nvidia.com, marcel.ziswiler@toradex.com, linux-mmc@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, linux-tegra-owner@vger.kernel.org Subject: Re: [PATCH 3/3] mmc: tegra: prevent ACMD23 on Tegra 3 In-Reply-To: <553f9ed6-8f7c-775b-d731-fd9732f74b07@gmail.com> References: <20180712073904.4705-1-stefan@agner.ch> <20180712073904.4705-3-stefan@agner.ch> <430c718d-9ede-d47a-44c0-b8e47e297720@gmail.com> <1553c44e99b96a813af129d1c4169222@agner.ch> <553f9ed6-8f7c-775b-d731-fd9732f74b07@gmail.com> Message-ID: <7edc8c666dbbc0743221c86286ff583a@agner.ch> X-Sender: stefan@agner.ch User-Agent: Roundcube Webmail/1.3.4 X-Spamd-Result: default: False [1.40 / 15.00]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; SUSPICIOUS_RECIPS(1.50)[]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_SEVEN(0.00)[10]; FROM_EQ_ENVFROM(0.00)[]; DKIM_SIGNED(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_COUNT_ZERO(0.00)[0]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 26.07.2018 17:12, Peter Geis wrote: > On 07/26/2018 10:47 AM, Stefan Agner wrote: >> On 26.07.2018 15:56, Peter Geis wrote: >>> On 07/12/2018 03:39 AM, Stefan Agner wrote: >>>> It seems that SD3.0 advertisement needs to be set for higher eMMC >>>> speed modes (namely DDR52) as well. The TRM states that the SD3.0 >>>> advertisement bit should be set for all controller instances, even >>>> for those not supporting UHS-I mode... >>>> >>>> When specifying vqmmc-supply as a fixed 1.8V regulator on a Tegra >>>> SD/MMC instance which is connected to a eMMC device, the stack >>>> enables SD3.0. However, enabling it has consequences: If SDHCI 3.0 >>>> support is advertised the stack enables Auto-CMD23. Unfortunately >>>> Auto-CMD23 seems not to work well with Tegra 3 currently. It leads >>>> to regular warnings: >>>> mmc2: Got command interrupt 0x00010000 even though no command operation was in progress. >>>> >>>> It is not entirely clear why those errors happens. It seems that >>>> a Linux 3.1 based downstream kernel which has Auto-CMD23 support >>>> does not show those warnings. >>>> >>>> Use quirk SDHCI_QUIRK2_ACMD23_BROKEN to prevent Auto-CMD23 being >>>> used for now. With this the eMMC works stable on high-speed mode >>>> while still announcing SD3.0. >>>> >>>> This allows to use mmc-ddr-1_8v to enables DDR52 mode. In DDR52 >>>> mode read speed improves from about 42MiB/s to 72MiB/s on an >>>> Apalis T30. >>>> >>>> Signed-off-by: Stefan Agner >>>> --- >>>> drivers/mmc/host/sdhci-tegra.c | 10 +++++++++- >>>> 1 file changed, 9 insertions(+), 1 deletion(-) >>>> >>>> diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c >>>> index 888a1ad511db..11c0b2069c7c 100644 >>>> --- a/drivers/mmc/host/sdhci-tegra.c >>>> +++ b/drivers/mmc/host/sdhci-tegra.c >>>> @@ -336,7 +336,15 @@ static const struct sdhci_pltfm_data sdhci_tegra30_pdata = { >>>> SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC | >>>> SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN, >>>> .quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN | >>>> - SDHCI_QUIRK2_BROKEN_HS200, >>>> + SDHCI_QUIRK2_BROKEN_HS200 | >>>> + /* >>>> + * Auto-CMD23 leads to "Got command interrupt 0x00010000 even >>>> + * though no command operation was in progress." >>>> + * >>>> + * The exact reason is unknown, as the same hardware seems >>>> + * to support Auto CMD23 on a downstream 3.1 kernel. >>>> + */ >>>> + SDHCI_QUIRK2_ACMD23_BROKEN, >>>> .ops = &tegra_sdhci_ops, >>>> }; >>>> >>> >>> I finally got around to testing this on the Ouya (Tegra 3). >> >> Thanks for testing! >> >>> >>> I found that the "Got command interrupt 0x00010000 even though no >>> command operation was in progress." error occurred when the interface >>> is unstable. >>> I've had a lot of problems with sdmmc4 stability on the Ouya above 34 >>> Mhz, probably due to the fact that they are using the internal cmd and >>> clock pull-up resistors, against the TRM's instruction. >>> At 39Mhz, I saw the error this patch corrects. >>> With the patch, the error went away, but the interface is still >>> unstable under load. >> >> How does this instability manifest exactly? >> > > At the very edge of stability, you see write errors under heavy load. > As clock rate increases, the write errors occur more frequently. > At a certain point, you start getting read errors. > Following that you get constant io errors during card probing. > Eventually the emmc will fail to initialize, with errors 87 or 110. What mode are you running at actually? E.g. what is the ios file saying? cat /sys/kernel/debug/mmcX/ios > > I've been tweaking the pull up/down values to try and improve the > stability, but without access to anything but the TRM it's a lot of > trial and error. > Hm, maybe Marcel's recent fixes in our device tree are helpful? https://lkml.org/lkml/2018/7/22/165 Also make sure to have a complete pinmux such that alternative pins for sdmmc4 are *not* muxed as sdmmc4. >>> >>> Lowering down to 32Mhz, without the patch there are no errors. >> >> So the patch does not make it less stable right? >> > > No, it did not affect stability. > Although I'd conduct some performance testing to check for degradation. > Of course I'm nowhere near the limits of the controller, so it is > doubtful I'd see a hit. Ok, and this is with the complete patchset applied correct? Btw, what device tree are you using? Ouya is not upstream as far as I can tell? -- Stefan > >> -- >> Stefan >> > -- > To unsubscribe from this list: send the line "unsubscribe linux-tegra" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html