Revision 2be23c475af8ae4e25f8bab08d815b17593bd547 authored by Russell King on 08 September 2010, 15:27:56 UTC, committed by Russell King on 08 September 2010, 15:27:56 UTC
Dave Hylands reports:
| We've observed a problem with dma_alloc_writecombine when the system
| is under heavy load (heavy bus traffic).  We've managed to reduce the
| problem to the following snippet, which is run from a kthread in a
| continuous loop:
|
|   void *virtAddr;
|   dma_addr_t physAddr;
|   unsigned int numBytes = 256;
|
|   for (;;) {
|       virtAddr = dma_alloc_writecombine(NULL,
|             numBytes, &physAddr, GFP_KERNEL);
|       if (virtAddr == NULL) {
|          printk(KERN_ERR "Running out of memory\n");
|          break;
|       }
|
|       /* access DMA memory allocated */
|       tmp = virtAddr;
|       *tmp = 0x77;
|
|       /* free DMA memory */
|       dma_free_writecombine(NULL,
|             numBytes, virtAddr, physAddr);
|
|         ...sleep here...
|     }
|
| By itself, the code will run forever with no issues. However, as we
| increase our bus traffic (typically using DMA) then the *tmp = 0x77
| line will eventually cause a page fault. If we add a small delay (a
| few microseconds) before the *tmp = 0x77, then we don't see a page
| fault, even under heavy load.

A dsb() is required after modifying the PTE entries to ensure that they
will always be visible.  Add this dsb().

Reported-by: Dave Hylands <dhylands@gmail.com>
Tested-by: Dave Hylands <dhylands@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
1 parent a387f0f
History
File Mode Size
Kconfig -rw-r--r-- 11.7 KB
Makefile -rw-r--r-- 2.3 KB
amba-pl022.c -rw-r--r-- 56.2 KB
atmel_spi.c -rw-r--r-- 23.4 KB
atmel_spi.h -rw-r--r-- 4.3 KB
au1550_spi.c -rw-r--r-- 26.1 KB
coldfire_qspi.c -rw-r--r-- 16.2 KB
davinci_spi.c -rw-r--r-- 33.2 KB
dw_spi.c -rw-r--r-- 22.7 KB
dw_spi_mmio.c -rw-r--r-- 3.3 KB
dw_spi_pci.c -rw-r--r-- 4.0 KB
ep93xx_spi.c -rw-r--r-- 24.6 KB
mpc512x_psc_spi.c -rw-r--r-- 14.0 KB
mpc52xx_psc_spi.c -rw-r--r-- 13.7 KB
mpc52xx_spi.c -rw-r--r-- 14.7 KB
omap2_mcspi.c -rw-r--r-- 32.5 KB
omap_spi_100k.c -rw-r--r-- 15.6 KB
omap_uwire.c -rw-r--r-- 13.3 KB
orion_spi.c -rw-r--r-- 12.7 KB
pxa2xx_spi.c -rw-r--r-- 45.5 KB
spi.c -rw-r--r-- 30.6 KB
spi_bfin5xx.c -rw-r--r-- 38.2 KB
spi_bitbang.c -rw-r--r-- 13.2 KB
spi_bitbang_txrx.h -rw-r--r-- 3.0 KB
spi_butterfly.c -rw-r--r-- 8.5 KB
spi_gpio.c -rw-r--r-- 12.1 KB
spi_imx.c -rw-r--r-- 16.9 KB
spi_lm70llp.c -rw-r--r-- 9.2 KB
spi_mpc8xxx.c -rw-r--r-- 33.7 KB
spi_nuc900.c -rw-r--r-- 10.2 KB
spi_ppc4xx.c -rw-r--r-- 14.2 KB
spi_s3c24xx.c -rw-r--r-- 16.5 KB
spi_s3c24xx_fiq.S -rw-r--r-- 2.9 KB
spi_s3c24xx_fiq.h -rw-r--r-- 671 bytes
spi_s3c24xx_gpio.c -rw-r--r-- 5.1 KB
spi_s3c64xx.c -rw-r--r-- 30.6 KB
spi_sh_msiof.c -rw-r--r-- 16.2 KB
spi_sh_sci.c -rw-r--r-- 4.9 KB
spi_stmp.c -rw-r--r-- 15.8 KB
spi_txx9.c -rw-r--r-- 12.0 KB
spidev.c -rw-r--r-- 17.1 KB
tle62x0.c -rw-r--r-- 7.4 KB
xilinx_spi.c -rw-r--r-- 13.3 KB
xilinx_spi.h -rw-r--r-- 1.0 KB
xilinx_spi_of.c -rw-r--r-- 3.4 KB
xilinx_spi_pltfm.c -rw-r--r-- 2.5 KB

back to top