diff options
author | Tom Rini <trini@konsulko.com> | 2021-07-29 12:10:23 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-07-29 12:10:55 -0400 |
commit | 15f7e0dc01d8a851fb1bfbf0e47eab5b67ed26b3 (patch) | |
tree | a05518590771cfaff996f35856b9d9d8edfa7221 /arch/arm/include | |
parent | 38436abd5e58044eccddbcd7ec3610a9104e86b6 (diff) | |
parent | 62b27a561c2868d95445905ad554297e43cc0f2b (diff) |
Merge branch '2021-07-28-assorted-fixes'
- Assorted bugfixes
Diffstat (limited to 'arch/arm/include')
-rw-r--r-- | arch/arm/include/asm/io.h | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h index df264a170b..36b840378a 100644 --- a/arch/arm/include/asm/io.h +++ b/arch/arm/include/asm/io.h @@ -338,6 +338,7 @@ extern void __readwrite_bug(const char *fn); /* Optimized copy functions to read from/write to IO sapce */ #ifdef CONFIG_ARM64 +#include <cpu_func.h> /* * Copy data from IO memory space to "real" memory space. */ @@ -351,11 +352,13 @@ void __memcpy_fromio(void *to, const volatile void __iomem *from, size_t count) count--; } - while (count >= 8) { - *(u64 *)to = __raw_readq(from); - from += 8; - to += 8; - count -= 8; + if (mmu_status()) { + while (count >= 8) { + *(u64 *)to = __raw_readq(from); + from += 8; + to += 8; + count -= 8; + } } while (count) { @@ -379,11 +382,13 @@ void __memcpy_toio(volatile void __iomem *to, const void *from, size_t count) count--; } - while (count >= 8) { - __raw_writeq(*(u64 *)from, to); - from += 8; - to += 8; - count -= 8; + if (mmu_status()) { + while (count >= 8) { + __raw_writeq(*(u64 *)from, to); + from += 8; + to += 8; + count -= 8; + } } while (count) { |