From 36f37b92001cc369065dd36dbf4f783d7c6b6fbd Mon Sep 17 00:00:00 2001 From: Lephe Date: Sun, 1 Jun 2025 21:30:52 +0200 Subject: [PATCH] dma: don't wait on unbinds in SH3 This can freeze for reasons I didn't completely root cause. The MWE leading to this was made by @Calamari, is very dependent on factors I haven't completely characterized, but includes having the DMA driver, doing a world switch; and seems to require some timers (via gray engine) and stack usage, but I'm not clear on the role of that. --- src/dma/dma.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/dma/dma.c b/src/dma/dma.c index ff78eb2..5901423 100644 --- a/src/dma/dma.c +++ b/src/dma/dma.c @@ -298,6 +298,8 @@ static void configure(void) static void funbind(void) { + if(isSH3()) return; + /* Wait for all OS transfers to finish before taking over */ for(int channel = 0; channel < 6; channel++) dma_channel_wait(channel, true); @@ -305,6 +307,8 @@ static void funbind(void) static void unbind(void) { + if(isSH3()) return; + /* Make sure all DMA transfers are finished before leaving gint */ for(int channel = 0; channel < 6; channel++) dma_channel_wait(channel, false);