From patchwork Tue Feb 5 15:42:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 10797537 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6BB1F6C2 for ; Tue, 5 Feb 2019 15:42:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 57E482C5E8 for ; Tue, 5 Feb 2019 15:42:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 55C7B2C649; Tue, 5 Feb 2019 15:42:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C7C6A2C625 for ; Tue, 5 Feb 2019 15:42:46 +0000 (UTC) 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=rLSJrJZ9HHgEXgMw7NOsXTs+PmQojk9LC8qBXtKh3eg=; b=lQSCqsWXCdXMvd Q94VY88tTMn4tlZqN0zYHccMywWfVlDle2oZcsU0HlYHBnw615FD4BalvHAAUYSuQRiZGrqdTol7w MoRa05TpUoe99knRX4dCAj7oZY/InWC+6QQB38mdq+p15zmFZ7hwlLUHHUSNGIU42gWlKnZo/VFgP 91iHli8gB8HJw9I7ikhMDkrjbeMxzDYsDzA2tNBqmrR2tRc2jU3TPmpaCc1VXCkPPrepz3AE4KV8R XUvbe7sD8KLj8w+gsGK5t3hkB7rzpVVme73NUJqPeK+dmIQEAaGnmHfjxk+lC+KTyvn+ptB5nmSMG NkihkKO0FifItNWYIJKA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gr2s0-0003Mh-EA; Tue, 05 Feb 2019 15:42:44 +0000 Received: from mirror2.csie.ntu.edu.tw ([140.112.30.76] helo=wens.csie.org) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gr2rl-00038O-0r for linux-arm-kernel@lists.infradead.org; Tue, 05 Feb 2019 15:42:31 +0000 Received: by wens.csie.org (Postfix, from userid 1000) id 608235FCC3; Tue, 5 Feb 2019 23:42:26 +0800 (CST) From: Chen-Yu Tsai To: Ulf Hansson , Maxime Ripard Subject: [PATCH v2 0/3] mmc: sunxi: Fix eMMC usage on H5 boards Date: Tue, 5 Feb 2019 23:42:22 +0800 Message-Id: <20190205154225.14264-1-wens@csie.org> 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-20190205_074229_271219_9A50F8C3 X-CRM114-Status: GOOD ( 14.81 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Chris Blake , linux-mmc@vger.kernel.org, linux-sunxi@googlegroups.com, linux-kernel@vger.kernel.org, Chen-Yu Tsai , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Hi everyone, This is v2 of my H5 eMMC fix series. Changes since v1: - Don't block HS200 and UHS modes, since these have been tested Original cover letter: Since the HS-DDR mode was enabled for the A64 eMMC controller, there have been reports of eMMC failing to work on some H5 boards. It seems that while the H5 and A64 share the same controller for eMMC, some H5 boards don't have trace lengths that work under HS-DDR with the default delay chain settings. Unfortunately we don't support tuning them at the moment, and these boards didn't seem to come with any settings either. Instead HS-DDR just wasn't enabled. The failure is typically a data CRC error on data reads, such as the partition scanning when the device is first probed. While this in itself would result in the device being unusable, there seems to be a timing issue in the recovery of the MMC controller. After the CRC error, the driver manually issues a stop command to the device, which also fails. After this a following command would stall: the MMC subsystem waits for the completion notice of the request, which never happens. The stall also blocks udev, which kind of blocks the whole boot process. However if I turn on debug messages to try to narrow down the issue, it recovers just fine. Any help on this issue would be much appreciated. I propose we turn off HS-DDR on the H5 (maybe even the H6, but I don't have anything to test right now) by default, and enable it per-board using the common mmc binding properties for speed modes. Patch 1 disables HS-DDR for H5 eMMC. Patch 2 adds a check blocking (force disabling) any modes the driver doesn't support. In retrospect this should have been added a long time ago. Patch 3 enables HS-DDR for the Libre Computer ALL-H3-CC H5, which works normally. If possible please merge all of them as fixes. Regards ChenYu Chen-Yu Tsai (3): mmc: sunxi: Disable HS-DDR mode for H5 eMMC controller by default mmc: sunxi: Filter out unsupported modes declared in the device tree arm64: dts: allwinner: h5: libretech-all-h3-cc: Mark eMMC HS-DDR 3.3V capable .../sun50i-h5-libretech-all-h3-cc.dts | 4 +++ drivers/mmc/host/sunxi-mmc.c | 26 ++++++++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-)