cdcacm: send RX flow control only for the first time when limit is crossed #7558
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Current implementation sends RX flow control activation every time the limit is crossed when receive packet is read by driver. This may result in repetitious sends of RX flow control signal when some packets are left on the bus or in FIFO.
This change ensures RX flow control is send only when it is not active (priv->iactive is false). It also removes break statement from while loop when watermark is used. The driver should activate RX flow and read the rest of the packet instead of discarding it.
I am not entirely sure if this is the correct way to implement this, should be carefully checked before merged (cc to @gregory-nutt who implemented the flow control to CDC ACM).
Impact
CDC ACM device driver.
Testing
Tested on SAM E70 based MCU.