The TRBs left calculation didn't account for the link TRB taking up one
spot.
If the trb_dequeue < trb_enqueue, then the result includes the link
TRB slot so it must be adjusted.
Change-Id: If03f89ea1f523b4bce1b5f096ae81aebc891c63f
Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
(cherry picked from commit
7d0a038b130cde7265d6bbc5e148734cb127f341)
trbs_left = dep->trb_dequeue - dep->trb_enqueue;
trbs_left %= DWC3_TRB_NUM;
+ if (dep->trb_dequeue < dep->trb_enqueue)
+ trbs_left--;
+
return trbs_left;
}