mcux: osa/wifi_nxp: fix OSA timer handle size mismatch on AArch64 #838
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.37) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.37 · 232 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.326
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #838"
general
weight: 0.35
ZhaoxiangJin
Fix OSA timer handle size mismatch on AArch64 (LP64) in the Zephyr OSA port.
Problem
On AArch64, the OSA timer handle buffer allocated by
OSA_TIMER_HANDLE_DEFINE() is too small to hold the struct timer_data
used by the wifi_nxp OSA port, causing memory corruption and a
work-queue assert/panic during Wi-Fi traffic.
Two mismatched timer structure definitions existed:
buffer allocation. Layout: {k_timer handle; k_work work; padding[4];}
= 136 bytes. OSA_TIMER_HANDLE_SIZE = sizeof(this) = 136.
{callback; user_arg; period; reload_options; k_timer timer; k_work work;}
= 144 bytes (24-byte prefix before k_timer/k_work).
On AArch64, OSA_TIMER_HANDLE_SIZE (136) < sizeof(struct timer_data) (144).
The buffer overruns into the field following the handle in the parent
struct. In reorder_tmr_cnxt_t, timer_is_set (offset 136) aliases
timer_data.work.flags (offset 136), causing K_WORK_RUNNING_BIT to be
set spuriously and triggering a work->queue == NULL assert/panic.
Fix
1. Align osa_zephyr_timerHandle_t with the actual timer_data layout by
replacing {k_timer handle; k_work work; padding[4]} with the full
set of fields: {callback; user_arg; period; reload_options;
k_timer timer; k_work work}. OSA_TIMER_HANDLE_SIZE is now always
large enough.
2. Replace the duplicate struct timer_data definition in osa_zephyr.h
with a typedef alias of osa_zephyr_timerHandle_t, eliminating the
two-structure divergence at the source.
Testing
Verified on frdm_imx91/mimx9131 (AArch64, Cortex-A55) with IW610: