summaryrefslogtreecommitdiff
path: root/drivers/usb/dwc3
diff options
context:
space:
mode:
authorJanusz Dziedzic <januszx.dziedzic@linux.intel.com>2016-11-09 11:01:35 +0100
committerFelipe Balbi <felipe.balbi@linux.intel.com>2016-11-18 13:54:15 +0200
commitf2694a93e0df86e89a2d1743d413bf1bf5d2da50 (patch)
treed0b712eb3be0460ced434acfd2eed1d36b399e6a /drivers/usb/dwc3
parent87aba10639b083dacdd13b43557649b3d001c4b4 (diff)
usb: dwc3: warn on once when no trbs
Seems last time we hit few issues where we get trb_left = 0, mainly because of HWO bit still set in previous TRB. Add warn on once to catch/fix such problems much faster. Signed-off-by: Janusz Dziedzic <januszx.dziedzic@linux.intel.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers/usb/dwc3')
-rw-r--r--drivers/usb/dwc3/gadget.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 37d3de41123c..7e465ea6a211 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -937,6 +937,7 @@ static struct dwc3_trb *dwc3_ep_prev_trb(struct dwc3_ep *dep, u8 index)
static u32 dwc3_calc_trbs_left(struct dwc3_ep *dep)
{
struct dwc3_trb *tmp;
+ struct dwc3 *dwc = dep->dwc;
u8 trbs_left;
/*
@@ -948,7 +949,8 @@ static u32 dwc3_calc_trbs_left(struct dwc3_ep *dep)
*/
if (dep->trb_enqueue == dep->trb_dequeue) {
tmp = dwc3_ep_prev_trb(dep, dep->trb_enqueue);
- if (tmp->ctrl & DWC3_TRB_CTRL_HWO)
+ if (dev_WARN_ONCE(dwc->dev, tmp->ctrl & DWC3_TRB_CTRL_HWO,
+ "%s No TRBS left\n", dep->name))
return 0;
return DWC3_TRB_NUM - 1;