From patchwork Tue Jul 3 14:03:28 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip Rakity X-Patchwork-Id: 1151101 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 8B7A7DFF72 for ; Tue, 3 Jul 2012 14:05:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752366Ab2GCOFl (ORCPT ); Tue, 3 Jul 2012 10:05:41 -0400 Received: from na3sys009aog117.obsmtp.com ([74.125.149.242]:39688 "EHLO na3sys009aog117.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750818Ab2GCOFk convert rfc822-to-8bit (ORCPT ); Tue, 3 Jul 2012 10:05:40 -0400 Received: from SC-OWA01.marvell.com ([65.219.4.129]) (using TLSv1) by na3sys009aob117.postini.com ([74.125.148.12]) with SMTP ID DSNKT/L8HbQzyudH86W6ry/CcB92Ko0GzAQJ@postini.com; Tue, 03 Jul 2012 07:05:40 PDT Received: from SC-vEXCH3.marvell.com ([10.93.76.133]) by SC-OWA01.marvell.com ([10.93.76.21]) with mapi; Tue, 3 Jul 2012 07:05:17 -0700 From: Philip Rakity To: Aaron Lu , Girish K S , Subhash Jadavani , Chris Ball CC: "linux-mmc@vger.kernel.org" , Aaron Lu , stable , "\"[3.3+]\"@domain.invalid" <"[3.3+]"@domain.invalid> Date: Tue, 3 Jul 2012 07:03:28 -0700 Subject: RE: [PATCH v2] mmc: sdhci: fix incorrect command used in tuning Thread-Topic: [PATCH v2] mmc: sdhci: fix incorrect command used in tuning Thread-Index: Ac1Y/jDLiYDajoZaRIebNipL19Ij5wAJm44n Message-ID: <43E4817426ED174AA81263BCECB4351D138E8ACE8D@sc-vexch3.marvell.com> References: <1341307669-20834-1-git-send-email-aaron.lu@amd.com> In-Reply-To: <1341307669-20834-1-git-send-email-aaron.lu@amd.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US MIME-Version: 1.0 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org Reviewed-by philip Rakity prakity@marvell.com diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index f76736b..4e53e6b 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -27,6 +27,7 @@ #include #include +#include #include "sdhci.h" @@ -1245,6 +1246,7 @@ static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq) struct sdhci_host *host; bool present; unsigned long flags; + u32 tuning_opcode; host = mmc_priv(mmc); @@ -1292,8 +1294,12 @@ static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq) */ if ((host->flags & SDHCI_NEEDS_RETUNING) && !(present_state & (SDHCI_DOING_WRITE | SDHCI_DOING_READ))) { + /* eMMC uses cmd21 while sd and sdio use cmd19 */ + tuning_opcode = mmc->card->type == MMC_TYPE_MMC ? + MMC_SEND_TUNING_BLOCK_HS200 : + MMC_SEND_TUNING_BLOCK; spin_unlock_irqrestore(&host->lock, flags); - sdhci_execute_tuning(mmc, mrq->cmd->opcode); + sdhci_execute_tuning(mmc, tuning_opcode); spin_lock_irqsave(&host->lock, flags); /* Restore original mmc_request structure */