summaryrefslogtreecommitdiffstats
path: root/kernel/gsp_sema_service.c
diff options
context:
space:
mode:
authorArthur Hanson Rasmusson <arthur@vgpu.io>2026-09-29 21:39:00 -0400
committerArthur Hanson Rasmusson <arthur@vgpu.io>2026-09-29 21:39:00 -0400
commit31f82600644660cbb1651115b04b4f7a8148fa49 (patch)
tree7515e5600cfd63896c4973678b15032ebd80715a /kernel/gsp_sema_service.c
parent035bd0e17ae0e5d3786bf250481883200c25feeb (diff)
downloadopen-iov-31f82600644660cbb1651115b04b4f7a8148fa49.tar.gz
open-iov-31f82600644660cbb1651115b04b4f7a8148fa49.zip
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.
Diffstat (limited to 'kernel/gsp_sema_service.c')
-rw-r--r--kernel/gsp_sema_service.c19
1 files 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