From patchwork Wed May 9 14:48:20 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saugata Das X-Patchwork-Id: 8502 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 6D8C723E9A for ; Wed, 9 May 2012 14:48:36 +0000 (UTC) Received: from mail-wg0-f48.google.com (mail-wg0-f48.google.com [74.125.82.48]) by fiordland.canonical.com (Postfix) with ESMTP id 66AA4A18A2D for ; Wed, 9 May 2012 14:48:36 +0000 (UTC) Received: by mail-wg0-f48.google.com with SMTP id dq11so295626wgb.17 for ; Wed, 09 May 2012 07:48:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:mime-version:content-type :x-gm-message-state; bh=9op/tHy/Hd7Em/yCEPln0i4dkaVtsR+J2ZOjhfb4as8=; b=KCiA/d4lZ8BL8RKYDyc3KMgHD7bGHxlb3swOxDlRFfYOQs81D5xALgA9DSVkzlOlnC S3cDrLqRLh//UNTqkS1aliPHPWnu/9MNRljCkLYpNR0cMuZ/kha4hke00hVJ260LfXtv 2Pwx5HCChAt0tFRBDoPnX0xIIJPlCNAYmuZUQMYfrW3cQg/jvfBblhL0QD+qfE7KCTra FDylFULGZSbKH2fHtt5aZKeZQL8uuVc4Dm5Xzqhc+Sc/iFZR5pt+V6IeYpayQwsUKNao gcvDymWk2H3UEW8ZoaIKRHs//ZLS6I/7SnhF8+rf2kv54YQhZKWFZVKzmj8nM/Wpo/x0 ZWiw== Received: by 10.50.10.225 with SMTP id l1mr274849igb.1.1336574915791; Wed, 09 May 2012 07:48:35 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.73.147 with SMTP id q19csp21823ibj; Wed, 9 May 2012 07:48:34 -0700 (PDT) Received: by 10.14.53.70 with SMTP id f46mr96391eec.62.1336574914416; Wed, 09 May 2012 07:48:34 -0700 (PDT) Received: from eu1sys200aog117.obsmtp.com (eu1sys200aog117.obsmtp.com. [207.126.144.143]) by mx.google.com with SMTP id q51si837391eef.26.2012.05.09.07.48.32 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 09 May 2012 07:48:34 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.143 is neither permitted nor denied by best guess record for domain of saugata.das@stericsson.com) client-ip=207.126.144.143; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.143 is neither permitted nor denied by best guess record for domain of saugata.das@stericsson.com) smtp.mail=saugata.das@stericsson.com Received: from beta.dmz-eu.st.com ([164.129.1.35]) (using TLSv1) by eu1sys200aob117.postini.com ([207.126.147.11]) with SMTP ID DSNKT6qDv8GrGt/CKX6uVGggoSHMfa8rbBHc@postini.com; Wed, 09 May 2012 14:48:34 UTC Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 568B71C8; Wed, 9 May 2012 14:48:29 +0000 (GMT) Received: from relay1.stm.gmessaging.net (unknown [10.230.100.17]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id E67C02CE4; Wed, 9 May 2012 14:48:28 +0000 (GMT) Received: from exdcvycastm022.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm022", Issuer "exdcvycastm022" (not verified)) by relay1.stm.gmessaging.net (Postfix) with ESMTPS id D84E924C07D; Wed, 9 May 2012 16:48:20 +0200 (CEST) Received: from localhost (10.201.54.119) by exdcvycastm022.EQ1STM.local (10.230.100.30) with Microsoft SMTP Server (TLS) id 8.3.83.0; Wed, 9 May 2012 16:48:27 +0200 From: Saugata Das To: Cc: , Subject: [RFC 1/2] [MMC-4.5] Disable emulation Date: Wed, 9 May 2012 20:18:20 +0530 Message-ID: <1336574901-26579-1-git-send-email-saugata.das@stericsson.com> X-Mailer: git-send-email 1.7.4.3 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQkl2LiIB4+ytt8ASw68BmFaxy0C+urXV0OZHGv0ZYJgGe/mPAcvdkgYNraKkAfAJvQ5zMKL From: Saugata Das This patch adds the support for large sector size of 4KB by disabling emulation. This patch passes eMMC DATA_SECTOR_SIZE as the logical block size during mmc_blk_alloc_req. In order to use this patch for 4KB sector size, ensure that USE_NATIVE_SECTOR is enabled, partition table is 4KB sector size aligned and file system block size is 4KB. Signed-off-by: Saugata Das --- drivers/mmc/card/block.c | 6 +++++- drivers/mmc/core/mmc.c | 2 ++ 2 files changed, 7 insertions(+), 1 deletions(-) diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index a7c75d8..0e54118e 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c @@ -1517,7 +1517,11 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card, snprintf(md->disk->disk_name, sizeof(md->disk->disk_name), "mmcblk%d%s", md->name_idx, subname ? subname : ""); - blk_queue_logical_block_size(md->queue.queue, 512); + if (mmc_card_mmc(card)) + blk_queue_logical_block_size(md->queue.queue, + card->ext_csd.data_sector_size); + else + blk_queue_logical_block_size(md->queue.queue, 512); set_capacity(md->disk, size); if (mmc_host_cmd23(card->host)) { diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index 02914d6..8dcbe995 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c @@ -533,6 +533,8 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd) } else { card->ext_csd.data_tag_unit_size = 0; } + } else { + card->ext_csd.data_sector_size = 512; } out: