From patchwork Thu Jul 18 04:34:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaehoon Chung X-Patchwork-Id: 2829387 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2C508C0AB2 for ; Thu, 18 Jul 2013 04:34:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1D651201E5 for ; Thu, 18 Jul 2013 04:34:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8A070201DA for ; Thu, 18 Jul 2013 04:34:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751273Ab3GREer (ORCPT ); Thu, 18 Jul 2013 00:34:47 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:50214 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750945Ab3GREeq (ORCPT ); Thu, 18 Jul 2013 00:34:46 -0400 Received: from epcpsbgr5.samsung.com (u145.gpu120.samsung.co.kr [203.254.230.145]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MQ40070N7B00PO0@mailout4.samsung.com> for linux-mmc@vger.kernel.org; Thu, 18 Jul 2013 13:34:39 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.114]) by epcpsbgr5.samsung.com (EPCPMTA) with SMTP id F7.17.11618.F5077E15; Thu, 18 Jul 2013 13:34:39 +0900 (KST) X-AuditID: cbfee691-b7fef6d000002d62-0f-51e7705f32a5 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 09.F3.32250.F5077E15; Thu, 18 Jul 2013 13:34:39 +0900 (KST) Received: from [10.252.81.186] by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MQ40002X7DRIV80@mmp1.samsung.com>; Thu, 18 Jul 2013 13:34:39 +0900 (KST) Message-id: <51E77061.2030308@samsung.com> Date: Thu, 18 Jul 2013 13:34:41 +0900 From: Jaehoon Chung User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130623 Thunderbird/17.0.7 MIME-version: 1.0 To: "linux-mmc@vger.kernel.org" Cc: 'Chris Ball' , Kyungmin Park , Ulf Hansson , Philip Rakity , Johan Rudholm , Aaron Lu Subject: [PATCH] mmc: sd: fix the maximum au_size for SD3.0 Content-type: text/plain; charset=ISO-8859-1 Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrHIsWRmVeSWpSXmKPExsWyRsSkSDe+4HmgwdMpxhbNHX8YLba/3shm cWj2eWaLs01v2C2O/O9ntJi/+gmjxfG14Q7sHq2X/rJ57Jx1l93j0JW1jB53ru1h85i88CKz R9+WVYwenzfJBbBHcdmkpOZklqUW6dslcGVsbJ3OXPCGq2LCxY+MDYwHOboYOTkkBEwk/l+Y ygRhi0lcuLeeDcQWEljKKPFykRRMTfPC70A1XEDxRYwS2w49Y4NwXjNK/DlxlhmkildAS+L4 kieMIDaLgKrEww0zWUFsNgEdie3fjoNtEBUIk1jy7TEbRL2gxI/J91i6GDk4RASsJZp/y4LM ZBa4wyjxYMJDsLgwUHzH3yKQcmagMftbp7FB2PISm9e8ZQaplxA4xC5x8f9CFoi9AhLfJh8C 65UQkJXYdIAZ4gFJiYMrbrBMYBSZhWTzLCRjZyEZu4CReRWjaGpBckFxUnqRqV5xYm5xaV66 XnJ+7iZGYFyd/vds4g7G+wesDzEmA62cyCwlmpwPjMu8knhDYzMjC1MTU2Mjc0sz0oSVxHnV W6w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GeG2eKph3pmPU6efmX5Zy7lqRHLXHQZ9l9yazg/zSVGcOF7zVnL rV9cYskM1Dm1QYmlOCPRUIu5qDgRAB56NTYfAwAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 Since SD Physical Layer specification V3.0, AU_SIZE is supported up to 0xf. So If SD-card is supported v3.0, then max_au should be 0xf. Signed-off-by: Jaehoon Chung Signed-off-by: Kyungmin Park --- drivers/mmc/core/sd.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c index 176d125..aa5013f 100644 --- a/drivers/mmc/core/sd.c +++ b/drivers/mmc/core/sd.c @@ -215,7 +215,7 @@ static int mmc_decode_scr(struct mmc_card *card) static int mmc_read_ssr(struct mmc_card *card) { unsigned int au, es, et, eo; - int err, i; + int err, i, max_au; u32 *ssr; if (!(card->csd.cmdclass & CCC_APP_SPEC)) { @@ -239,12 +239,18 @@ static int mmc_read_ssr(struct mmc_card *card) for (i = 0; i < 16; i++) ssr[i] = be32_to_cpu(ssr[i]); + /* The value of maximum au_size is supported 0xF since SD3.0 */ + if (card->scr.sda_spec3) + max_au = 0xf; + else + max_au = 9; + /* * UNSTUFF_BITS only works with four u32s so we have to offset the * bitfield positions accordingly. */ au = UNSTUFF_BITS(ssr, 428 - 384, 4); - if (au > 0 && au <= 9) { + if (au > 0 && au <= max_au) { card->ssr.au = 1 << (au + 4); es = UNSTUFF_BITS(ssr, 408 - 384, 16); et = UNSTUFF_BITS(ssr, 402 - 384, 6);