From patchwork Fri Jan 6 02:33:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Lin X-Patchwork-Id: 9499907 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D993D60413 for ; Fri, 6 Jan 2017 02:36:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CF06B27F8C for ; Fri, 6 Jan 2017 02:36:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C37BC283FC; Fri, 6 Jan 2017 02:36:50 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3DAA427F8C for ; Fri, 6 Jan 2017 02:36:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S937498AbdAFCgH (ORCPT ); Thu, 5 Jan 2017 21:36:07 -0500 Received: from lucky1.263xmail.com ([211.157.147.130]:38603 "EHLO lucky1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754220AbdAFCfv (ORCPT ); Thu, 5 Jan 2017 21:35:51 -0500 Received: from shawn.lin?rock-chips.com (unknown [192.168.167.130]) by lucky1.263xmail.com (Postfix) with ESMTP id 515391EEE49; Fri, 6 Jan 2017 10:35:18 +0800 (CST) X-263anti-spam: X-MAIL-GRAY: 1 X-MAIL-DELIVERY: 0 Received: from [172.16.12.182] (localhost [127.0.0.1]) by smtp.263.net (Postfix) with ESMTP id DC1B4427; Fri, 6 Jan 2017 10:34:27 +0800 (CST) X-RL-SENDER: shawn.lin@rock-chips.com X-FST-TO: linux-kernel@vger.kernel.org X-SENDER-IP: 58.22.7.114 X-LOGIN-NAME: shawn.lin@rock-chips.com X-UNIQUE-TAG: <1af1fbb83c493a7876c907eb03ce2b03> X-ATTACHMENT-NUM: 0 X-SENDER: lintao@rock-chips.com X-DNS-TYPE: 0 Received: from [172.16.12.182] (unknown [58.22.7.114]) by smtp.263.net (Postfix) whith ESMTP id 10764BHO7O0; Fri, 06 Jan 2017 10:34:40 +0800 (CST) Subject: Re: eMMC boot problem: switch to bus width 8 ddr failed To: Clemens Gruber , linux-mmc@vger.kernel.org References: <20170106004114.GA22893@archie.localdomain> Cc: shawn.lin@rock-chips.com, Ulf Hansson , Linus Walleij , Adrian Hunter , Dong Aisheng , linux-kernel@vger.kernel.org From: Shawn Lin Message-ID: <1754f0ae-fe6f-00a2-a0d6-9fd55c2b866f@rock-chips.com> Date: Fri, 6 Jan 2017 10:33:49 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <20170106004114.GA22893@archie.localdomain> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 2017/1/6 8:41, Clemens Gruber wrote: > Hi, > > with the current mainline 4.10-rc2 kernel, I can no longer boot from > the eMMC on my i.MX6Q board. > > Details: > The eMMC is a Micron MTFC4GACAJCN-1M WT but as the i.MX6Q only supports > eMMC 4.41 features and we did not implement voltage switching from 3.3V > to 1.8V or lower, I did add no-1-8-v; (but none of the mmc-ddr or mmc-hs > options) to the device tree. The bus-width is 8. > > With 4.9 the board booted fine, now with the current mainline 4.10 tree, > I get the following (repeating) errors at boot: > > [ 4.326834] Waiting for root device /dev/mmcblk0p2... > [ 14.563861] mmc0: Timeout waiting for hardware cmd interrupt. > [ 14.569619] sdhci: =========== REGISTER DUMP (mmc0)=========== > [ 14.575461] sdhci: Sys addr: 0x4e726000 | Version: 0x00000002 > [ 14.581300] sdhci: Blk size: 0x00000200 | Blk cnt: 0x00000001 > [ 14.587140] sdhci: Argument: 0x00010000 | Trn mode: 0x00000013 > [ 14.592979] sdhci: Present: 0x01fd8009 | Host ctl: 0x00000031 > [ 14.598816] sdhci: Power: 0x00000002 | Blk gap: 0x00000080 > [ 14.604654] sdhci: Wake-up: 0x00000008 | Clock: 0x0000001f > [ 14.610493] sdhci: Timeout: 0x0000008f | Int stat: 0x00000000 > [ 14.616332] sdhci: Int enab: 0x107f100b | Sig enab: 0x107f100b > [ 14.622168] sdhci: AC12 err: 0x00000000 | Slot int: 0x00000003 > [ 14.628007] sdhci: Caps: 0x07eb0000 | Caps_1: 0x0000a007 > [ 14.633845] sdhci: Cmd: 0x00000d1a | Max curr: 0x00ffffff it shows you always fail to get resp of sending status within the expected period of time. > [ 14.639682] sdhci: Host ctl2: 0x00000000 > [ 14.643611] sdhci: ADMA Err: 0x00000000 | ADMA Ptr: 0x4e6f7208 > [ 14.649447] sdhci: =========================================== > > This repeats a few times, then more information is shown at the bottom: > > [ 86.893859] mmc0: Timeout waiting for hardware cmd interrupt. > [ 86.899615] sdhci: =========== REGISTER DUMP (mmc0)=========== > [ 86.905453] sdhci: Sys addr: 0x00000000 | Version: 0x00000002 > [ 86.911291] sdhci: Blk size: 0x00000200 | Blk cnt: 0x00000001 > [ 86.917129] sdhci: Argument: 0x00010000 | Trn mode: 0x00000013 > [ 86.922967] sdhci: Present: 0x01fd8009 | Host ctl: 0x00000031 > [ 86.928804] sdhci: Power: 0x00000002 | Blk gap: 0x00000080 > [ 86.934642] sdhci: Wake-up: 0x00000008 | Clock: 0x0000001f > [ 86.940479] sdhci: Timeout: 0x0000008f | Int stat: 0x00000000 > [ 86.946316] sdhci: Int enab: 0x107f100b | Sig enab: 0x107f100b > [ 86.952154] sdhci: AC12 err: 0x00000000 | Slot int: 0x00000003 > [ 86.957992] sdhci: Caps: 0x07eb0000 | Caps_1: 0x0000a007 > [ 86.963830] sdhci: Cmd: 0x00000d1a | Max curr: 0x00ffffff > [ 86.969668] sdhci: Host ctl2: 0x00000000 > [ 86.973596] sdhci: ADMA Err: 0x00000000 | ADMA Ptr: 0x00000000 > [ 86.979433] sdhci: =========================================== > [ 86.986356] mmc0: switch to bus width 8 ddr failed > [ 86.991163] mmc0: error -110 whilst initialising MMC card > [ 97.773859] mmc0: Timeout waiting for hardware cmd interrupt. > > -- > > After looking through the latest commits to mmc/core, I found the > culprit: > Commit e173f8911f091fa50ccf8cc1fa316dd5569bc470 ("mmc: core: Update > CMD13 polling policy when switch to HS DDR mode") > > Reverting it fixes the problem. But I am unsure if that's the right > course of action? > > Feel free to send me patches for testing! By looking the changes itself, it should be good from the view of spec. Maybe you could try the patch below, but don't beat me if that doesn't help at all. :) > > Regards, > Clemens > -- > To unsubscribe from this list: send the line "unsubscribe linux-mmc" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Tested-by: Clemens Gruber --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c @@ -1074,7 +1074,7 @@ static int mmc_select_hs_ddr(struct mmc_card *card) EXT_CSD_BUS_WIDTH, ext_csd_bits, card->ext_csd.generic_cmd6_time, - MMC_TIMING_MMC_DDR52, + 0, true, true, true); if (err) { pr_err("%s: switch to bus width %d ddr failed\n", @@ -1118,6 +1118,9 @@ static int mmc_select_hs_ddr(struct mmc_card *card) if (err) err = __mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_330); + if (!err) + mmc_set_timing(host, MMC_TIMING_MMC_DDR52); +