Skip to content

Commit 1fc7db2

Browse files
danglin44hdeller
authored andcommitted
parisc: Don't enforce DMA completion order in cache flushes
The only place we need to ensure all outstanding cache coherence operations are complete is in invalidate_kernel_vmap_range. All parisc drivers synchronize DMA operations internally and do not call invalidate_kernel_vmap_range. We only need this for non-coherent I/O operations. Signed-off-by: John David Anglin <dave.anglin@bell.net> Signed-off-by: Helge Deller <deller@gmx.de>
1 parent 41dc0b5 commit 1fc7db2

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

arch/parisc/include/asm/cache.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ void parisc_setup_cache_timing(void);
5454
#define asm_io_sync() asm volatile("sync" \
5555
ALTERNATIVE(ALT_COND_NO_DCACHE, INSN_NOP) \
5656
ALTERNATIVE(ALT_COND_NO_IOC_FDC, INSN_NOP) :::"memory")
57+
#define asm_syncdma() asm volatile("syncdma" :::"memory")
5758

5859
#endif /* ! __ASSEMBLY__ */
5960

arch/parisc/kernel/cache.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,9 @@ void invalidate_kernel_vmap_range(void *vaddr, int size)
754754
unsigned long start = (unsigned long)vaddr;
755755
unsigned long end = start + size;
756756

757+
/* Ensure DMA is complete */
758+
asm_syncdma();
759+
757760
if ((!IS_ENABLED(CONFIG_SMP) || !arch_irqs_disabled()) &&
758761
(unsigned long)size >= parisc_cache_flush_threshold) {
759762
flush_tlb_kernel_range(start, end);

arch/parisc/kernel/pacache.S

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,6 @@ fdoneloop2:
300300
fdce,m %arg1(%sr1, %arg0) /* Fdce for one loop */
301301

302302
fdsync:
303-
syncdma
304303
sync
305304
mtsm %r22 /* restore I-bit */
306305
89: ALTERNATIVE(88b, 89b, ALT_COND_NO_DCACHE, INSN_NOP)
@@ -1098,7 +1097,6 @@ ENTRY_CFI(flush_kernel_dcache_range_asm)
10981097

10991098
sync
11001099
89: ALTERNATIVE(88b, 89b, ALT_COND_NO_DCACHE, INSN_NOP)
1101-
syncdma
11021100
bv %r0(%r2)
11031101
nop
11041102
ENDPROC_CFI(flush_kernel_dcache_range_asm)
@@ -1140,7 +1138,6 @@ ENTRY_CFI(purge_kernel_dcache_range_asm)
11401138

11411139
sync
11421140
89: ALTERNATIVE(88b, 89b, ALT_COND_NO_DCACHE, INSN_NOP)
1143-
syncdma
11441141
bv %r0(%r2)
11451142
nop
11461143
ENDPROC_CFI(purge_kernel_dcache_range_asm)

0 commit comments

Comments
 (0)