fix(quest): check a tracked KGSL context before answering a read

A descriptor can close without destroying its contexts and its number can
be reused. KGSL checks the owner on every wait, so one wait on the retired
timestamp keeps a read of a dead context an error.
This commit is contained in:
Anuar Lukpanov committed 2026-11-01 11:27:57 +05:00
1 parent bf0ee99b6d
commit 6d7732710c
2 files changed
+21 -11

No files matched your search

+7 -3
View File
@@ -95,14 +95,18 @@ int main(void) {
assert(read_timestamp(3, &timestamp) == 0 && timestamp == 2 && waits == 3);
waits = 0;
assert(read_timestamp(3, &timestamp) == 0 && timestamp == 2 && waits == 1);
assert(read_timestamp(3, &timestamp) == 0 && timestamp == 2 && waits == 2);
retired = 3;
waits = 0;
assert(read_timestamp(3, &timestamp) == 0 && timestamp == 3 && waits == 1);
assert(read_timestamp(3, &timestamp) == 0 && timestamp == 3 && waits == 2);
waits = 0;
assert(read_timestamp(3, &timestamp) == 0 && timestamp == 3 && waits == 0);
assert(read_timestamp(3, &timestamp) == 0 && timestamp == 3 && waits == 1);
wait_error = EINVAL;
assert(read_timestamp(3, &timestamp) == -1 && errno == EINVAL);
wait_error = 0;
submit(4);
retired = 4;