From patchwork Wed May 4 02:24:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaehoon Chung X-Patchwork-Id: 9009041 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 623A1BF29F for ; Wed, 4 May 2016 02:24:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 92D702011B for ; Wed, 4 May 2016 02:24:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2FCA720272 for ; Wed, 4 May 2016 02:24:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934201AbcEDCYV (ORCPT ); Tue, 3 May 2016 22:24:21 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:36812 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932613AbcEDCYU (ORCPT ); Tue, 3 May 2016 22:24:20 -0400 Received: from epcpsbgr3.samsung.com (u143.gpu120.samsung.co.kr [203.254.230.143]) by mailout3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O6M02Q9SS0HKK40@mailout3.samsung.com> for linux-mmc@vger.kernel.org; Wed, 04 May 2016 11:24:17 +0900 (KST) Received: from epcpsbgm1new.samsung.com ( [172.20.52.113]) by epcpsbgr3.samsung.com (EPCPMTA) with SMTP id 9A.C7.05366.15D59275; Wed, 4 May 2016 11:24:17 +0900 (KST) X-AuditID: cbfee68f-f79d26d0000014f6-e1-57295d515bef Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1new.samsung.com (EPCPMTA) with SMTP id A6.1B.06657.15D59275; Wed, 4 May 2016 11:24:17 +0900 (KST) Received: from localhost.localdomain ([10.113.62.216]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0O6M00547S0HHEA0@mmp1.samsung.com>; Wed, 04 May 2016 11:24:17 +0900 (KST) From: Jaehoon Chung To: linux-mmc@vger.kernel.org Cc: ulf.hansson@linaro.org, shawn.lin@rock-chips.com, Jaehoon Chung Subject: [PATCH] mmc: dw_mmc: fix the wrong max_blk_size Date: Wed, 04 May 2016 11:24:14 +0900 Message-id: <1462328654-5165-1-git-send-email-jh80.chung@samsung.com> X-Mailer: git-send-email 1.9.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrHLMWRmVeSWpSXmKPExsWyRsSkUDcwVjPcYOFLRYsbv9pYLY7872e0 uPNkPavF8bXhDiwed67tYfP4O2s/i0ffllWMHp83yQWwRHHZpKTmZJalFunbJXBlnF9lUnCC u6J30U2mBsZNnF2MnBwSAiYSVzduYYSwxSQu3FvP1sXIxSEksIJRYsbUd2wwRUe/LWeBSCxl lGie/JoJwvnBKPHvThcLSBWbgI7E9m/HmUBsEQFZiZ9/LoB1MwvESSw6+pMdxBYWsJC4s+g/ mM0ioCoxbfJcZhCbV8BV4vfpGawQ2+QkTh6bzAqyQELgMZvE/X9ToBoEJL5NPgS0jAMoISux 6QAzRL2kxMEVN1gmMAouYGRYxSiaWpBcUJyUXmSsV5yYW1yal66XnJ+7iREYjKf/PevfwXj3 gPUhRgEORiUe3gmemuFCrIllxZW5hxhNgTZMZJYSTc4HhnxeSbyhsZmRhamJqbGRuaWZkjjv QqmfwUIC6YklqdmpqQWpRfFFpTmpxYcYmTg4pRoYU9cXNp/oya4UETXojSiW0Hiszux1pUvu q2Q7J5vWFfeM3wfsczROtIu3OrG5Z978OOPw5eVC02b/XcWppG8z56lT2L4vzeYzGd+xPt3i NkHPIENCcqPvHe+8ygvd/6+8eu+qF3LkiOrM0hJ/8yMbvtxVjAiYVtqnEpwzzXpp1zvbjdvd TU8psRRnJBpqMRcVJwIACTm4c0ECAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrNLMWRmVeSWpSXmKPExsVy+t9jAd3AWM1wgxXrZS1u/GpjtTjyv5/R 4s6T9awWx9eGO7B43Lm2h83j76z9LB59W1YxenzeJBfAEtXAaJORmpiSWqSQmpecn5KZl26r 5B0c7xxvamZgqGtoaWGupJCXmJtqq+TiE6DrlpkDtFJJoSwxpxQoFJBYXKykb4dpQmiIm64F TGOErm9IEFyPkQEaSFjDmHF+lUnBCe6K3kU3mRoYN3F2MXJySAiYSBz9tpwFwhaTuHBvPVsX IxeHkMBSRonmya+ZIJwfjBL/7nSBVbEJ6Ehs/3acCcQWEZCV+PnnAhuIzSwQJ7Ho6E92EFtY wELizqL/YDaLgKrEtMlzmUFsXgFXid+nZ7BCbJOTOHlsMusERu4FjAyrGCVSC5ILipPScw3z Usv1ihNzi0vz0vWS83M3MYID/pnUDsaDu9wPMQpwMCrx8L7w1gwXYk0sK67MPcQowcGsJMKb FgwU4k1JrKxKLcqPLyrNSS0+xGgKdMBEZinR5HxgNOaVxBsam5gZWRqZG1oYGZsrifM+/r8u TEggPbEkNTs1tSC1CKaPiYNTqoGxo+WC8M9Uv+tKSh2eLtEnZ0tV3GY70cSnov9bc+c/HobA m+JZ8SUTRBwtra2P7o4smrFN20PFI2fjiVR1jSSneJEL1rxJUULv7zAe9n+28c+TZcedNzwt zbsQ9cpOKVGj9yGrhlXEY6m/iZLf3I8XR8wxa7ESrCmbrHb4wbqvG6QjND7YvVJiKc5INNRi LipOBACsTyKCjgIAAA== 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.9 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 According to DesignWare TRM, BLKSIZ is 16bits. Then it's correct that max_blk_size should be 0xFFFF, not 0x10000. Signed-off-by: Jaehoon Chung Reviewed-by: Shawn Lin --- drivers/mmc/host/dw_mmc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 9dd1bd3..829a6ee 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -2595,13 +2595,13 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id) /* Useful defaults if platform data is unset. */ if (host->use_dma == TRANS_MODE_IDMAC) { mmc->max_segs = host->ring_size; - mmc->max_blk_size = 65536; + mmc->max_blk_size = 65535; mmc->max_seg_size = 0x1000; mmc->max_req_size = mmc->max_seg_size * host->ring_size; mmc->max_blk_count = mmc->max_req_size / 512; } else if (host->use_dma == TRANS_MODE_EDMAC) { mmc->max_segs = 64; - mmc->max_blk_size = 65536; + mmc->max_blk_size = 65535; mmc->max_blk_count = 65535; mmc->max_req_size = mmc->max_blk_size * mmc->max_blk_count; @@ -2609,7 +2609,7 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id) } else { /* TRANS_MODE_PIO */ mmc->max_segs = 64; - mmc->max_blk_size = 65536; /* BLKSIZ is 16 bits */ + mmc->max_blk_size = 65535; /* BLKSIZ is 16 bits */ mmc->max_blk_count = 512; mmc->max_req_size = mmc->max_blk_size * mmc->max_blk_count;