From patchwork Tue Mar 1 22:09:04 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrei Warkentin X-Patchwork-Id: 601231 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 p21LxHBD020998 for ; Tue, 1 Mar 2011 21:59:27 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756011Ab1CAV7V (ORCPT ); Tue, 1 Mar 2011 16:59:21 -0500 Received: from exprod5og103.obsmtp.com ([64.18.0.145]:43167 "EHLO exprod5og103.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755828Ab1CAV7V (ORCPT ); Tue, 1 Mar 2011 16:59:21 -0500 Received: from source ([192.54.82.14]) (using TLSv1) by exprod5ob103.postini.com ([64.18.4.12]) with SMTP ID DSNKTW1sOEGyHNP5mrzm2y4EmkXwOOi12Alk@postini.com; Tue, 01 Mar 2011 13:59:20 PST Received: from DE01MGRG01.AM.MOT-MOBILITY.COM ([10.22.94.168]) by DE01MGRG01.AM.MOT-MOBILITY.COM (8.14.3/8.14.3) with ESMTP id p21LOv9t021456 for ; Tue, 1 Mar 2011 16:24:57 -0500 (EST) Received: from mail-gx0-f170.google.com (mail-gx0-f170.google.com [209.85.161.170]) by DE01MGRG01.AM.MOT-MOBILITY.COM (8.14.3/8.14.3) with ESMTP id p21LOJbv021260 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Tue, 1 Mar 2011 16:24:56 -0500 (EST) Received: by mail-gx0-f170.google.com with SMTP id 1so769968gxk.15 for ; Tue, 01 Mar 2011 13:24:41 -0800 (PST) Received: by 10.150.74.7 with SMTP id w7mr4297469yba.420.1299014681384; Tue, 01 Mar 2011 13:24:41 -0800 (PST) Received: from localhost.localdomain (dyngate-ca119-13.motorola.com [144.189.96.13]) by mx.google.com with ESMTPS id d3sm3315356ybi.17.2011.03.01.13.24.35 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 01 Mar 2011 13:24:40 -0800 (PST) From: Andrei Warkentin To: linux-mmc@vger.kernel.org Cc: Andrei Warkentin Subject: [RFC 3/3] MMC: Toshiba eMMC - Split 8K-unaligned accesses. Date: Tue, 1 Mar 2011 16:09:04 -0600 Message-Id: <1299017344-25361-4-git-send-email-andreiw@motorola.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1299017344-25361-1-git-send-email-andreiw@motorola.com> References: <1299017344-25361-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]); Tue, 01 Mar 2011 21:59:27 +0000 (UTC) diff --git a/drivers/mmc/card/Kconfig b/drivers/mmc/card/Kconfig index 063fa16..6d9f391 100644 --- a/drivers/mmc/card/Kconfig +++ b/drivers/mmc/card/Kconfig @@ -21,6 +21,13 @@ config MMC_BLOCK_QUIRKS help Say Y here to enable various workarounds for known cards. +config MMC_BLOCK_QUIRK_TOSHIBA_MMC32G + tristate "Toshiba MMC32G quirks" + depends on MMC_BLOCK_QUIRKS + default n + help + Say Y if you have a Toshiba MMC32G eMMC card. + config MMC_BLOCK_BOUNCE bool "Use bounce buffer for simple hosts" depends on MMC_BLOCK diff --git a/drivers/mmc/card/block-quirks.c b/drivers/mmc/card/block-quirks.c index ceae70c..8aea551 100644 --- a/drivers/mmc/card/block-quirks.c +++ b/drivers/mmc/card/block-quirks.c @@ -109,3 +109,33 @@ int mmc_blk_quirk_register(struct mmc_blk_quirk *quirk, bool is_mmc) rb_insert_color(&quirk->rb_node, &quirk_tree[!is_mmc]); return 0; } + +#ifdef CONFIG_MMC_BLOCK_QUIRK_TOSHIBA_MMC32G +static int toshiba_mmc32g(struct mmc_blk_data *md, struct mmc_card *card) +{ + printk(KERN_INFO "Applying Toshiba MMC32G workarounds\n"); + + /* Page size 8K, this card doesn't like unaligned writes + across 8K boundary. */ + md->write_align_size = 8192; + return 0; +} + +static struct mmc_blk_quirk toshiba_mmc32g_q = { + .name = "MMC32G", + .manfid = 0x11, + .oemid = 0x0100, + + /* Any date, any revision, */ + .rev_start = 0, + .rev_end = (u64) -1, + .probe = toshiba_mmc32g +}; + +int __init mmc_toshiba_quirks(void) +{ + return mmc_blk_quirk_register(&toshiba_mmc32g_q, true); +} + +device_initcall(mmc_toshiba_quirks); +#endif /* CONFIG_MMC_BLOCK_QUIRK_TOSHIBA_MMC32G */