Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3077964ybl; Sun, 25 Aug 2019 08:08:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqwea9GPfJSCbl3Ip5UcJopZi1NEJEuU3Eg4Ti/bbAmUGJUENjh4BDPplzGZGs6lsJrcBM4v X-Received: by 2002:a17:90a:f485:: with SMTP id bx5mr15514474pjb.113.1566745690901; Sun, 25 Aug 2019 08:08:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566745690; cv=none; d=google.com; s=arc-20160816; b=aQFWkz3Ru1o9/+ll5L2LWm/VkxBaePTew6gzN95phz35Po8ynIO1HBLz61NpdyyLvq DP7AWOBIWrBufZcAdeXIONkKG/3TWZND3aHwQ6o4w8DRaJDkhfSqkDrtsKX/ykNbZwAW VfVzvM8JZfrT6TRkXl0odEXBb8LkDUgErNKcQvYrv95cDyv39aB/1lwz75U8r+ohk88a 9Y4oLL9VSiPWazEwy9YdpjgTwHdU8WahMzUbZ6ekQgs3ckSaEF1pZsDTEc1yH8LUh7r5 qY5KxVWMQ3axj6nGD5iV3as5ifaN8UIcvBZXTiZM04lgSteifGL5+uY5fsei9S6E14qN iNPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=EzGMcTh8cYrJ0fJe6kpJtuwR7ufzId3YdTEGcvV46I4=; b=kM+MRTW1vA5YMGoZ0HS3KloZDZvPyLrKzyvMzUKDYgMw5eCEKWpIzIj+lJciCbPG90 AvjcKB9TrURflO2FIa+Yey4RiT0bk/z0Twm37BnCBGvRzoP39g8JaRv2obgyIJ7on+N4 vuR+P/Z0H48QCeVDbS7F3N5RU151Cg1l6YgJ9O5J0OFrOV1vRO57Hjqljb1rJ183pdxQ oEzmklwtcT20ABGknpuXhd1M59e7PduqUsYQ8wZebJcImGyi8571LwaKRJkKOg8hWPfX GxrjLxB5NkO5XpPIkF86LmUkaBPwUUSMy7mXLKQUkYo/iftaTr6e8apECq7uYIYsNjAy 8/qA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=T5bfT551; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s11si6733169pgg.200.2019.08.25.08.07.45; Sun, 25 Aug 2019 08:08:10 -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=@gmail.com header.s=20161025 header.b=T5bfT551; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728509AbfHYPGc (ORCPT + 99 others); Sun, 25 Aug 2019 11:06:32 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:37687 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725922AbfHYPGc (ORCPT ); Sun, 25 Aug 2019 11:06:32 -0400 Received: by mail-wr1-f68.google.com with SMTP id z11so12930143wrt.4; Sun, 25 Aug 2019 08:06:30 -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=dNGIS7aFuXx9z0yb4wxqkPSByqT7Q3i/ZxghtIsLGOr7Sm/a7ocE+Qx6RoZYPqlOmN J3jrVRgChm8AbF4at8MDN8VfNkou4AJsm6zYJgnWfu6D9Z7dZGbUIqr0ZDRvCVWBvjj4 q+ApfM9VTmdwHHTtqBR2YmZZvLoxDA1QkpWqwqS1tCR7nZL8Oi3dOVh9OumsbKB2L+CP 7GJXviH1IVAyasuJ35nPTASi9+seMqAHcynvrjSRMfheIWFC/nGyYb1OSR2cwBYbywdW eGofAoLECPaLuC/amsOJlFXBW+5nDNHxBMO/SIkuP4uIJJ3VJp0nIugNieF1V2ZyJLx1 euWw== X-Gm-Message-State: APjAAAUB1w8EYVte76DTgd2t7+AM+LRz8p1jhjnk1KKPBpjgSu2oM5Yg naqOrep9Yh9pG3++79MzgUw= 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=20Gonz=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 Cc: =?UTF-8?q?Alejandro=20Gonz=C3=A1lez?= , linux-sunxi@googlegroups.com 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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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); -- 2.20.1