]> git.hungrycats.org Git - linux/commitdiff
[PATCH] Altix update: add MINIMAL_ATE_FLAG
authorAndrew Morton <akpm@osdl.org>
Wed, 4 Feb 2004 02:52:55 +0000 (18:52 -0800)
committerLinus Torvalds <torvalds@home.osdl.org>
Wed, 4 Feb 2004 02:52:55 +0000 (18:52 -0800)
From: Pat Gefre <pfg@sgi.com>

arch/ia64/sn/io/machvec/pci_dma.c
    Add MINIMAL_ATE_FLAGS() macro usage

include/asm-ia64/sn/pci/pcibr.h
    Add MINIMAL_ATE_FLAG() macro

arch/ia64/sn/io/machvec/pci_dma.c
include/asm-ia64/sn/pci/pcibr.h

index bb530cf55a4296b23870f2c56cb47fae3bbfaa7c..de4f5c6b42b646b3a15d4f4bf5e9962ae5a26405 100644 (file)
@@ -138,6 +138,8 @@ sn_pci_alloc_consistent(struct pci_dev *hwdev, size_t size, dma_addr_t *dma_hand
        if (!(cpuaddr = (void *)__get_free_pages(GFP_ATOMIC, get_order(size))))
                return NULL;
 
+       memset(cpuaddr, 0x0, size);
+
        /* physical addr. of the memory we just got */
        phys_addr = __pa(cpuaddr);
 
@@ -154,7 +156,8 @@ sn_pci_alloc_consistent(struct pci_dev *hwdev, size_t size, dma_addr_t *dma_hand
                *dma_handle = pcibr_dmatrans_addr(vhdl, NULL, phys_addr, size,
                                          PCIIO_DMA_CMD | PCIIO_DMA_A64);
        else {
-               dma_map = pcibr_dmamap_alloc(vhdl, NULL, size, PCIIO_DMA_CMD);
+               dma_map = pcibr_dmamap_alloc(vhdl, NULL, size, PCIIO_DMA_CMD | 
+                                            MINIMAL_ATE_FLAG(phys_addr, size));
                if (dma_map) {
                        *dma_handle = (dma_addr_t)
                                pcibr_dmamap_addr(dma_map, phys_addr, size);
@@ -391,7 +394,8 @@ sn_pci_map_single(struct pci_dev *hwdev, void *ptr, size_t size, int direction)
         * let's use the PMU instead.
         */
        dma_map = NULL;
-       dma_map = pcibr_dmamap_alloc(vhdl, NULL, size, PCIIO_DMA_DATA);
+       dma_map = pcibr_dmamap_alloc(vhdl, NULL, size, PCIIO_DMA_DATA | 
+                                    MINIMAL_ATE_FLAG(phys_addr, size));
 
        if (!dma_map) {
                printk(KERN_ERR "pci_map_single: Unable to allocate anymore "
index 70910c97d88043c1673ef056c3ec3c85baf568b1..550bf7e3926644e75eb85149759f868e92739fe5 100644 (file)
@@ -286,6 +286,12 @@ extern void *              pcibr_bridge_ptr_get(vertex_hdl_t, int);
 
 typedef int            pcibr_device_flags_t;
 
+#define MINIMAL_ATES_REQUIRED(addr, size) \
+       (IOPG(IOPGOFF(addr) + (size) - 1) == IOPG((size) - 1))
+
+#define MINIMAL_ATE_FLAG(addr, size) \
+       (MINIMAL_ATES_REQUIRED((u_long)addr, size) ? PCIBR_NO_ATE_ROUNDUP : 0)
+
 /*
  * Set bits in the Bridge Device(x) register for this device.
  * "flags" are defined above. NOTE: this includes turning