Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 158049
b: refs/heads/master
c: 30945fd
h: refs/heads/master
i:
  158047: 5291ca3
v: v3
  • Loading branch information
FUJITA Tomonori committed Jul 28, 2009
1 parent b00615c commit d37d7e0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 27 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b9394647ac88faad9db0f9e92eac4db434faded6
refs/heads/master: 30945fdf6a08f52370dab3bc162e96c4b4e36082
27 changes: 1 addition & 26 deletions trunk/arch/powerpc/kernel/dma-swiotlb.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,29 +35,12 @@ phys_addr_t swiotlb_bus_to_phys(struct device *hwdev, dma_addr_t baddr)
return baddr - get_dma_direct_offset(hwdev);
}

/*
* Determine if an address needs bounce buffering via swiotlb.
* Going forward I expect the swiotlb code to generalize on using
* a dma_ops->addr_needs_map, and this function will move from here to the
* generic swiotlb code.
*/
int
swiotlb_arch_address_needs_mapping(struct device *hwdev, dma_addr_t addr,
size_t size)
{
struct dma_mapping_ops *dma_ops = get_dma_ops(hwdev);

BUG_ON(!dma_ops);
return dma_ops->addr_needs_map(hwdev, addr, size);
}

/*
* Determine if an address is reachable by a pci device, or if we must bounce.
*/
static int
swiotlb_pci_addr_needs_map(struct device *hwdev, dma_addr_t addr, size_t size)
{
u64 mask = dma_get_mask(hwdev);
dma_addr_t max;
struct pci_controller *hose;
struct pci_dev *pdev = to_pci_dev(hwdev);
Expand All @@ -69,16 +52,9 @@ swiotlb_pci_addr_needs_map(struct device *hwdev, dma_addr_t addr, size_t size)
if ((addr + size > max) | (addr < hose->dma_window_base_cur))
return 1;

return !is_buffer_dma_capable(mask, addr, size);
}

static int
swiotlb_addr_needs_map(struct device *hwdev, dma_addr_t addr, size_t size)
{
return !is_buffer_dma_capable(dma_get_mask(hwdev), addr, size);
return 0;
}


/*
* At the moment, all platforms that use this code only require
* swiotlb to be used if we're operating on HIGHMEM. Since
Expand All @@ -94,7 +70,6 @@ struct dma_mapping_ops swiotlb_dma_ops = {
.dma_supported = swiotlb_dma_supported,
.map_page = swiotlb_map_page,
.unmap_page = swiotlb_unmap_page,
.addr_needs_map = swiotlb_addr_needs_map,
.sync_single_range_for_cpu = swiotlb_sync_single_range_for_cpu,
.sync_single_range_for_device = swiotlb_sync_single_range_for_device,
.sync_sg_for_cpu = swiotlb_sync_sg_for_cpu,
Expand Down

0 comments on commit d37d7e0

Please sign in to comment.