From patchwork Wed Sep 30 03:28:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaotian Jing X-Patchwork-Id: 7292421 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E0576BEEA4 for ; Wed, 30 Sep 2015 03:28:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DDC862069D for ; Wed, 30 Sep 2015 03:28:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 04C5E20640 for ; Wed, 30 Sep 2015 03:28:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752598AbbI3D2Y (ORCPT ); Tue, 29 Sep 2015 23:28:24 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:56603 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752320AbbI3D2Y (ORCPT ); Tue, 29 Sep 2015 23:28:24 -0400 X-Listener-Flag: 11101 Received: from mtkhts09.mediatek.inc [(172.21.101.70)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 784999785; Wed, 30 Sep 2015 11:28:22 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkhts09.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 14.3.181.6; Wed, 30 Sep 2015 11:28:21 +0800 From: Chaotian Jing To: Ulf Hansson CC: Matthias Brugger , Adrian Hunter , Johan Rudholm , Gwendal Grignou , , , , , , Sascha Hauer , Chaotian Jing Subject: [PATCH] mmc: core: Fix init_card in 52Mhz Date: Wed, 30 Sep 2015 11:28:08 +0800 Message-ID: <1443583688-1952-1-git-send-email-chaotian.jing@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty MIME-Version: 1.0 X-MTK: N Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Suppose that we got a data crc error, and it triggers the mmc_reset. mmc_reset will call mmc_send_status to see if HW reset was supported. before issue CMD13, it will do retune, and if EMMC was in HS400 mode, it will reduce frequency to 52Mhz firstly, that results in card init was doing at 52Mhz, So need ensure frequency is lower than 400Khz when re-init card. Signed-off-by: Chaotian Jing --- drivers/mmc/core/mmc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index e726903..f2d0c2a 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c @@ -1945,6 +1945,7 @@ static int mmc_reset(struct mmc_host *host) /* Set initial state and call mmc_set_ios */ mmc_set_initial_state(host); + mmc_set_clock(host, host->f_init); mmc_host_clk_release(host); return mmc_init_card(host, card->ocr, card);