From patchwork Thu Mar 10 00:54:09 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrei Warkentin X-Patchwork-Id: 622921 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p2A0Af4F003053 for ; Thu, 10 Mar 2011 00:10:48 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753252Ab1CJAKr (ORCPT ); Wed, 9 Mar 2011 19:10:47 -0500 Received: from exprod5og113.obsmtp.com ([64.18.0.26]:60764 "EHLO exprod5og113.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751237Ab1CJAKq (ORCPT ); Wed, 9 Mar 2011 19:10:46 -0500 Received: from source ([192.54.82.14]) (using TLSv1) by exprod5ob113.postini.com ([64.18.4.12]) with SMTP ID DSNKTXgXBRbLot/chrjBWM+UMsL2+78KSG/N@postini.com; Wed, 09 Mar 2011 16:10:46 PST Received: from DE01MGRG01.AM.MOT-MOBILITY.COM ([10.176.130.20]) by DE01MGRG01.AM.MOT-MOBILITY.COM (8.14.3/8.14.3) with ESMTP id p2A0B2YB009659 for ; Wed, 9 Mar 2011 19:11:02 -0500 (EST) Received: from mail-yw0-f42.google.com (mail-yw0-f42.google.com [209.85.213.42]) by DE01MGRG01.AM.MOT-MOBILITY.COM (8.14.3/8.14.3) with ESMTP id p2A0AjEa009594 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Wed, 9 Mar 2011 19:11:02 -0500 (EST) Received: by mail-yw0-f42.google.com with SMTP id 1so766091ywh.15 for ; Wed, 09 Mar 2011 16:10:44 -0800 (PST) Received: by 10.236.72.197 with SMTP id t45mr516133yhd.262.1299715844638; Wed, 09 Mar 2011 16:10:44 -0800 (PST) Received: from localhost.localdomain (dyngate-ca119-13.motorola.com [144.189.96.13]) by mx.google.com with ESMTPS id 23sm1670066yhl.23.2011.03.09.16.10.43 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 09 Mar 2011 16:10:44 -0800 (PST) From: Andrei Warkentin To: linux-mmc@vger.kernel.org Cc: Andrei Warkentin Subject: [RFC 5/5] MMC: Toshiba eMMC - Split 8K-unaligned accesses. Date: Wed, 9 Mar 2011 18:54:09 -0600 Message-Id: <1299718449-15172-6-git-send-email-andreiw@motorola.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1299718449-15172-1-git-send-email-andreiw@motorola.com> References: <1299718449-15172-1-git-send-email-andreiw@motorola.com> X-CFilter-Loop: Reflected 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]); Thu, 10 Mar 2011 00:10:48 +0000 (UTC) diff --git a/drivers/mmc/card/Kconfig b/drivers/mmc/card/Kconfig index 86948f9..1a9e4aa 100644 --- a/drivers/mmc/card/Kconfig +++ b/drivers/mmc/card/Kconfig @@ -14,6 +14,15 @@ config MMC_BLOCK mount the filesystem. Almost everyone wishing MMC support should say Y or M here. +config MMC_BLOCK_QUIRK_TOSHIBA_32NM + tristate "Toshiba MMC 32nm technology flash device quirks" + depends on MMC_BLOCK + default n + help + Say Y if you have a Toshiba 32nm technology flash device, + such as MMC32G or MMC16G eMMCs. This enables a performance + improvement for flash page unaligned writes. + config MMC_BLOCK_BOUNCE bool "Use bounce buffer for simple hosts" depends on MMC_BLOCK diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index a8f18c7..5250748 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c @@ -729,8 +729,28 @@ mmc_blk_set_blksize(struct mmc_blk_data *md, struct mmc_card *card) return 0; } +#ifdef CONFIG_MMC_BLOCK_QUIRK_TOSHIBA_32NM +static void toshiba_32nm_fixup(struct mmc_card *card, int data) +{ + struct mmc_blk_data *md = mmc_get_drvdata(card); + printk(KERN_INFO "Applying Toshiba 32nm workarounds\n"); + + /* Page size 8K, this card doesn't like unaligned writes + across 8K boundary. */ + md->write_align_size = 8192; + + /* Doing the alignment for accesses > 12K seems to + result in decreased perf. */ + md->write_align_limit = 12288; +} +#endif /* CONFIG_MMC_BLOCK_QUIRK_TOSHIBA_32NM */ + static const struct mmc_fixup blk_fixups[] = { +#ifdef CONFIG_MMC_BLOCK_QUIRK_TOSHIBA_32NM + MMC_FIXUP("MMC16G", 0x11, 0x0, toshiba_32nm_fixup, 0), + MMC_FIXUP("MMC32G", 0x11, 0x0100, toshiba_32nm_fixup, 0), +#endif /* CONFIG_MMC_BLOCK_QUIRK_TOSHIBA_32NM */ END_FIXUP };