From patchwork Sun Jan 2 00:37:32 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olof Johansson X-Patchwork-Id: 443321 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 p020boPh006135 for ; Sun, 2 Jan 2011 00:37:51 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752954Ab1ABAht (ORCPT ); Sat, 1 Jan 2011 19:37:49 -0500 Received: from mail.lixom.net ([70.86.134.90]:44374 "EHLO mail.lixom.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750973Ab1ABAht (ORCPT ); Sat, 1 Jan 2011 19:37:49 -0500 Received: by mail.lixom.net (Postfix, from userid 1000) id C4B9A566104; Sat, 1 Jan 2011 18:37:48 -0600 (CST) From: Olof Johansson To: Chris Ball Cc: Wolfram Sang , linux-mmc@vger.kernel.org, linux-tegra@vger.kernel.org, Olof Johansson Subject: [PATCH 1/2 v4] sdhci: add quirk for max len ADMA descriptors Date: Sat, 1 Jan 2011 18:37:32 -0600 Message-Id: <1293928653-20001-1-git-send-email-olof@lixom.net> X-Mailer: git-send-email 1.7.3.GIT In-Reply-To: <1293928339-19373-1-git-send-email-olof@lixom.net> References: <1293928339-19373-1-git-send-email-olof@lixom.net> 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.3 (demeter1.kernel.org [140.211.167.41]); Sun, 02 Jan 2011 00:37:51 +0000 (UTC) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index a25db426..c0094c1 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -1928,10 +1928,14 @@ int sdhci_add_host(struct sdhci_host *host) * of bytes. When doing hardware scatter/gather, each entry cannot * be larger than 64 KiB though. */ - if (host->flags & SDHCI_USE_ADMA) - mmc->max_seg_size = 65536; - else + if (host->flags & SDHCI_USE_ADMA) { + if (host->quirks & SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC) + mmc->max_seg_size = 65535; + else + mmc->max_seg_size = 65536; + } else { mmc->max_seg_size = mmc->max_req_size; + } /* * Maximum block size. This varies from controller to controller and diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h index 1fdc673..dfb2106 100644 --- a/include/linux/mmc/sdhci.h +++ b/include/linux/mmc/sdhci.h @@ -83,6 +83,8 @@ struct sdhci_host { #define SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12 (1<<28) /* Controller doesn't have HISPD bit field in HI-SPEED SD card */ #define SDHCI_QUIRK_NO_HISPD_BIT (1<<29) +/* Controller treats ADMA descriptors with length 0000h incorrectly */ +#define SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC (1<<30) int irq; /* Device IRQ */ void __iomem *ioaddr; /* Mapped address */