From ea127e719b930a00cdf7fb2b30cd46c2d5c07482 Mon Sep 17 00:00:00 2001 From: SDK-Chan Date: Mon, 25 Aug 2025 17:16:17 +0200 Subject: [PATCH] Update src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp --- src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp b/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp index 67a4b2193f..22e3941a76 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp @@ -216,15 +216,11 @@ NvResult nvhost_gpu::SetErrorNotifier(IoctlSetErrorNotifier& params) { } void nvhost_gpu::PostErrorNotification(u32 info32, u16 info16, NotifierStatus status) { - // Needed to avoid lock ordering issues with error_notifier_event->Signal() - { - std::scoped_lock lk(channel_mutex); - - if (error_notifier_params.mem == 0 || error_notifier_params.size < sizeof(IoctlGetErrorNotification)) { - return; - } + if (error_notifier_params.mem == 0 || error_notifier_params.size < sizeof(IoctlGetErrorNotification)) { + return; } + auto handle = nvmap.GetHandle(static_cast(error_notifier_params.mem)); if (!handle || !handle->address) return; @@ -367,7 +363,7 @@ NvResult nvhost_gpu::SubmitGPFIFOImpl(IoctlSubmitGpfifo& params, Tegra::CommandL auto& gpu = system.GPU(); - std::unique_lock lk(channel_mutex); + std::scoped_lock lock(channel_mutex); const auto bind_id = channel_state->bind_id; @@ -375,7 +371,6 @@ NvResult nvhost_gpu::SubmitGPFIFOImpl(IoctlSubmitGpfifo& params, Tegra::CommandL if (flags.fence_wait.Value()) { if (flags.increment_value.Value()) { - lk.unlock(); PostErrorNotification(flags.raw, 0, NotifierStatus::GenericError); return NvResult::BadParameter; }