[SPARC64]: Fix for Niagara memory corruption.
authorDavid S. Miller <davem@davemloft.net>
Thu, 22 Jun 2006 07:01:56 +0000 (00:01 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Sat, 24 Jun 2006 06:15:21 +0000 (23:15 -0700)
commitc2a5a46be4a1c682e18e29e67785126b7610b14d
treeb9101fa7547c9c5d86ff550e6398a8cf7c2f283a
parent486ad10a7e1b2bb61ea9e48c4d9510f50cd74fc5
[SPARC64]: Fix for Niagara memory corruption.

On some sun4v systems, after netboot the ethernet controller and it's
DMA mappings can be left active.  The net result is that the kernel
can end up using memory the ethernet controller will continue to DMA
into, resulting in corruption.

To deal with this, we are more careful about importing IOMMU
translations which OBP has left in the IO-TLB.  If the mapping maps
into an area the firmware claimed was free and available memory for
the kernel to use, we demap instead of import that IOMMU entry.

This is going to cause the network chip to take a PCI master abort on
the next DMA it attempts, if it has been left going like this.  All
tests show that this is handled properly by the PCI layer and the e1000
drivers.

Signed-off-by: David S. Miller <davem@davemloft.net>
arch/sparc64/kernel/pci_sun4v.c
arch/sparc64/mm/init.c
include/asm-sparc64/pgtable.h