Skip to content

Commit

Permalink
[POWERPC] Fix G5 DART (IOMMU) race causing occasional data corruption
Browse files Browse the repository at this point in the history
It seems that the occasional data corruption observed with the tg3
driver wasn't due to missing barriers after all, but rather seems to
be due to the DART (= IOMMU) in the U4 northbridge reading stale
IOMMU table entries from memory due to a race.  This fixes it by
making the CPU read the entry back from memory before using it.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
  • Loading branch information
Benjamin Herrenschmidt authored and Paul Mackerras committed Sep 13, 2006
1 parent f007cac commit eeac5c1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion arch/powerpc/sysdev/dart_iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ static inline void dart_tlb_invalidate_one(unsigned long bus_rpn)

static void dart_flush(struct iommu_table *tbl)
{
mb();
if (dart_dirty) {
dart_tlb_invalidate_all();
dart_dirty = 0;
Expand Down Expand Up @@ -172,9 +173,13 @@ static void dart_build(struct iommu_table *tbl, long index,
uaddr += DART_PAGE_SIZE;
}

/* make sure all updates have reached memory */
mb();
in_be32((unsigned __iomem *)dp);
mb();

if (dart_is_u4) {
rpn = index;
mb(); /* make sure all updates have reached memory */
while (npages--)
dart_tlb_invalidate_one(rpn++);
} else {
Expand Down

0 comments on commit eeac5c1

Please sign in to comment.