From e7a4003f06238619105f25ba17795de8a52818c6 Mon Sep 17 00:00:00 2001 From: TuxSH <1922548+TuxSH@users.noreply.github.com> Date: Sun, 5 Feb 2023 01:13:02 +0000 Subject: [PATCH] rosalina: fix shell open notif. handling at boot Was causing boot failure with recent commits. --- sysmodules/rosalina/source/main.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/sysmodules/rosalina/source/main.c b/sysmodules/rosalina/source/main.c index b4a935b..6bd77cb 100644 --- a/sysmodules/rosalina/source/main.c +++ b/sysmodules/rosalina/source/main.c @@ -162,8 +162,16 @@ static void handleShellNotification(u32 notificationId) { if (notificationId == 0x213) { // Shell opened - // Note that this notification is fired on system init - ScreenFiltersMenu_RestoreSettings(); + // Note that this notification is also fired on system init. + // Sequence goes like this: MCU fires notif. 0x200 on shell open + // and shell close, then NS demuxes it and fires 0x213 and 0x214. + + // We need to check here if GSP has done its init stuff, in particular + // clock and reset, otherwise we'll cause core1 to be in a waitstate + // forever (if we access a GPU reg while the GPU block's clock is off). + // (GSP does its init before registering its services) + if (isServiceUsable("gsp::Gpu")) + ScreenFiltersMenu_RestoreSettings(); menuShouldExit = false; } else { // Shell closed