From patchwork Fri Aug 5 13:30:47 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: subhashj@codeaurora.org X-Patchwork-Id: 1038642 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p75DUrbf028778 for ; Fri, 5 Aug 2011 13:30:53 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754934Ab1HENaw (ORCPT ); Fri, 5 Aug 2011 09:30:52 -0400 Received: from wolverine01.qualcomm.com ([199.106.114.254]:19417 "EHLO wolverine01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754761Ab1HENav (ORCPT ); Fri, 5 Aug 2011 09:30:51 -0400 X-IronPort-AV: E=McAfee;i="5400,1158,6428"; a="108349425" Received: from pdmz-ns-mip.qualcomm.com (HELO mostmsg01.qualcomm.com) ([199.106.114.10]) by wolverine01.qualcomm.com with ESMTP/TLS/ADH-AES256-SHA; 05 Aug 2011 06:30:51 -0700 Received: from SUBHASHJ (pdmz-snip-v218.qualcomm.com [192.168.218.1]) by mostmsg01.qualcomm.com (Postfix) with ESMTPA id C9DB810004D3; Fri, 5 Aug 2011 06:30:49 -0700 (PDT) From: "Subhash Jadavani" To: Cc: "'Nath, Arindam'" , "'Chris Ball'" , "'Philip Rakity'" , "'zhangfei gao'" References: <1312199897-5536-1-git-send-email-subhashj@codeaurora.org> <6C03668EAF45B747AF947A1603D1B3000197C66B0B@SAUSEXMBP01.amd.com> <000001cc50f4$5a9e5530$0fdaff90$@org> <6C03668EAF45B747AF947A1603D1B3000197C66BA2@SAUSEXMBP01.amd.com> <000601cc5111$64c0e9c0$2e42bd40$@org> In-Reply-To: <000601cc5111$64c0e9c0$2e42bd40$@org> Subject: Issue with non-UHS-I SD3.0 cards Date: Fri, 5 Aug 2011 19:00:47 +0530 Message-ID: <000001cc5373$e4e466e0$aead34a0$@org> MIME-Version: 1.0 X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcxQh3zFz8Zznik4Qa2CooT2l03TmgAWmBawAAQOM7AAARlQ0AAGp0qwAJhxt1A= Content-Language: en-us Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 05 Aug 2011 13:30:53 +0000 (UTC) Hi, I am seeing the issue where "SanDisk Extreme SDHC 8GB Class 10 card" is running in "Default Speed" mode even though it supports "High Speed" mode. After analysis, I found that this card is advertising itself as SD3.0 card (with SD_SPEC=2 and SD_SPEC3=1 in SCR). But current mmc core later initialization sequence for SD3.0 cards is such that these non-UHS-I SD3.0 cards runs in Default Speed mode @25MHz. Here is Essential conditions to indicate Version 3.00 Card (from SD3.01 spec) (SD_SPEC=2 and SD_SPEC3=1) : (1) The card shall support CMD6 (2) The card shall support CMD8 (3) The card shall support CMD42 (4) User area capacity shall be up to 2GB (SDSC) or 32GB (SDHC) User area capacity shall be more than or equal to 32GB and up to 2TB (SDXC) (5) Speed Class shall be supported (SDHC or SDXC) So even if SD card doesn't support any of the newly defined UHS-I bus speed mode, it can advertise itself as SD3.0 cards as long as it supports all the essential conditions of SD3.0 cards. Given this, these type of cards should at least run in High Speed mode @50MHZ if it supports HS. Here are the changes you have to do to make non-UHS-I SD3.0 cards run in High Speed Mode @50MHz. Do let me know if looks fine or not, so I can post the formal patch. Reviewed-by: Arindam Nath --- drivers/mmc/core/sd.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) -- Regards, Subhash -- 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 diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c index 907662a..3fab676 100644 --- a/drivers/mmc/core/sd.c +++ b/drivers/mmc/core/sd.c @@ -305,6 +305,9 @@ static int mmc_read_switch(struct mmc_card *card) goto out; } + if (status[13] & 0x02) + card->sw_caps.hs_max_dtr = 50000000; + if (card->scr.sda_spec3) { card->sw_caps.sd3_bus_mode = status[13]; @@ -347,9 +350,6 @@ static int mmc_read_switch(struct mmc_card *card) } card->sw_caps.sd3_curr_limit = status[7]; - } else { - if (status[13] & 0x02) - card->sw_caps.hs_max_dtr = 50000000; } out: