Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dma-mapping: arm: use generic pci_set_dma_mask and pci_set_consistent_dma_mask

This converts arm to the generic pci_set_dma_mask and
pci_set_consistent_dma_mask (removes HAVE_ARCH_PCI_SET_DMA_MASK for
dmabounce).

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Looked-over-by: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: Greg KH <greg@kroah.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

FUJITA Tomonori and committed by
Linus Torvalds
6fee48cd 6e6c70e6

+8 -59
-27
arch/arm/common/it8152.c
··· 272 272 ((dma_addr + size - PHYS_OFFSET) >= SZ_64M); 273 273 } 274 274 275 - /* 276 - * We override these so we properly do dmabounce otherwise drivers 277 - * are able to set the dma_mask to 0xffffffff and we can no longer 278 - * trap bounces. :( 279 - * 280 - * We just return true on everyhing except for < 64MB in which case 281 - * we will fail miseralby and die since we can't handle that case. 282 - */ 283 - int pci_set_dma_mask(struct pci_dev *dev, u64 mask) 284 - { 285 - dev_dbg(&dev->dev, "%s: %llx\n", __func__, mask); 286 - if (mask >= PHYS_OFFSET + SZ_64M - 1) 287 - return 0; 288 - 289 - return -EIO; 290 - } 291 - 292 - int 293 - pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask) 294 - { 295 - dev_dbg(&dev->dev, "%s: %llx\n", __func__, mask); 296 - if (mask >= PHYS_OFFSET + SZ_64M - 1) 297 - return 0; 298 - 299 - return -EIO; 300 - } 301 - 302 275 int __init it8152_pci_setup(int nr, struct pci_sys_data *sys) 303 276 { 304 277 it8152_io.start = IT8152_IO_BASE + 0x12000;
+8
arch/arm/include/asm/dma-mapping.h
··· 128 128 129 129 static inline int dma_set_mask(struct device *dev, u64 dma_mask) 130 130 { 131 + #ifdef CONFIG_DMABOUNCE 132 + if (dev->archdata.dmabounce) { 133 + if (dma_mask >= ISA_DMA_THRESHOLD) 134 + return 0; 135 + else 136 + return -EIO; 137 + } 138 + #endif 131 139 if (!dev->dma_mask || !dma_supported(dev, dma_mask)) 132 140 return -EIO; 133 141
-26
arch/arm/mach-ixp4xx/common-pci.c
··· 502 502 return pci_scan_bus(sys->busnr, &ixp4xx_ops, sys); 503 503 } 504 504 505 - /* 506 - * We override these so we properly do dmabounce otherwise drivers 507 - * are able to set the dma_mask to 0xffffffff and we can no longer 508 - * trap bounces. :( 509 - * 510 - * We just return true on everyhing except for < 64MB in which case 511 - * we will fail miseralby and die since we can't handle that case. 512 - */ 513 - int 514 - pci_set_dma_mask(struct pci_dev *dev, u64 mask) 515 - { 516 - if (mask >= SZ_64M - 1 ) 517 - return 0; 518 - 519 - return -EIO; 520 - } 521 - 522 - int 523 - pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask) 524 - { 525 - if (mask >= SZ_64M - 1 ) 526 - return 0; 527 - 528 - return -EIO; 529 - } 530 - 531 505 EXPORT_SYMBOL(ixp4xx_pci_read); 532 506 EXPORT_SYMBOL(ixp4xx_pci_write); 533 507
-5
arch/arm/mach-ixp4xx/include/mach/hardware.h
··· 26 26 #define PCIBIOS_MAX_MEM 0x4BFFFFFF 27 27 #endif 28 28 29 - /* 30 - * We override the standard dma-mask routines for bouncing. 31 - */ 32 - #define HAVE_ARCH_PCI_SET_DMA_MASK 33 - 34 29 #define pcibios_assign_all_busses() 1 35 30 36 31 /* Register locations and bits */
-1
arch/arm/mach-pxa/include/mach/hardware.h
··· 314 314 #define PCIBIOS_MIN_IO 0 315 315 #define PCIBIOS_MIN_MEM 0 316 316 #define pcibios_assign_all_busses() 1 317 - #define HAVE_ARCH_PCI_SET_DMA_MASK 1 318 317 #endif 319 318 320 319