summaryrefslogtreecommitdiff
path: root/arch/mips/loongson64/env.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2023-12-22 18:05:07 -0500
committerPaolo Bonzini <pbonzini@redhat.com>2023-12-22 18:05:07 -0500
commitef5b28372c565128bdce7a59bc78402a8ce68e1b (patch)
tree77f549fcf73f8400a34e7a5d51548fafd1533644 /arch/mips/loongson64/env.c
parent5c2b2176ead1911d652b8848169bb44bdde75ca8 (diff)
parent4ad9843e1ea088bd2529290234c6c4c6374836a7 (diff)
Merge tag 'kvm-riscv-fixes-6.7-1' of https://github.com/kvm-riscv/linux into kvm-master
KVM/riscv fixes for 6.7, take #1 - Fix a race condition in updating external interrupt for trap-n-emulated IMSIC swfile - Fix print_reg defaults in get-reg-list selftest
Diffstat (limited to 'arch/mips/loongson64/env.c')
-rw-r--r--arch/mips/loongson64/env.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/arch/mips/loongson64/env.c b/arch/mips/loongson64/env.c
index c961e2999f15..ef3750a6ffac 100644
--- a/arch/mips/loongson64/env.c
+++ b/arch/mips/loongson64/env.c
@@ -13,6 +13,8 @@
* Copyright (C) 2009 Lemote Inc.
* Author: Wu Zhangjin, wuzhangjin@gmail.com
*/
+
+#include <linux/dma-map-ops.h>
#include <linux/export.h>
#include <linux/pci_ids.h>
#include <asm/bootinfo.h>
@@ -147,8 +149,14 @@ void __init prom_lefi_init_env(void)
loongson_sysconf.dma_mask_bits = eirq_source->dma_mask_bits;
if (loongson_sysconf.dma_mask_bits < 32 ||
- loongson_sysconf.dma_mask_bits > 64)
+ loongson_sysconf.dma_mask_bits > 64) {
loongson_sysconf.dma_mask_bits = 32;
+ dma_default_coherent = true;
+ } else {
+ dma_default_coherent = !eirq_source->dma_noncoherent;
+ }
+
+ pr_info("Firmware: Coherent DMA: %s\n", dma_default_coherent ? "on" : "off");
loongson_sysconf.restart_addr = boot_p->reset_system.ResetWarm;
loongson_sysconf.poweroff_addr = boot_p->reset_system.Shutdown;