From: Ralf Baechle <ralf@linux-mips.org>

Fix the MIPS coherency configuration such that we always keep the mapping
state in <asm/pci.h> when we need to on non-coherent platforms.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 arch/mips/Kconfig                      |   14 +++++++++++---
 arch/mips/configs/atlas_defconfig      |    1 +
 arch/mips/configs/capcella_defconfig   |    1 +
 arch/mips/configs/cobalt_defconfig     |    1 +
 arch/mips/configs/db1000_defconfig     |    1 +
 arch/mips/configs/db1100_defconfig     |    1 +
 arch/mips/configs/ddb5476_defconfig    |    1 +
 arch/mips/configs/ddb5477_defconfig    |    1 +
 arch/mips/configs/decstation_defconfig |    1 +
 arch/mips/configs/e55_defconfig        |    1 +
 arch/mips/configs/ev64120_defconfig    |    1 +
 arch/mips/configs/ev96100_defconfig    |    1 +
 arch/mips/configs/ip22_defconfig       |    1 +
 arch/mips/configs/ip32_defconfig       |    1 +
 arch/mips/configs/it8172_defconfig     |    1 +
 arch/mips/configs/ivr_defconfig        |    1 +
 arch/mips/configs/jaguar-atx_defconfig |    1 +
 arch/mips/configs/jmr3927_defconfig    |    1 +
 arch/mips/configs/lasat200_defconfig   |    1 +
 arch/mips/configs/malta_defconfig      |    1 +
 arch/mips/configs/mpc30x_defconfig     |    1 +
 arch/mips/configs/ocelot_3_defconfig   |    1 +
 arch/mips/configs/ocelot_c_defconfig   |    1 +
 arch/mips/configs/ocelot_defconfig     |    1 +
 arch/mips/configs/ocelot_g_defconfig   |    1 +
 arch/mips/configs/pb1100_defconfig     |    1 +
 arch/mips/configs/rm200_defconfig      |    1 +
 arch/mips/configs/sead_defconfig       |    1 +
 arch/mips/configs/tb0226_defconfig     |    1 +
 arch/mips/configs/tb0229_defconfig     |    1 +
 arch/mips/configs/workpad_defconfig    |    1 +
 arch/mips/defconfig                    |    1 +
 include/asm-mips/pci.h                 |    6 +++---
 33 files changed, 45 insertions(+), 6 deletions(-)

diff -puN arch/mips/configs/atlas_defconfig~mips-fix-coherency-configuration arch/mips/configs/atlas_defconfig
--- devel/arch/mips/configs/atlas_defconfig~mips-fix-coherency-configuration	2005-08-21 23:48:16.000000000 -0700
+++ devel-akpm/arch/mips/configs/atlas_defconfig	2005-08-21 23:48:16.000000000 -0700
@@ -88,6 +88,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
 CONFIG_HAVE_DEC_LOCK=y
 CONFIG_DMA_NONCOHERENT=y
+CONFIG_DMA_NEED_PCI_MAP_STATE=y
 CONFIG_MIPS_BONITO64=y
 CONFIG_MIPS_MSC=y
 # CONFIG_CPU_LITTLE_ENDIAN is not set
diff -puN arch/mips/configs/capcella_defconfig~mips-fix-coherency-configuration arch/mips/configs/capcella_defconfig
--- devel/arch/mips/configs/capcella_defconfig~mips-fix-coherency-configuration	2005-08-21 23:48:16.000000000 -0700
+++ devel-akpm/arch/mips/configs/capcella_defconfig	2005-08-21 23:48:16.000000000 -0700
@@ -97,6 +97,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
 CONFIG_HAVE_DEC_LOCK=y
 CONFIG_DMA_NONCOHERENT=y
+CONFIG_DMA_NEED_PCI_MAP_STATE=y
 CONFIG_CPU_LITTLE_ENDIAN=y
 CONFIG_IRQ_CPU=y
 CONFIG_MIPS_L1_CACHE_SHIFT=5
diff -puN arch/mips/configs/cobalt_defconfig~mips-fix-coherency-configuration arch/mips/configs/cobalt_defconfig
--- devel/arch/mips/configs/cobalt_defconfig~mips-fix-coherency-configuration	2005-08-21 23:48:16.000000000 -0700
+++ devel-akpm/arch/mips/configs/cobalt_defconfig	2005-08-21 23:48:16.000000000 -0700
@@ -82,6 +82,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
 CONFIG_HAVE_DEC_LOCK=y
 CONFIG_DMA_NONCOHERENT=y
+CONFIG_DMA_NEED_PCI_MAP_STATE=y
 CONFIG_I8259=y
 CONFIG_CPU_LITTLE_ENDIAN=y
 CONFIG_IRQ_CPU=y
diff -puN arch/mips/configs/db1000_defconfig~mips-fix-coherency-configuration arch/mips/configs/db1000_defconfig
--- devel/arch/mips/configs/db1000_defconfig~mips-fix-coherency-configuration	2005-08-21 23:48:16.000000000 -0700
+++ devel-akpm/arch/mips/configs/db1000_defconfig	2005-08-21 23:48:16.000000000 -0700
@@ -104,6 +104,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
 CONFIG_HAVE_DEC_LOCK=y
 CONFIG_DMA_NONCOHERENT=y
+CONFIG_DMA_NEED_PCI_MAP_STATE=y
 CONFIG_CPU_LITTLE_ENDIAN=y
 CONFIG_MIPS_L1_CACHE_SHIFT=5
 
diff -puN arch/mips/configs/db1100_defconfig~mips-fix-coherency-configuration arch/mips/configs/db1100_defconfig
--- devel/arch/mips/configs/db1100_defconfig~mips-fix-coherency-configuration	2005-08-21 23:48:16.000000000 -0700
+++ devel-akpm/arch/mips/configs/db1100_defconfig	2005-08-21 23:48:16.000000000 -0700
@@ -104,6 +104,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
 CONFIG_HAVE_DEC_LOCK=y
 CONFIG_DMA_NONCOHERENT=y
+CONFIG_DMA_NEED_PCI_MAP_STATE=y
 CONFIG_CPU_LITTLE_ENDIAN=y
 CONFIG_MIPS_L1_CACHE_SHIFT=5
 
diff -puN arch/mips/configs/ddb5476_defconfig~mips-fix-coherency-configuration arch/mips/configs/ddb5476_defconfig
--- devel/arch/mips/configs/ddb5476_defconfig~mips-fix-coherency-configuration	2005-08-21 23:48:16.000000000 -0700
+++ devel-akpm/arch/mips/configs/ddb5476_defconfig	2005-08-21 23:48:16.000000000 -0700
@@ -82,6 +82,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
 CONFIG_HAVE_DEC_LOCK=y
 CONFIG_DMA_NONCOHERENT=y
+CONFIG_DMA_NEED_PCI_MAP_STATE=y
 CONFIG_I8259=y
 CONFIG_CPU_LITTLE_ENDIAN=y
 CONFIG_IRQ_CPU=y
diff -puN arch/mips/configs/ddb5477_defconfig~mips-fix-coherency-configuration arch/mips/configs/ddb5477_defconfig
--- devel/arch/mips/configs/ddb5477_defconfig~mips-fix-coherency-configuration	2005-08-21 23:48:16.000000000 -0700
+++ devel-akpm/arch/mips/configs/ddb5477_defconfig	2005-08-21 23:48:16.000000000 -0700
@@ -83,6 +83,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
 CONFIG_HAVE_DEC_LOCK=y
 CONFIG_DMA_NONCOHERENT=y
+CONFIG_DMA_NEED_PCI_MAP_STATE=y
 CONFIG_I8259=y
 CONFIG_CPU_LITTLE_ENDIAN=y
 CONFIG_IRQ_CPU=y
diff -puN arch/mips/configs/decstation_defconfig~mips-fix-coherency-configuration arch/mips/configs/decstation_defconfig
--- devel/arch/mips/configs/decstation_defconfig~mips-fix-coherency-configuration	2005-08-21 23:48:16.000000000 -0700
+++ devel-akpm/arch/mips/configs/decstation_defconfig	2005-08-21 23:48:16.000000000 -0700
@@ -88,6 +88,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
 CONFIG_HAVE_DEC_LOCK=y
 CONFIG_DMA_NONCOHERENT=y
+CONFIG_DMA_NEED_PCI_MAP_STATE=y
 CONFIG_EARLY_PRINTK=y
 CONFIG_CPU_LITTLE_ENDIAN=y
 CONFIG_IRQ_CPU=y
diff -puN arch/mips/configs/e55_defconfig~mips-fix-coherency-configuration arch/mips/configs/e55_defconfig
--- devel/arch/mips/configs/e55_defconfig~mips-fix-coherency-configuration	2005-08-21 23:48:16.000000000 -0700
+++ devel-akpm/arch/mips/configs/e55_defconfig	2005-08-21 23:48:16.000000000 -0700
@@ -96,6 +96,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
 CONFIG_HAVE_DEC_LOCK=y
 CONFIG_DMA_NONCOHERENT=y
+CONFIG_DMA_NEED_PCI_MAP_STATE=y
 CONFIG_CPU_LITTLE_ENDIAN=y
 CONFIG_IRQ_CPU=y
 CONFIG_MIPS_L1_CACHE_SHIFT=5
diff -puN arch/mips/configs/ev64120_defconfig~mips-fix-coherency-configuration arch/mips/configs/ev64120_defconfig
--- devel/arch/mips/configs/ev64120_defconfig~mips-fix-coherency-configuration	2005-08-21 23:48:16.000000000 -0700
+++ devel-akpm/arch/mips/configs/ev64120_defconfig	2005-08-21 23:48:16.000000000 -0700
@@ -89,6 +89,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
 CONFIG_HAVE_DEC_LOCK=y
 CONFIG_DMA_NONCOHERENT=y
+CONFIG_DMA_NEED_PCI_MAP_STATE=y
 # CONFIG_CPU_LITTLE_ENDIAN is not set
 CONFIG_MIPS_GT64120=y
 # CONFIG_SYSCLK_75 is not set
diff -puN arch/mips/configs/ev96100_defconfig~mips-fix-coherency-configuration arch/mips/configs/ev96100_defconfig
--- devel/arch/mips/configs/ev96100_defconfig~mips-fix-coherency-configuration	2005-08-21 23:48:16.000000000 -0700
+++ devel-akpm/arch/mips/configs/ev96100_defconfig	2005-08-21 23:48:16.000000000 -0700
@@ -88,6 +88,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
 CONFIG_HAVE_DEC_LOCK=y
 CONFIG_DMA_NONCOHERENT=y
+CONFIG_DMA_NEED_PCI_MAP_STATE=y
 # CONFIG_CPU_LITTLE_ENDIAN is not set
 CONFIG_IRQ_CPU=y
 CONFIG_MIPS_GT64120=y
diff -puN arch/mips/configs/ip22_defconfig~mips-fix-coherency-configuration arch/mips/configs/ip22_defconfig
--- devel/arch/mips/configs/ip22_defconfig~mips-fix-coherency-configuration	2005-08-21 23:48:16.000000000 -0700
+++ devel-akpm/arch/mips/configs/ip22_defconfig	2005-08-21 23:48:16.000000000 -0700
@@ -90,6 +90,7 @@ CONFIG_GENERIC_CALIBRATE_DELAY=y
 CONFIG_HAVE_DEC_LOCK=y
 CONFIG_ARC=y
 CONFIG_DMA_NONCOHERENT=y
+CONFIG_DMA_NEED_PCI_MAP_STATE=y
 # CONFIG_CPU_LITTLE_ENDIAN is not set
 CONFIG_IRQ_CPU=y
 CONFIG_SWAP_IO_SPACE=y
diff -puN arch/mips/configs/ip32_defconfig~mips-fix-coherency-configuration arch/mips/configs/ip32_defconfig
--- devel/arch/mips/configs/ip32_defconfig~mips-fix-coherency-configuration	2005-08-21 23:48:16.000000000 -0700
+++ devel-akpm/arch/mips/configs/ip32_defconfig	2005-08-21 23:48:16.000000000 -0700
@@ -84,6 +84,7 @@ CONFIG_ARC=y
 CONFIG_DMA_IP32=y
 CONFIG_OWN_DMA=y
 CONFIG_DMA_NONCOHERENT=y
+CONFIG_DMA_NEED_PCI_MAP_STATE=y
 # CONFIG_CPU_LITTLE_ENDIAN is not set
 CONFIG_ARC32=y
 CONFIG_BOOT_ELF32=y
diff -puN arch/mips/configs/it8172_defconfig~mips-fix-coherency-configuration arch/mips/configs/it8172_defconfig
--- devel/arch/mips/configs/it8172_defconfig~mips-fix-coherency-configuration	2005-08-21 23:48:16.000000000 -0700
+++ devel-akpm/arch/mips/configs/it8172_defconfig	2005-08-21 23:48:16.000000000 -0700
@@ -90,6 +90,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
 CONFIG_HAVE_DEC_LOCK=y
 CONFIG_DMA_NONCOHERENT=y
+CONFIG_DMA_NEED_PCI_MAP_STATE=y
 CONFIG_CPU_LITTLE_ENDIAN=y
 CONFIG_ITE_BOARD_GEN=y
 CONFIG_IT8172_CIR=y
diff -puN arch/mips/configs/ivr_defconfig~mips-fix-coherency-configuration arch/mips/configs/ivr_defconfig
--- devel/arch/mips/configs/ivr_defconfig~mips-fix-coherency-configuration	2005-08-21 23:48:16.000000000 -0700
+++ devel-akpm/arch/mips/configs/ivr_defconfig	2005-08-21 23:48:16.000000000 -0700
@@ -89,6 +89,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
 CONFIG_HAVE_DEC_LOCK=y
 CONFIG_DMA_NONCOHERENT=y
+CONFIG_DMA_NEED_PCI_MAP_STATE=y
 CONFIG_CPU_LITTLE_ENDIAN=y
 CONFIG_ITE_BOARD_GEN=y
 CONFIG_IT8172_CIR=y
diff -puN arch/mips/configs/jaguar-atx_defconfig~mips-fix-coherency-configuration arch/mips/configs/jaguar-atx_defconfig
--- devel/arch/mips/configs/jaguar-atx_defconfig~mips-fix-coherency-configuration	2005-08-21 23:48:16.000000000 -0700
+++ devel-akpm/arch/mips/configs/jaguar-atx_defconfig	2005-08-21 23:48:16.000000000 -0700
@@ -81,6 +81,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
 CONFIG_HAVE_DEC_LOCK=y
 CONFIG_DMA_NONCOHERENT=y
+CONFIG_DMA_NEED_PCI_MAP_STATE=y
 CONFIG_LIMITED_DMA=y
 # CONFIG_CPU_LITTLE_ENDIAN is not set
 CONFIG_IRQ_CPU=y
diff -puN arch/mips/configs/jmr3927_defconfig~mips-fix-coherency-configuration arch/mips/configs/jmr3927_defconfig
--- devel/arch/mips/configs/jmr3927_defconfig~mips-fix-coherency-configuration	2005-08-21 23:48:16.000000000 -0700
+++ devel-akpm/arch/mips/configs/jmr3927_defconfig	2005-08-21 23:48:16.000000000 -0700
@@ -82,6 +82,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
 CONFIG_HAVE_DEC_LOCK=y
 CONFIG_DMA_NONCOHERENT=y
+CONFIG_DMA_NEED_PCI_MAP_STATE=y
 # CONFIG_CPU_LITTLE_ENDIAN is not set
 CONFIG_MIPS_TX3927=y
 CONFIG_SWAP_IO_SPACE=y
diff -puN arch/mips/configs/lasat200_defconfig~mips-fix-coherency-configuration arch/mips/configs/lasat200_defconfig
--- devel/arch/mips/configs/lasat200_defconfig~mips-fix-coherency-configuration	2005-08-21 23:48:16.000000000 -0700
+++ devel-akpm/arch/mips/configs/lasat200_defconfig	2005-08-21 23:48:16.000000000 -0700
@@ -92,6 +92,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
 CONFIG_HAVE_DEC_LOCK=y
 CONFIG_DMA_NONCOHERENT=y
+CONFIG_DMA_NEED_PCI_MAP_STATE=y
 CONFIG_MIPS_NILE4=y
 CONFIG_CPU_LITTLE_ENDIAN=y
 CONFIG_MIPS_GT64120=y
diff -puN arch/mips/configs/malta_defconfig~mips-fix-coherency-configuration arch/mips/configs/malta_defconfig
--- devel/arch/mips/configs/malta_defconfig~mips-fix-coherency-configuration	2005-08-21 23:48:16.000000000 -0700
+++ devel-akpm/arch/mips/configs/malta_defconfig	2005-08-21 23:48:16.000000000 -0700
@@ -88,6 +88,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
 CONFIG_HAVE_DEC_LOCK=y
 CONFIG_DMA_NONCOHERENT=y
+CONFIG_DMA_NEED_PCI_MAP_STATE=y
 CONFIG_GENERIC_ISA_DMA=y
 CONFIG_I8259=y
 CONFIG_MIPS_BONITO64=y
diff -puN arch/mips/configs/mpc30x_defconfig~mips-fix-coherency-configuration arch/mips/configs/mpc30x_defconfig
--- devel/arch/mips/configs/mpc30x_defconfig~mips-fix-coherency-configuration	2005-08-21 23:48:16.000000000 -0700
+++ devel-akpm/arch/mips/configs/mpc30x_defconfig	2005-08-21 23:48:16.000000000 -0700
@@ -97,6 +97,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
 CONFIG_HAVE_DEC_LOCK=y
 CONFIG_DMA_NONCOHERENT=y
+CONFIG_DMA_NEED_PCI_MAP_STATE=y
 CONFIG_CPU_LITTLE_ENDIAN=y
 CONFIG_IRQ_CPU=y
 CONFIG_MIPS_L1_CACHE_SHIFT=5
diff -puN arch/mips/configs/ocelot_3_defconfig~mips-fix-coherency-configuration arch/mips/configs/ocelot_3_defconfig
--- devel/arch/mips/configs/ocelot_3_defconfig~mips-fix-coherency-configuration	2005-08-21 23:48:16.000000000 -0700
+++ devel-akpm/arch/mips/configs/ocelot_3_defconfig	2005-08-21 23:48:16.000000000 -0700
@@ -89,6 +89,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
 CONFIG_HAVE_DEC_LOCK=y
 CONFIG_DMA_NONCOHERENT=y
+CONFIG_DMA_NEED_PCI_MAP_STATE=y
 # CONFIG_CPU_LITTLE_ENDIAN is not set
 CONFIG_IRQ_CPU=y
 CONFIG_IRQ_CPU_RM7K=y
diff -puN arch/mips/configs/ocelot_c_defconfig~mips-fix-coherency-configuration arch/mips/configs/ocelot_c_defconfig
--- devel/arch/mips/configs/ocelot_c_defconfig~mips-fix-coherency-configuration	2005-08-21 23:48:16.000000000 -0700
+++ devel-akpm/arch/mips/configs/ocelot_c_defconfig	2005-08-21 23:48:16.000000000 -0700
@@ -80,6 +80,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
 CONFIG_HAVE_DEC_LOCK=y
 CONFIG_DMA_NONCOHERENT=y
+CONFIG_DMA_NEED_PCI_MAP_STATE=y
 # CONFIG_CPU_LITTLE_ENDIAN is not set
 CONFIG_IRQ_CPU=y
 CONFIG_IRQ_MV64340=y
diff -puN arch/mips/configs/ocelot_defconfig~mips-fix-coherency-configuration arch/mips/configs/ocelot_defconfig
--- devel/arch/mips/configs/ocelot_defconfig~mips-fix-coherency-configuration	2005-08-21 23:48:16.000000000 -0700
+++ devel-akpm/arch/mips/configs/ocelot_defconfig	2005-08-21 23:48:16.000000000 -0700
@@ -82,6 +82,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
 CONFIG_HAVE_DEC_LOCK=y
 CONFIG_DMA_NONCOHERENT=y
+CONFIG_DMA_NEED_PCI_MAP_STATE=y
 # CONFIG_CPU_LITTLE_ENDIAN is not set
 CONFIG_IRQ_CPU=y
 CONFIG_IRQ_CPU_RM7K=y
diff -puN arch/mips/configs/ocelot_g_defconfig~mips-fix-coherency-configuration arch/mips/configs/ocelot_g_defconfig
--- devel/arch/mips/configs/ocelot_g_defconfig~mips-fix-coherency-configuration	2005-08-21 23:48:16.000000000 -0700
+++ devel-akpm/arch/mips/configs/ocelot_g_defconfig	2005-08-21 23:48:16.000000000 -0700
@@ -80,6 +80,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
 CONFIG_HAVE_DEC_LOCK=y
 CONFIG_DMA_NONCOHERENT=y
+CONFIG_DMA_NEED_PCI_MAP_STATE=y
 # CONFIG_CPU_LITTLE_ENDIAN is not set
 CONFIG_IRQ_CPU=y
 CONFIG_IRQ_CPU_RM7K=y
diff -puN arch/mips/configs/pb1100_defconfig~mips-fix-coherency-configuration arch/mips/configs/pb1100_defconfig
--- devel/arch/mips/configs/pb1100_defconfig~mips-fix-coherency-configuration	2005-08-21 23:48:16.000000000 -0700
+++ devel-akpm/arch/mips/configs/pb1100_defconfig	2005-08-21 23:48:16.000000000 -0700
@@ -104,6 +104,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
 CONFIG_HAVE_DEC_LOCK=y
 CONFIG_DMA_NONCOHERENT=y
+CONFIG_DMA_NEED_PCI_MAP_STATE=y
 CONFIG_CPU_LITTLE_ENDIAN=y
 CONFIG_SWAP_IO_SPACE=y
 # CONFIG_AU1X00_USB_DEVICE is not set
diff -puN arch/mips/configs/rm200_defconfig~mips-fix-coherency-configuration arch/mips/configs/rm200_defconfig
--- devel/arch/mips/configs/rm200_defconfig~mips-fix-coherency-configuration	2005-08-21 23:48:16.000000000 -0700
+++ devel-akpm/arch/mips/configs/rm200_defconfig	2005-08-21 23:48:16.000000000 -0700
@@ -91,6 +91,7 @@ CONFIG_GENERIC_CALIBRATE_DELAY=y
 CONFIG_HAVE_DEC_LOCK=y
 CONFIG_ARC=y
 CONFIG_DMA_NONCOHERENT=y
+CONFIG_DMA_NEED_PCI_MAP_STATE=y
 CONFIG_GENERIC_ISA_DMA=y
 CONFIG_I8259=y
 CONFIG_CPU_LITTLE_ENDIAN=y
diff -puN arch/mips/configs/sead_defconfig~mips-fix-coherency-configuration arch/mips/configs/sead_defconfig
--- devel/arch/mips/configs/sead_defconfig~mips-fix-coherency-configuration	2005-08-21 23:48:16.000000000 -0700
+++ devel-akpm/arch/mips/configs/sead_defconfig	2005-08-21 23:48:16.000000000 -0700
@@ -80,6 +80,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
 CONFIG_HAVE_DEC_LOCK=y
 CONFIG_DMA_NONCOHERENT=y
+CONFIG_DMA_NEED_PCI_MAP_STATE=y
 CONFIG_CPU_LITTLE_ENDIAN=y
 CONFIG_IRQ_CPU=y
 CONFIG_MIPS_BOARDS_GEN=y
diff -puN arch/mips/configs/tb0226_defconfig~mips-fix-coherency-configuration arch/mips/configs/tb0226_defconfig
--- devel/arch/mips/configs/tb0226_defconfig~mips-fix-coherency-configuration	2005-08-21 23:48:16.000000000 -0700
+++ devel-akpm/arch/mips/configs/tb0226_defconfig	2005-08-21 23:48:16.000000000 -0700
@@ -95,6 +95,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
 CONFIG_HAVE_DEC_LOCK=y
 CONFIG_DMA_NONCOHERENT=y
+CONFIG_DMA_NEED_PCI_MAP_STATE=y
 CONFIG_CPU_LITTLE_ENDIAN=y
 CONFIG_IRQ_CPU=y
 CONFIG_MIPS_L1_CACHE_SHIFT=5
diff -puN arch/mips/configs/tb0229_defconfig~mips-fix-coherency-configuration arch/mips/configs/tb0229_defconfig
--- devel/arch/mips/configs/tb0229_defconfig~mips-fix-coherency-configuration	2005-08-21 23:48:16.000000000 -0700
+++ devel-akpm/arch/mips/configs/tb0229_defconfig	2005-08-21 23:48:16.000000000 -0700
@@ -98,6 +98,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
 CONFIG_HAVE_DEC_LOCK=y
 CONFIG_DMA_NONCOHERENT=y
+CONFIG_DMA_NEED_PCI_MAP_STATE=y
 CONFIG_CPU_LITTLE_ENDIAN=y
 CONFIG_IRQ_CPU=y
 CONFIG_MIPS_L1_CACHE_SHIFT=5
diff -puN arch/mips/configs/workpad_defconfig~mips-fix-coherency-configuration arch/mips/configs/workpad_defconfig
--- devel/arch/mips/configs/workpad_defconfig~mips-fix-coherency-configuration	2005-08-21 23:48:16.000000000 -0700
+++ devel-akpm/arch/mips/configs/workpad_defconfig	2005-08-21 23:48:16.000000000 -0700
@@ -96,6 +96,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
 CONFIG_HAVE_DEC_LOCK=y
 CONFIG_DMA_NONCOHERENT=y
+CONFIG_DMA_NEED_PCI_MAP_STATE=y
 CONFIG_CPU_LITTLE_ENDIAN=y
 CONFIG_IRQ_CPU=y
 CONFIG_MIPS_L1_CACHE_SHIFT=5
diff -puN arch/mips/defconfig~mips-fix-coherency-configuration arch/mips/defconfig
--- devel/arch/mips/defconfig~mips-fix-coherency-configuration	2005-08-21 23:48:16.000000000 -0700
+++ devel-akpm/arch/mips/defconfig	2005-08-21 23:48:16.000000000 -0700
@@ -90,6 +90,7 @@ CONFIG_GENERIC_CALIBRATE_DELAY=y
 CONFIG_HAVE_DEC_LOCK=y
 CONFIG_ARC=y
 CONFIG_DMA_NONCOHERENT=y
+CONFIG_DMA_NEED_PCI_MAP_STATE=y
 # CONFIG_CPU_LITTLE_ENDIAN is not set
 CONFIG_IRQ_CPU=y
 CONFIG_SWAP_IO_SPACE=y
diff -puN arch/mips/Kconfig~mips-fix-coherency-configuration arch/mips/Kconfig
--- devel/arch/mips/Kconfig~mips-fix-coherency-configuration	2005-08-21 23:48:16.000000000 -0700
+++ devel-akpm/arch/mips/Kconfig	2005-08-21 23:48:16.000000000 -0700
@@ -951,13 +951,21 @@ config ARC
 	depends on SNI_RM200_PCI || SGI_IP32 || SGI_IP27 || SGI_IP22 || MIPS_MAGNUM_4000 || OLIVETTI_M700 || ACER_PICA_61
 	default y
 
-config	DMA_COHERENT
+config DMA_COHERENT
 	bool
 
-config	DMA_IP27
+config DMA_IP27
 	bool
 
-config	DMA_NONCOHERENT
+config DMA_IP32
+	bool
+	select DMA_NEED_PCI_MAP_STATE
+
+config DMA_NONCOHERENT
+	bool
+	select DMA_NEED_PCI_MAP_STATE
+
+config DMA_NEED_PCI_MAP_STATE
 	bool
 
 config EARLY_PRINTK
diff -puN include/asm-mips/pci.h~mips-fix-coherency-configuration include/asm-mips/pci.h
--- devel/include/asm-mips/pci.h~mips-fix-coherency-configuration	2005-08-21 23:48:16.000000000 -0700
+++ devel-akpm/include/asm-mips/pci.h	2005-08-21 23:48:16.000000000 -0700
@@ -94,7 +94,7 @@ struct pci_dev;
  */
 extern unsigned int PCI_DMA_BUS_IS_PHYS;
 
-#ifdef CONFIG_MAPPED_DMA_IO
+#ifdef CONFIG_DMA_NEED_PCI_MAP_STATE
 
 /* pci_unmap_{single,page} is not a nop, thus... */
 #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)	dma_addr_t ADDR_NAME;
@@ -104,7 +104,7 @@ extern unsigned int PCI_DMA_BUS_IS_PHYS;
 #define pci_unmap_len(PTR, LEN_NAME)		((PTR)->LEN_NAME)
 #define pci_unmap_len_set(PTR, LEN_NAME, VAL)	(((PTR)->LEN_NAME) = (VAL))
 
-#else /* CONFIG_MAPPED_DMA_IO  */
+#else /* CONFIG_DMA_NEED_PCI_MAP_STATE  */
 
 /* pci_unmap_{page,single} is a nop so... */
 #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)
@@ -114,7 +114,7 @@ extern unsigned int PCI_DMA_BUS_IS_PHYS;
 #define pci_unmap_len(PTR, LEN_NAME)		(0)
 #define pci_unmap_len_set(PTR, LEN_NAME, VAL)	do { } while (0)
 
-#endif /* CONFIG_MAPPED_DMA_IO  */
+#endif /* CONFIG_DMA_NEED_PCI_MAP_STATE  */
 
 /* This is always fine. */
 #define pci_dac_dma_supported(pci_dev, mask)	(1)
_