The branch main has been updated by pkubaj:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=c7d14d149429b2cbd6a55656b1979b9280cd07b4

commit c7d14d149429b2cbd6a55656b1979b9280cd07b4
Author:     Piotr Kubaj <[email protected]>
AuthorDate: 2026-12-04 00:37:13 +0000
Commit:     Piotr Kubaj <[email protected]>
CommitDate: 2026-12-04 13:51:58 +0000

    powerpc/powernv: clear the OPAL async completion flag after use
    
    When the heartbeat picks up an async completion, it marks the token as
    completed. opal_wait_completion() never cleared that mark, so the next
    request made with the same token could get the old message back while
    firmware was still working on the new one.
    
    The mark is cleared when a token is allocated, so only callers that
    reuse a token are affected. opal_flash does that for every block, but
    firmware finishes flash requests before the call returns.
    
    Reported by:    llm-postcr
    Approved by:    jhibbits (blanket)
    MFC after:      1 week
---
 sys/powerpc/powernv/opal_async.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sys/powerpc/powernv/opal_async.c b/sys/powerpc/powernv/opal_async.c
index 41a9b1e7a3f9..a816ad7d5c71 100644
--- a/sys/powerpc/powernv/opal_async.c
+++ b/sys/powerpc/powernv/opal_async.c
@@ -108,6 +108,7 @@ opal_wait_completion(void *buf, uint64_t size, int token)
                        if (completions[token].completed) {
                                atomic_thread_fence_acq();
                                memcpy(buf, &completions[token].msg, size);
+                               completions[token].completed = false;
                                return (OPAL_SUCCESS);
                        }
                }

Reply via email to