From d0688c92692cc936ce2c347f26572b1bb55dc660 Mon Sep 17 00:00:00 2001 From: Arthur Hanson Rasmusson Date: Tue, 29 Sep 2026 21:39:00 -0400 Subject: sema-svc: deliver the tracking-sem payload for every consumed GPFIFO entry The client's UVM_REGISTER_GPU blocks in uvm_push_end_and_wait on the first CE channel's tracking semaphore (pool word 0x121000000) waiting for value 3. The pool payload stayed at 1 while the client pushed: the pump processed entries whose push bytes were unreadable or had no decodable release, so the release bookkeeping advanced (expected_sem_payload) but nothing was written to the pool page. Treat the GPU semantics as normative: each consumed GPFIFO entry on an engine channel releases the channel's tracking semaphore with the incrementing queued value. When the decoded stream carries no release and sema_fake_rel is enabled, deliver the expected payload through svc_fake_release() instead of only bumping the counter. Also initialize expected_sem_payload for a fresh pool page whose current payload is 0 (expected = 1) so the first push is deliverable from the start. --- kernel/gsp_sema_service.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/kernel/gsp_sema_service.c b/kernel/gsp_sema_service.c index 3c732e8..2874cc1 100644 --- a/kernel/gsp_sema_service.c +++ b/kernel/gsp_sema_service.c @@ -3961,7 +3961,7 @@ static void svc_init_expected_payload(struct nv_vgpu_device *vgpu, &cur, sizeof(cur))) return; - if (cur > 0 && cur < 0x100000) { + if (cur < 0x100000) { ch->expected_sem_payload = cur + 1; if (ch->logged_expected != cur) { ch->logged_expected = cur; @@ -4235,6 +4235,7 @@ static void svc_pump_channels(struct nv_vgpu_device *vgpu) */ { u64 rel_before = svc_rel_va_seen; + bool rel_seen; svc_decode_stream(vgpu, pb, len, 0, @@ -4243,15 +4244,19 @@ static void svc_pump_channels(struct nv_vgpu_device *vgpu) ch->engine_type, va, injected); - if (svc_rel_va_seen != rel_before) + rel_seen = (svc_rel_va_seen != rel_before); + if (rel_seen) ch->last_rel_va = svc_rel_va_seen; + ch->submissions++; + svc.gpfifo_entries_done++; + if (ch->engine_type && ch->expected_sem_payload) { + if (!rel_seen && gsp_sema_fake_rel) + svc_fake_release(vgpu, ch); + else + ch->expected_sem_payload++; + } } - ch->submissions++; - svc.gpfifo_entries_done++; - /* Advance expected payload for this channel's tracking semaphore. */ - if (ch->engine_type && ch->expected_sem_payload) - ch->expected_sem_payload++; } else { /* * Content rescue: the push-buffer VA is not -- cgit v1.2.3