Fix garbage messages on device de-enumeration#53
Conversation
6142c6b to
b896853
Compare
|
Hi @CristianManca, Is this issue introduced by interval timeout implementation only? Best, |
|
Hi @5656hcx , I removed the changes in src/windows/wdfserial/QCRD.c regarding interval timeout. Regards, |
Clear ring buffer at D3Final to prevent garbage messages. Signed-off-by: Cristian Manca <Cristian.Manca@telit.com>
b896853 to
9caf3ff
Compare
PR description needs to be updated to reflect final changes |
5656hcx
left a comment
There was a problem hiding this comment.
Please update the pull request description to reflect the latest changes.
Also, making the buffer cleanup outside read thread is unsafe.
| ("<%ws> QCPNP_EvtDeviceD0Exit D3Final: clearing ring buffer\n", pDevContext->PortName) | ||
| ); | ||
| QCUTIL_RingBufferClear(&pDevContext->ReadRingBuffer); | ||
| pDevContext->AmountInInQueue = 0; |
There was a problem hiding this comment.
Updating the ReadRingBuffer outside read thread may experience race condition
This patch fixes an issue where qcwdfser emitted copies of the last AT commands replies (garbage messages) when the device de-enumerated.
Root cause: stale data remained in the serial ring buffer could re-deliver buffered data during D3 transitions.
This patch prevents qcwdfser from emitting stale copies of the last AT replies on device de‑enumeration by clearing the serial ring buffer at D3Final.
Changes:
Ring buffer and power state management:
D3Finalpower state, the read ring buffer is now explicitly cleared and the in-queue byte count reset, ensuring no stale data remains when the device is powered down.