diff mbox

[resend] sdhci: work around broken dma boundary behaviour

Message ID 470477.34668.qm@web161814.mail.bf1.yahoo.com (mailing list archive)
State New, archived
Headers show

Commit Message

Mikko Vinni March 14, 2011, 1 p.m. UTC
None
diff mbox

Patch

--- a/drivers/mmc/host/sdhci.h
+++ b/drivers/mmc/host/sdhci.h
@@ -201,6 +201,9 @@ 
 #define SDHCI_MAX_DIV_SPEC_200    256
 #define SDHCI_MAX_DIV_SPEC_300    2046
 
+#define SDHCI_DEFAULT_BOUNDARY_SIZE    (512 * 1024)
+#define SDHCI_DEFAULT_BOUNDARY_ARG    (ilog2(SDHCI_DEFAULT_BOUNDARY_SIZE) - 12)
+
 struct sdhci_ops {
 #ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS
     u32        (*read_l)(struct sdhci_host *host, int reg);

--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -808,7 +808,8 @@  static void sdhci_prepare_data(struct sdhci_host *host, 
struct mmc_data *data)
     sdhci_set_transfer_irqs(host);
 
     /* We do not handle DMA boundaries, so set it to max (512 KiB) */
-    sdhci_writew(host, SDHCI_MAKE_BLKSZ(7, data->blksz), SDHCI_BLOCK_SIZE);
+    sdhci_writew(host, SDHCI_MAKE_BLKSZ(SDHCI_DEFAULT_BOUNDARY_ARG,
+        data->blksz), SDHCI_BLOCK_SIZE);
     sdhci_writew(host, data->blocks, SDHCI_BLOCK_COUNT);
 }