Commit f1128252 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] Altix update: add MINIMAL_ATE_FLAG

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
parent 7e18f50e
...@@ -138,6 +138,8 @@ sn_pci_alloc_consistent(struct pci_dev *hwdev, size_t size, dma_addr_t *dma_hand ...@@ -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)))) if (!(cpuaddr = (void *)__get_free_pages(GFP_ATOMIC, get_order(size))))
return NULL; return NULL;
memset(cpuaddr, 0x0, size);
/* physical addr. of the memory we just got */ /* physical addr. of the memory we just got */
phys_addr = __pa(cpuaddr); phys_addr = __pa(cpuaddr);
...@@ -154,7 +156,8 @@ sn_pci_alloc_consistent(struct pci_dev *hwdev, size_t size, dma_addr_t *dma_hand ...@@ -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, *dma_handle = pcibr_dmatrans_addr(vhdl, NULL, phys_addr, size,
PCIIO_DMA_CMD | PCIIO_DMA_A64); PCIIO_DMA_CMD | PCIIO_DMA_A64);
else { 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) { if (dma_map) {
*dma_handle = (dma_addr_t) *dma_handle = (dma_addr_t)
pcibr_dmamap_addr(dma_map, phys_addr, size); 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) ...@@ -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. * let's use the PMU instead.
*/ */
dma_map = NULL; 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) { if (!dma_map) {
printk(KERN_ERR "pci_map_single: Unable to allocate anymore " printk(KERN_ERR "pci_map_single: Unable to allocate anymore "
......
...@@ -286,6 +286,12 @@ extern void * pcibr_bridge_ptr_get(vertex_hdl_t, int); ...@@ -286,6 +286,12 @@ extern void * pcibr_bridge_ptr_get(vertex_hdl_t, int);
typedef int pcibr_device_flags_t; 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. * Set bits in the Bridge Device(x) register for this device.
* "flags" are defined above. NOTE: this includes turning * "flags" are defined above. NOTE: this includes turning
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment