platform: msm_shared: Fix bug in TRB status function.
First TRB (Transfer Request Buffer) was getting lost since
trb pointer was incremented before use.
CRs-Fixed: 610350
Change-Id: I8032ff32ad1562a58e26c2bfabf525375739bd64
diff --git a/platform/msm_shared/usb30_dwc.c b/platform/msm_shared/usb30_dwc.c
index 35b5c6c..0e5b2df 100644
--- a/platform/msm_shared/usb30_dwc.c
+++ b/platform/msm_shared/usb30_dwc.c
@@ -585,12 +585,6 @@
{
bytes_remaining += REG_READ_FIELD_LOCAL(&trb->f3, TRB_F3, BUFSIZ);
- /* point to next trb */
- trb++;
-
- /* decrement trb count */
- num_of_trb--;
-
/* The first non-zero status indicates the transfer status. Update
* "status" only once but still go through all the TRBs to find out
* the bytes still remaining to be transferred.
@@ -611,6 +605,12 @@
REG_WRITE_FIELD_LOCAL(&trb->f4, TRB_F4, HWO, 0x0);
trb_updated = 1;
}
+
+ /* point to next trb */
+ trb++;
+
+ /* decrement trb count */
+ num_of_trb--;
}
/* flush out any updates to trb before continuing */