android_kernel_xiaomi_sm8350/include
Roland Dreier 1d4454e7ce [POWERPC] Define pci_unmap_addr() et al. when CONFIG_NOT_COHERENT_CACHE=y
The current PowerPC code makes pci_unmap_addr(), pci_unmap_addr_set(),
and friends trivial for all 32-bit kernels.  This is reasonable, since
for those kernels it is true that pci_unmap_single() does not need the
DMA address from the original DMA mapping -- in fact, it is a NOP.

However, I recently tried the tg3 driver on a PowerPC 440SPe machine,
which runs a 32-bit kernel and has non-cache-coherent PCI DMA.  I
found that the tg3 driver crashed in pci_dma_sync_single_for_cpu(),
since for non-coherent systems, that function must invalidate the
cache for the DMA address range requested, and therefore it does use
the address passed in.  tg3 uses a DMA address it stashes away with
pci_unmap_addr_set() and retrieves with pci_unmap_addr().  Of course,
since pci_unmap_addr() is defined to (0) right now, this doesn't work.

It seems to me that the tg3 driver is using pci_unmap_addr() in a
legitimate way -- I wouldn't want to have to teach all drivers that
they should use pci_unmap_addr() if they only need the address for
unmapping functions, but if they want the pci_dma_sync functions, then
they have to store the DMA address without the helper macros.
The right fix therefore seems to be in the definition of the macros in
<asm/pci.h> -- we should use the trivial versions only for 32-bit
kernels for coherent systems, and the real versions for both 64-bit
kernels and non-coherent systems.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-12-08 17:10:18 +11:00
..
acpi [PATCH] slab: remove kmem_cache_t 2006-12-07 08:39:25 -08:00
asm-alpha [PATCH] Pass struct dev pointer to dma_cache_sync() 2006-12-07 08:39:41 -08:00
asm-arm Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm 2006-12-07 15:40:39 -08:00
asm-arm26 [PATCH] cleanup asm/setup.h userspace visibility 2006-12-07 08:39:46 -08:00
asm-avr32 Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm 2006-12-07 15:40:39 -08:00
asm-cris [PATCH] include/asm-cris/: "extern inline" -> "static inline" 2006-12-07 08:39:45 -08:00
asm-frv [PATCH] cleanup asm/setup.h userspace visibility 2006-12-07 08:39:46 -08:00
asm-generic Merge branch 'for-linus' of git://one.firstfloor.org/home/andi/git/linux-2.6 2006-12-07 08:59:11 -08:00
asm-h8300 [PATCH] include/asm-h8300/: "extern inline" -> "static inline" 2006-12-07 08:39:45 -08:00
asm-i386 Merge branch 'for-linus' of git://one.firstfloor.org/home/andi/git/linux-2.6 2006-12-07 08:59:11 -08:00
asm-ia64 Merge branch 'release' of master.kernel.org:/pub/scm/linux/kernel/git/aegl/linux-2.6 2006-12-07 15:39:22 -08:00
asm-m32r [PATCH] cleanup asm/setup.h userspace visibility 2006-12-07 08:39:46 -08:00
asm-m68k [PATCH] cleanup asm/setup.h userspace visibility 2006-12-07 08:39:46 -08:00
asm-m68knommu [PATCH] cleanup asm/setup.h userspace visibility 2006-12-07 08:39:46 -08:00
asm-mips [PATCH] cleanup asm/setup.h userspace visibility 2006-12-07 08:39:46 -08:00
asm-parisc [PATCH] Pass struct dev pointer to dma_cache_sync() 2006-12-07 08:39:41 -08:00
asm-powerpc [POWERPC] Define pci_unmap_addr() et al. when CONFIG_NOT_COHERENT_CACHE=y 2006-12-08 17:10:18 +11:00
asm-ppc [POWERPC] Define pci_unmap_addr() et al. when CONFIG_NOT_COHERENT_CACHE=y 2006-12-08 17:10:18 +11:00
asm-s390 [PATCH] cleanup asm/setup.h userspace visibility 2006-12-07 08:39:46 -08:00
asm-sh [PATCH] cleanup asm/setup.h userspace visibility 2006-12-07 08:39:46 -08:00
asm-sh64 [PATCH] cleanup asm/setup.h userspace visibility 2006-12-07 08:39:46 -08:00
asm-sparc [PATCH] remove kernel syscalls 2006-12-07 08:39:37 -08:00
asm-sparc64 [PATCH] Pass struct dev pointer to dma_cache_sync() 2006-12-07 08:39:41 -08:00
asm-um [PATCH] Pass struct dev pointer to dma_cache_sync() 2006-12-07 08:39:41 -08:00
asm-v850 [PATCH] remove kernel syscalls 2006-12-07 08:39:37 -08:00
asm-x86_64 Merge branch 'for-linus' of git://one.firstfloor.org/home/andi/git/linux-2.6 2006-12-07 08:59:11 -08:00
asm-xtensa [PATCH] Pass struct dev pointer to dma_cache_sync() 2006-12-07 08:39:41 -08:00
crypto [CRYPTO] lib: table driven multiplications in GF(2^128) 2006-12-06 18:38:55 -08:00
keys
linux Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm 2006-12-07 15:40:39 -08:00
math-emu
media
mtd
net Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2006-12-07 09:05:15 -08:00
pcmcia [PATCH] pcmcia: multifunction card handling fixes 2006-12-04 20:09:15 -05:00
rdma IB/cm: Fix automatic path migration support 2006-11-29 15:33:10 -08:00
rxrpc
scsi [PATCH] slab: remove kmem_cache_t 2006-12-07 08:39:25 -08:00
sound Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 2006-12-05 17:01:28 +00:00
video
Kbuild