From facc98058ce91225d6ef3e418dc11f33522baaae Mon Sep 17 00:00:00 2001 From: mwojcik Date: Wed, 31 Jan 2024 17:08:35 +0800 Subject: [PATCH] subkernel: fix DMA return control to wrong master --- src/libksupport/src/kernel/dma.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libksupport/src/kernel/dma.rs b/src/libksupport/src/kernel/dma.rs index c77a6aa6..961e8622 100644 --- a/src/libksupport/src/kernel/dma.rs +++ b/src/libksupport/src/kernel/dma.rs @@ -170,6 +170,7 @@ pub extern "C" fn dma_playback(timestamp: i64, ptr: i32, _uses_ddma: bool) { csr::rtio_dma::base_address_write(ptr as u32); csr::rtio_dma::time_offset_write(timestamp as u64); + let old_cri_master = csr::cri_con::selected_read(); csr::cri_con::selected_write(1); csr::rtio_dma::enable_write(1); #[cfg(has_drtio)] @@ -183,7 +184,7 @@ pub extern "C" fn dma_playback(timestamp: i64, ptr: i32, _uses_ddma: bool) { }); } while csr::rtio_dma::enable_read() != 0 {} - csr::cri_con::selected_write(0); + csr::cri_con::selected_write(old_cri_master); let error = csr::rtio_dma::error_read(); if error != 0 {