From patchwork Sun Aug 25 15:05:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alejandro_Gonz=C3=A1lez?= X-Patchwork-Id: 11113515 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4713C1395 for ; Sun, 25 Aug 2019 15:06:37 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 24A3320850 for ; Sun, 25 Aug 2019 15:06:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="thMuJx/b"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="T5bfT551" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 24A3320850 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=fov0LxtugoMXsuYIxfkZYk2b1t+04fL+5af1pK252hI=; b=thMuJx/bF9XiT5 xUJXUhqeb+FKOxjzVWLz1Hni8CHm44EuEuT90eos46DiaiW/mfywYjcqK3aZRz7tMqAFLPgp85XrU QV5Vvg0fwEHElWHK+R7WW1Q176JGvcl9GkW5d72co5jeGJWVRsMXUeQ/tD8B6HBg8rJ5dHxBcHW2J s4UrUki/uHPz6O5Zq2hVDYvu9JmeFxg3k22YQBKBf7V37Vw+DpxKvW/IHZD5JLUnemCHXGb7Fg8zS EEKRp0uRhW6V0y5Ymp8hAWwPz556gsJl8q07kemeOXUzUoI1MLEZxm5g1xDuW1cekQJDooZgd/WGX 9oqyxRvRfjnS6xcw0FRg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1i1u6G-0000tY-00; Sun, 25 Aug 2019 15:06:36 +0000 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1i1u6C-0000sU-7a for linux-arm-kernel@lists.infradead.org; Sun, 25 Aug 2019 15:06:33 +0000 Received: by mail-wr1-x443.google.com with SMTP id s18so12942276wrn.1 for ; Sun, 25 Aug 2019 08:06:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=EzGMcTh8cYrJ0fJe6kpJtuwR7ufzId3YdTEGcvV46I4=; b=T5bfT551DOss2tIjS7I2D9v9HeNSyM5WLjI8qnaGhZ9u4N1hbrB3ulttCaa2blX5jI 1gV+3u+MmKX5SPS4cX4sW6NDrBGJje62dhV0GEpJiuillbYjPDOtGMS4x6eyXDsugnsw 5f+MCJy8iM6OUqmY7kHZmJhkXtNFEnZrv/LeNDl+9LiAyo0ewRnx1WJf3eBTIp3t/T4l KmMc/mLNHp2+yiQJWPtktOd6PSSpkNzlmV7u+0jOMUoaibDXqc9IGylOCZq4nCpkVpA3 E0NpW+MY2wH69YVMO2ELq0V9nVvvVIs1MZNkAFRbKXrauKk8S12s+if2/wjKu5dUeTta AUMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=EzGMcTh8cYrJ0fJe6kpJtuwR7ufzId3YdTEGcvV46I4=; b=Qu3+RAzNMi3lYuORPbKo2iWdnLLoGUiVSfqXq8XmAx7pdqEHT84pNJsSyDMyL1StmO DbZJzh+SZZ3SZOCI9usVxUuRk+3qDZsJPc4RH1oIUqB4oLSh69AR5Px9Cy+dWo2xO33u YFY8P3bzWqYDJ1e9yxVG8RWU9VvlcZjKIglkHL7koTStJougCRHHrafjdBl4m5HJ4gGc AMXirSbsKtsIJbN6uHQktHDLBqYlkgTCo5amwiz+QGeL3G1RtWmV+4QcMLWzJHUBzsBw lHbPmePg6R5/5mfZY/qHSs67yzMgKGZw56M5CY9/oRJVSzNOKwuXYM2zLjR1omLUcu7k b1Rw== X-Gm-Message-State: APjAAAUhNVMgVKfTR+/x/WqObC78biwtEQORvONPxcQE1mlR8OV7Bjoj L5TlqLr5mVzGaofVIRuUFEk= X-Google-Smtp-Source: APXvYqw/WXTJJuzkVX90/eatj/z3u7hsIamk6YChmEn5woj5sKeT2mTbgpIkmQXqmhDcW2TWZ1Cesw== X-Received: by 2002:adf:f6d2:: with SMTP id y18mr16829269wrp.102.1566745589786; Sun, 25 Aug 2019 08:06:29 -0700 (PDT) Received: from alejandro-pc.mundo-R.com (57.166.117.91.dynamic.reverse-mundo-r.com. [91.117.166.57]) by smtp.gmail.com with ESMTPSA id 24sm8571017wmf.10.2019.08.25.08.06.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Aug 2019 08:06:29 -0700 (PDT) From: =?utf-8?q?Alejandro_Gonz=C3=A1lez?= To: ulf.hansson@linaro.org, maxime.ripard@bootlin.com, wens@csie.org, linus.walleij@linaro.org, gregkh@linuxfoundation.org, tglx@linutronix.de, linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] mmc: sunxi: fix unusuable eMMC on some H6 boards by disabling DDR Date: Sun, 25 Aug 2019 17:05:58 +0200 Message-Id: <20190825150558.15173-1-alejandro.gonzalez.correo@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190825_080632_277683_54853D25 X-CRM114-Status: GOOD ( 12.86 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:443 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (alejandro.gonzalez.correo[at]gmail.com) -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-sunxi@googlegroups.com, =?utf-8?q?Alejandro_Gonz=C3=A1lez?= Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Some Allwinner H6 boards have timing problems when dealing with DDR-capable eMMC cards. These boards include the Pine H64 and Tanix TX6. These timing problems result in out of sync communication between the driver and the eMMC, which renders the memory unsuable for every operation but some basic commmands, like reading the status register. The cause of these timing problems is not yet well known, but they go away by disabling DDR mode operation in the driver. Like on some H5 boards, it might be that the traces are not precise enough to support these speeds. However, Jernej Skrabec compared the BSP driver with this driver, and found that the BSP driver configures pinctrl to operate at 1.8 V when entering DDR mode (although 3.3 V operation is supported), while the mainline kernel lacks any mechanism to switch voltages dynamically. Finally, other possible cause might be some timing parameter that is different on the H6 with respect to other SoCs. Therefore, as this fix works reliably, the kernel lacks the required dynamic pinctrl control for now and a slow eMMC is better than a not working eMMC, just disable DDR operation for now on H6-compatible devices. Signed-off-by: Alejandro González --- drivers/mmc/host/sunxi-mmc.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c index d577a6b0ceae..dac57d76d009 100644 --- a/drivers/mmc/host/sunxi-mmc.c +++ b/drivers/mmc/host/sunxi-mmc.c @@ -1395,14 +1395,17 @@ static int sunxi_mmc_probe(struct platform_device *pdev) /* * Some H5 devices do not have signal traces precise enough to - * use HS DDR mode for their eMMC chips. + * use HS DDR mode for their eMMC chips. Other H6 devices operate + * unreliably on HS DDR mode, too. * * We still enable HS DDR modes for all the other controller - * variants that support them. + * variants that support them properly. */ if ((host->cfg->clk_delays || host->use_new_timings) && !of_device_is_compatible(pdev->dev.of_node, - "allwinner,sun50i-h5-emmc")) + "allwinner,sun50i-h5-emmc") && + !of_device_is_compatible(pdev->dev.of_node, + "allwinner,sun50i-h6-emmc")) mmc->caps |= MMC_CAP_1_8V_DDR | MMC_CAP_3_3V_DDR; ret = mmc_of_parse(mmc);