+ mmc-avoid-sdhci-dma-boundaries.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     mmc: avoid sdhci DMA boundaries

has been added to the -mm tree.  Its filename is

     mmc-avoid-sdhci-dma-boundaries.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: mmc: avoid sdhci DMA boundaries
From: Pierre Ossman <drzeus@xxxxxxxxx>


The sdhci controllers will issue an interrupt when a configurable number of
bytes have been transfered using DMA.  The purpose is to handle multiple,
scattered memory pages.

Unfortunately, it requires that all transfers are completely aligned to memory
pages, which we cannot guarantee.  So we just disable the function.

Signed-off-by: Pierre Ossman <drzeus@xxxxxxxxx>
Cc: Russell King <rmk@xxxxxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 drivers/mmc/sdhci.c |   13 +++++++++----
 drivers/mmc/sdhci.h |    1 +
 2 files changed, 10 insertions(+), 4 deletions(-)

diff -puN drivers/mmc/sdhci.c~mmc-avoid-sdhci-dma-boundaries drivers/mmc/sdhci.c
--- 25/drivers/mmc/sdhci.c~mmc-avoid-sdhci-dma-boundaries	Tue Jun 27 14:28:39 2006
+++ 25-akpm/drivers/mmc/sdhci.c	Tue Jun 27 14:28:39 2006
@@ -326,6 +326,9 @@ static void sdhci_prepare_data(struct sd
 	DBG("tsac %d ms nsac %d clk\n",
 		data->timeout_ns / 1000000, data->timeout_clks);
 
+	/* Sanity checks */
+	BUG_ON((1 << data->blksz_bits) * data->blocks > 524288);
+
 	/* timeout in us */
 	target_timeout = data->timeout_ns / 1000 +
 		data->timeout_clks / host->clock;
@@ -375,7 +378,9 @@ static void sdhci_prepare_data(struct sd
 		host->remain = host->cur_sg->length;
 	}
 
-	writew(data->blksz, host->ioaddr + SDHCI_BLOCK_SIZE);
+	/* We do not handle DMA boundaries, so set it to max (512 KiB) */
+	writew(SDHCI_MAKE_BLKSZ(7, data->blksz),
+		host->ioaddr + SDHCI_BLOCK_SIZE);
 	writew(data->blocks, host->ioaddr + SDHCI_BLOCK_COUNT);
 }
 
@@ -1188,10 +1193,10 @@ static int __devinit sdhci_probe_slot(st
 	mmc->max_phys_segs = 16;
 
 	/*
-	 * Maximum number of sectors in one transfer. Limited by sector
-	 * count register.
+	 * Maximum number of sectors in one transfer. Limited by DMA boundary
+	 * size (512KiB), which means (512 KiB/512=) 1024 entries.
 	 */
-	mmc->max_sectors = 0x3FFF;
+	mmc->max_sectors = 1024;
 
 	/*
 	 * Maximum segment size. Could be one segment with the maximum number
diff -puN drivers/mmc/sdhci.h~mmc-avoid-sdhci-dma-boundaries drivers/mmc/sdhci.h
--- 25/drivers/mmc/sdhci.h~mmc-avoid-sdhci-dma-boundaries	Tue Jun 27 14:28:39 2006
+++ 25-akpm/drivers/mmc/sdhci.h	Tue Jun 27 14:28:39 2006
@@ -23,6 +23,7 @@
 #define SDHCI_DMA_ADDRESS	0x00
 
 #define SDHCI_BLOCK_SIZE	0x04
+#define  SDHCI_MAKE_BLKSZ(dma, blksz) (((dma & 0x7) << 12) | (blksz & 0xFFF))
 
 #define SDHCI_BLOCK_COUNT	0x06
 
_

Patches currently in -mm which might be from drzeus@xxxxxxxxx are

mmc-check-sdhci-base-clock.patch
mmc-print-device-id.patch
mmc-support-for-multiple-voltages.patch
mmc-fix-timeout-loops-in-sdhci.patch
mmc-fix-sdhci-reset-timeout.patch
mmc-proper-timeout-handling.patch
mmc-correct-register-order.patch
mmc-fix-interrupt-handling.patch
mmc-fix-sdhci-pio-routines.patch
mmc-avoid-sdhci-dma-boundaries.patch
mmc-test-for-invalid-block-size.patch
mmc-check-only-relevant-inhibit-bits.patch
mmc-check-controller-version.patch
mmc-reset-sdhci-controller-early.patch
mmc-more-dma-capabilities-tests.patch
mmc-support-controller-specific-quirks.patch
mmc-version-bump-sdhci.patch
mmc-add-sdhci-controller-ids.patch
mmc-quirk-for-broken-reset.patch
mmc-force-dma-on-some-controllers.patch
mmc-remove-duplicate-error-message.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux