diff options
author | John David Anglin <dave.anglin@bell.net> | 2016-11-24 20:06:32 -0500 |
---|---|---|
committer | Helge Deller <deller@gmx.de> | 2016-11-25 06:31:59 -0500 |
commit | c0452fb9fb8f49c7d68ab9fa0ad092016be7b45f (patch) | |
tree | 18cdaf4195e895a6667959e73d2e80720a311cb5 | |
parent | 43b1f6abd59063a088416a0df042b36450f91f75 (diff) |
parisc: Fix race in pci-dma.c
We are still troubled by occasional random segmentation faults and
memory memory corruption on SMP machines. The causes quite a few
package builds to fail on the Debian buildd machines for parisc. When
gcc-6 failed to build three times in a row, I looked again at the TLB
related code. I found a couple of issues. This is the first.
In general, we need to ensure page table updates and corresponding TLB
purges are atomic. The attached patch fixes an instance in pci-dma.c
where the page table update was not guarded by the TLB lock.
Tested on rp3440 and c8000. So far, no further random segmentation
faults have been observed.
Signed-off-by: John David Anglin <dave.anglin@bell.net>
Cc: <stable@vger.kernel.org> # v3.16+
Signed-off-by: Helge Deller <deller@gmx.de>
-rw-r--r-- | arch/parisc/kernel/pci-dma.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/parisc/kernel/pci-dma.c b/arch/parisc/kernel/pci-dma.c index 02d9ed0f3949..494ff6e8c88a 100644 --- a/arch/parisc/kernel/pci-dma.c +++ b/arch/parisc/kernel/pci-dma.c | |||
@@ -95,8 +95,8 @@ static inline int map_pte_uncached(pte_t * pte, | |||
95 | 95 | ||
96 | if (!pte_none(*pte)) | 96 | if (!pte_none(*pte)) |
97 | printk(KERN_ERR "map_pte_uncached: page already exists\n"); | 97 | printk(KERN_ERR "map_pte_uncached: page already exists\n"); |
98 | set_pte(pte, __mk_pte(*paddr_ptr, PAGE_KERNEL_UNC)); | ||
99 | purge_tlb_start(flags); | 98 | purge_tlb_start(flags); |
99 | set_pte(pte, __mk_pte(*paddr_ptr, PAGE_KERNEL_UNC)); | ||
100 | pdtlb_kernel(orig_vaddr); | 100 | pdtlb_kernel(orig_vaddr); |
101 | purge_tlb_end(flags); | 101 | purge_tlb_end(flags); |
102 | vaddr += PAGE_SIZE; | 102 | vaddr += PAGE_SIZE; |