diff options
author | Chris Metcalf <cmetcalf@tilera.com> | 2013-08-05 13:45:28 -0400 |
---|---|---|
committer | Chris Metcalf <cmetcalf@tilera.com> | 2013-08-06 12:56:04 -0400 |
commit | 02b67e09541b85d8f92e0a68a9deb1c33e6626bb (patch) | |
tree | e74fb25de3a1572e5d648953bfaf59a6999031fb /arch/tile/kernel/pci-dma.c | |
parent | dc7d5cf2cab6d1fbb43c5c0569f43b7e4c822760 (diff) |
tile PCI DMA: fix bug in non-page-aligned accessors
The code incorrectly masked with PAGE_OFFSET instead of
PAGE_SIZE-1. This only matters when trying to do a
non page-aligned DMA; it was noticed during code inspection.
Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
Diffstat (limited to 'arch/tile/kernel/pci-dma.c')
-rw-r--r-- | arch/tile/kernel/pci-dma.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/tile/kernel/pci-dma.c b/arch/tile/kernel/pci-dma.c index 9fef64d70c56..d94f4872e94f 100644 --- a/arch/tile/kernel/pci-dma.c +++ b/arch/tile/kernel/pci-dma.c | |||
@@ -257,7 +257,7 @@ static void tile_dma_unmap_page(struct device *dev, dma_addr_t dma_address, | |||
257 | BUG_ON(!valid_dma_direction(direction)); | 257 | BUG_ON(!valid_dma_direction(direction)); |
258 | 258 | ||
259 | __dma_complete_page(pfn_to_page(PFN_DOWN(dma_address)), | 259 | __dma_complete_page(pfn_to_page(PFN_DOWN(dma_address)), |
260 | dma_address & PAGE_OFFSET, size, direction); | 260 | dma_address & (PAGE_SIZE - 1), size, direction); |
261 | } | 261 | } |
262 | 262 | ||
263 | static void tile_dma_sync_single_for_cpu(struct device *dev, | 263 | static void tile_dma_sync_single_for_cpu(struct device *dev, |
@@ -436,7 +436,7 @@ static void tile_pci_dma_unmap_page(struct device *dev, dma_addr_t dma_address, | |||
436 | dma_address -= get_dma_offset(dev); | 436 | dma_address -= get_dma_offset(dev); |
437 | 437 | ||
438 | __dma_complete_page(pfn_to_page(PFN_DOWN(dma_address)), | 438 | __dma_complete_page(pfn_to_page(PFN_DOWN(dma_address)), |
439 | dma_address & PAGE_OFFSET, size, direction); | 439 | dma_address & (PAGE_SIZE - 1), size, direction); |
440 | } | 440 | } |
441 | 441 | ||
442 | static void tile_pci_dma_sync_single_for_cpu(struct device *dev, | 442 | static void tile_pci_dma_sync_single_for_cpu(struct device *dev, |