Commit c16c11dc authored by Eric Holmberg's avatar Eric Holmberg Committed by Sudhir Sharma
Browse files

u_data_hsuart: Fix high-watermark race condition



If multiple packets are written quickly and the high watermark is
exceeded, then the -EAGAIN return code is returned (A), the return code
is checked and the tx processing is throttled (B) until a low-watermark
notification is received (C).  If the packet queue is drained and the
low-watermark notification is delivered between steps (A) and (B), then
the order of events will be ACB and the tx queue will be permanently
stalled.

To fix this, a spinlock is held to ensure that the sequence is always
ABC.

CRs-Fixed: 404380
Change-Id: I639eda87e115f592a6465f624e611830e6173852
Signed-off-by: default avatarEric Holmberg <eholmber@codeaurora.org>
(cherry picked from commit e92b15ff084f1aeb9dec2a722c68f3b05f65fffd)
Signed-off-by: default avatarDhivya Subramanian <dthiru@codeaurora.org>
Signed-off-by: default avatarEric Holmberg <eholmber@codeaurora.org>
(cherry picked from commit 8d0dda8098216754375e994f90fcd1ef5ef36832)

Signed-off-by: default avatarSudhir Sharma <sudsha@codeaurora.org>
parent 81bdcacc
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment