Commit 73815280 authored by Felipe Balbi's avatar Felipe Balbi

usb: dwc3: remove reliance on dev_vdbg()

By moving all dev_vdbg() to tracepoints, we
can finally get rid of dev_vdbg() usage from
dwc3.
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 6bac4ff0
...@@ -104,12 +104,6 @@ config USB_DWC3_DEBUG ...@@ -104,12 +104,6 @@ config USB_DWC3_DEBUG
help help
Say Y here to enable debugging messages on DWC3 Driver. Say Y here to enable debugging messages on DWC3 Driver.
config USB_DWC3_VERBOSE
bool "Enable Verbose Debugging Messages"
depends on USB_DWC3_DEBUG
help
Say Y here to enable verbose debugging messages on DWC3 Driver.
config DWC3_HOST_USB3_LPM_ENABLE config DWC3_HOST_USB3_LPM_ENABLE
bool "Enable USB3 LPM Capability" bool "Enable USB3 LPM Capability"
depends on USB_DWC3_HOST=y || USB_DWC3_DUAL_ROLE=y depends on USB_DWC3_HOST=y || USB_DWC3_DUAL_ROLE=y
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
CFLAGS_trace.o := -I$(src) CFLAGS_trace.o := -I$(src)
ccflags-$(CONFIG_USB_DWC3_DEBUG) := -DDEBUG ccflags-$(CONFIG_USB_DWC3_DEBUG) := -DDEBUG
ccflags-$(CONFIG_USB_DWC3_VERBOSE) += -DVERBOSE_DEBUG
obj-$(CONFIG_USB_DWC3) += dwc3.o obj-$(CONFIG_USB_DWC3) += dwc3.o
......
...@@ -345,7 +345,7 @@ static void dwc3_core_num_eps(struct dwc3 *dwc) ...@@ -345,7 +345,7 @@ static void dwc3_core_num_eps(struct dwc3 *dwc)
dwc->num_in_eps = DWC3_NUM_IN_EPS(parms); dwc->num_in_eps = DWC3_NUM_IN_EPS(parms);
dwc->num_out_eps = DWC3_NUM_EPS(parms) - dwc->num_in_eps; dwc->num_out_eps = DWC3_NUM_EPS(parms) - dwc->num_in_eps;
dev_vdbg(dwc->dev, "found %d IN and %d OUT endpoints\n", dwc3_trace(trace_dwc3_core, "found %d IN and %d OUT endpoints",
dwc->num_in_eps, dwc->num_out_eps); dwc->num_in_eps, dwc->num_out_eps);
} }
......
...@@ -139,7 +139,8 @@ int dwc3_gadget_set_link_state(struct dwc3 *dwc, enum dwc3_link_state state) ...@@ -139,7 +139,8 @@ int dwc3_gadget_set_link_state(struct dwc3 *dwc, enum dwc3_link_state state)
udelay(5); udelay(5);
} }
dev_vdbg(dwc->dev, "link state change request timed out\n"); dwc3_trace(trace_dwc3_gadget,
"link state change request timed out");
return -ETIMEDOUT; return -ETIMEDOUT;
} }
...@@ -219,7 +220,7 @@ int dwc3_gadget_resize_tx_fifos(struct dwc3 *dwc) ...@@ -219,7 +220,7 @@ int dwc3_gadget_resize_tx_fifos(struct dwc3 *dwc)
fifo_size |= (last_fifo_depth << 16); fifo_size |= (last_fifo_depth << 16);
dev_vdbg(dwc->dev, "%s: Fifo Addr %04x Size %d\n", dwc3_trace(trace_dwc3_gadget, "%s: Fifo Addr %04x Size %d",
dep->name, last_fifo_depth, fifo_size & 0xffff); dep->name, last_fifo_depth, fifo_size & 0xffff);
dwc3_writel(dwc->regs, DWC3_GTXFIFOSIZ(num), fifo_size); dwc3_writel(dwc->regs, DWC3_GTXFIFOSIZ(num), fifo_size);
...@@ -287,7 +288,8 @@ int dwc3_send_gadget_generic_command(struct dwc3 *dwc, unsigned cmd, u32 param) ...@@ -287,7 +288,8 @@ int dwc3_send_gadget_generic_command(struct dwc3 *dwc, unsigned cmd, u32 param)
do { do {
reg = dwc3_readl(dwc->regs, DWC3_DGCMD); reg = dwc3_readl(dwc->regs, DWC3_DGCMD);
if (!(reg & DWC3_DGCMD_CMDACT)) { if (!(reg & DWC3_DGCMD_CMDACT)) {
dev_vdbg(dwc->dev, "Command Complete --> %d\n", dwc3_trace(trace_dwc3_gadget,
"Command Complete --> %d",
DWC3_DGCMD_STATUS(reg)); DWC3_DGCMD_STATUS(reg));
return 0; return 0;
} }
...@@ -297,8 +299,11 @@ int dwc3_send_gadget_generic_command(struct dwc3 *dwc, unsigned cmd, u32 param) ...@@ -297,8 +299,11 @@ int dwc3_send_gadget_generic_command(struct dwc3 *dwc, unsigned cmd, u32 param)
* interrupt context. * interrupt context.
*/ */
timeout--; timeout--;
if (!timeout) if (!timeout) {
dwc3_trace(trace_dwc3_gadget,
"Command Timed Out");
return -ETIMEDOUT; return -ETIMEDOUT;
}
udelay(1); udelay(1);
} while (1); } while (1);
} }
...@@ -320,7 +325,8 @@ int dwc3_send_gadget_ep_cmd(struct dwc3 *dwc, unsigned ep, ...@@ -320,7 +325,8 @@ int dwc3_send_gadget_ep_cmd(struct dwc3 *dwc, unsigned ep,
do { do {
reg = dwc3_readl(dwc->regs, DWC3_DEPCMD(ep)); reg = dwc3_readl(dwc->regs, DWC3_DEPCMD(ep));
if (!(reg & DWC3_DEPCMD_CMDACT)) { if (!(reg & DWC3_DEPCMD_CMDACT)) {
dev_vdbg(dwc->dev, "Command Complete --> %d\n", dwc3_trace(trace_dwc3_gadget,
"Command Complete --> %d",
DWC3_DEPCMD_STATUS(reg)); DWC3_DEPCMD_STATUS(reg));
return 0; return 0;
} }
...@@ -330,8 +336,11 @@ int dwc3_send_gadget_ep_cmd(struct dwc3 *dwc, unsigned ep, ...@@ -330,8 +336,11 @@ int dwc3_send_gadget_ep_cmd(struct dwc3 *dwc, unsigned ep,
* interrupt context. * interrupt context.
*/ */
timeout--; timeout--;
if (!timeout) if (!timeout) {
dwc3_trace(trace_dwc3_gadget,
"Command Timed Out");
return -ETIMEDOUT; return -ETIMEDOUT;
}
udelay(1); udelay(1);
} while (1); } while (1);
...@@ -489,7 +498,7 @@ static int __dwc3_gadget_ep_enable(struct dwc3_ep *dep, ...@@ -489,7 +498,7 @@ static int __dwc3_gadget_ep_enable(struct dwc3_ep *dep,
u32 reg; u32 reg;
int ret; int ret;
dev_vdbg(dwc->dev, "Enabling %s\n", dep->name); dwc3_trace(trace_dwc3_gadget, "Enabling %s", dep->name);
if (!(dep->flags & DWC3_EP_ENABLED)) { if (!(dep->flags & DWC3_EP_ENABLED)) {
ret = dwc3_gadget_start_config(dwc, dep); ret = dwc3_gadget_start_config(dwc, dep);
...@@ -726,10 +735,9 @@ static void dwc3_prepare_one_trb(struct dwc3_ep *dep, ...@@ -726,10 +735,9 @@ static void dwc3_prepare_one_trb(struct dwc3_ep *dep,
struct dwc3_request *req, dma_addr_t dma, struct dwc3_request *req, dma_addr_t dma,
unsigned length, unsigned last, unsigned chain, unsigned node) unsigned length, unsigned last, unsigned chain, unsigned node)
{ {
struct dwc3 *dwc = dep->dwc;
struct dwc3_trb *trb; struct dwc3_trb *trb;
dev_vdbg(dwc->dev, "%s: req %p dma %08llx length %d%s%s\n", dwc3_trace(trace_dwc3_gadget, "%s: req %p dma %08llx length %d%s%s",
dep->name, req, (unsigned long long) dma, dep->name, req, (unsigned long long) dma,
length, last ? " last" : "", length, last ? " last" : "",
chain ? " chain" : ""); chain ? " chain" : "");
...@@ -931,7 +939,7 @@ static int __dwc3_gadget_kick_transfer(struct dwc3_ep *dep, u16 cmd_param, ...@@ -931,7 +939,7 @@ static int __dwc3_gadget_kick_transfer(struct dwc3_ep *dep, u16 cmd_param,
u32 cmd; u32 cmd;
if (start_new && (dep->flags & DWC3_EP_BUSY)) { if (start_new && (dep->flags & DWC3_EP_BUSY)) {
dev_vdbg(dwc->dev, "%s: endpoint busy\n", dep->name); dwc3_trace(trace_dwc3_gadget, "%s: endpoint busy", dep->name);
return -EBUSY; return -EBUSY;
} }
dep->flags &= ~DWC3_EP_PENDING_REQUEST; dep->flags &= ~DWC3_EP_PENDING_REQUEST;
...@@ -1002,7 +1010,8 @@ static void __dwc3_gadget_start_isoc(struct dwc3 *dwc, ...@@ -1002,7 +1010,8 @@ static void __dwc3_gadget_start_isoc(struct dwc3 *dwc,
u32 uf; u32 uf;
if (list_empty(&dep->request_list)) { if (list_empty(&dep->request_list)) {
dev_vdbg(dwc->dev, "ISOC ep %s run out for requests.\n", dwc3_trace(trace_dwc3_gadget,
"ISOC ep %s run out for requests",
dep->name); dep->name);
dep->flags |= DWC3_EP_PENDING_REQUEST; dep->flags |= DWC3_EP_PENDING_REQUEST;
return; return;
...@@ -1144,8 +1153,6 @@ static int dwc3_gadget_ep_queue(struct usb_ep *ep, struct usb_request *request, ...@@ -1144,8 +1153,6 @@ static int dwc3_gadget_ep_queue(struct usb_ep *ep, struct usb_request *request,
goto out; goto out;
} }
dev_vdbg(dwc->dev, "queing request %p to %s length %d\n",
request, ep->name, request->length);
trace_dwc3_ep_queue(req); trace_dwc3_ep_queue(req);
ret = __dwc3_gadget_ep_queue(dep, req); ret = __dwc3_gadget_ep_queue(dep, req);
...@@ -1460,7 +1467,7 @@ static int dwc3_gadget_run_stop(struct dwc3 *dwc, int is_on, int suspend) ...@@ -1460,7 +1467,7 @@ static int dwc3_gadget_run_stop(struct dwc3 *dwc, int is_on, int suspend)
udelay(1); udelay(1);
} while (1); } while (1);
dev_vdbg(dwc->dev, "gadget %s data soft-%s\n", dwc3_trace(trace_dwc3_gadget, "gadget %s data soft-%s",
dwc->gadget_driver dwc->gadget_driver
? dwc->gadget_driver->function : "no-function", ? dwc->gadget_driver->function : "no-function",
is_on ? "connect" : "disconnect"); is_on ? "connect" : "disconnect");
...@@ -1680,7 +1687,7 @@ static int dwc3_gadget_init_hw_endpoints(struct dwc3 *dwc, ...@@ -1680,7 +1687,7 @@ static int dwc3_gadget_init_hw_endpoints(struct dwc3 *dwc,
dep->endpoint.name = dep->name; dep->endpoint.name = dep->name;
dev_vdbg(dwc->dev, "initializing %s\n", dep->name); dwc3_trace(trace_dwc3_gadget, "initializing %s", dep->name);
if (epnum == 0 || epnum == 1) { if (epnum == 0 || epnum == 1) {
usb_ep_set_maxpacket_limit(&dep->endpoint, 512); usb_ep_set_maxpacket_limit(&dep->endpoint, 512);
...@@ -1717,13 +1724,15 @@ static int dwc3_gadget_init_endpoints(struct dwc3 *dwc) ...@@ -1717,13 +1724,15 @@ static int dwc3_gadget_init_endpoints(struct dwc3 *dwc)
ret = dwc3_gadget_init_hw_endpoints(dwc, dwc->num_out_eps, 0); ret = dwc3_gadget_init_hw_endpoints(dwc, dwc->num_out_eps, 0);
if (ret < 0) { if (ret < 0) {
dev_vdbg(dwc->dev, "failed to allocate OUT endpoints\n"); dwc3_trace(trace_dwc3_gadget,
"failed to allocate OUT endpoints");
return ret; return ret;
} }
ret = dwc3_gadget_init_hw_endpoints(dwc, dwc->num_in_eps, 1); ret = dwc3_gadget_init_hw_endpoints(dwc, dwc->num_in_eps, 1);
if (ret < 0) { if (ret < 0) {
dev_vdbg(dwc->dev, "failed to allocate IN endpoints\n"); dwc3_trace(trace_dwc3_gadget,
"failed to allocate IN endpoints");
return ret; return ret;
} }
...@@ -1969,7 +1978,7 @@ static void dwc3_endpoint_interrupt(struct dwc3 *dwc, ...@@ -1969,7 +1978,7 @@ static void dwc3_endpoint_interrupt(struct dwc3 *dwc,
} else { } else {
int ret; int ret;
dev_vdbg(dwc->dev, "%s: reason %s\n", dwc3_trace(trace_dwc3_gadget, "%s: reason %s",
dep->name, event->status & dep->name, event->status &
DEPEVT_STATUS_TRANSFER_ACTIVE DEPEVT_STATUS_TRANSFER_ACTIVE
? "Transfer Active" ? "Transfer Active"
...@@ -1993,7 +2002,8 @@ static void dwc3_endpoint_interrupt(struct dwc3 *dwc, ...@@ -1993,7 +2002,8 @@ static void dwc3_endpoint_interrupt(struct dwc3 *dwc,
switch (event->status) { switch (event->status) {
case DEPEVT_STREAMEVT_FOUND: case DEPEVT_STREAMEVT_FOUND:
dev_vdbg(dwc->dev, "Stream %d found and started\n", dwc3_trace(trace_dwc3_gadget,
"Stream %d found and started",
event->parameters); event->parameters);
break; break;
...@@ -2007,7 +2017,7 @@ static void dwc3_endpoint_interrupt(struct dwc3 *dwc, ...@@ -2007,7 +2017,7 @@ static void dwc3_endpoint_interrupt(struct dwc3 *dwc,
dev_dbg(dwc->dev, "%s FIFO Overrun\n", dep->name); dev_dbg(dwc->dev, "%s FIFO Overrun\n", dep->name);
break; break;
case DWC3_DEPEVT_EPCMDCMPLT: case DWC3_DEPEVT_EPCMDCMPLT:
dev_vdbg(dwc->dev, "Endpoint Command Complete\n"); dwc3_trace(trace_dwc3_gadget, "Endpoint Command Complete");
break; break;
} }
} }
...@@ -2381,7 +2391,8 @@ static void dwc3_gadget_linksts_change_interrupt(struct dwc3 *dwc, ...@@ -2381,7 +2391,8 @@ static void dwc3_gadget_linksts_change_interrupt(struct dwc3 *dwc,
(pwropt != DWC3_GHWPARAMS1_EN_PWROPT_HIB)) { (pwropt != DWC3_GHWPARAMS1_EN_PWROPT_HIB)) {
if ((dwc->link_state == DWC3_LINK_STATE_U3) && if ((dwc->link_state == DWC3_LINK_STATE_U3) &&
(next == DWC3_LINK_STATE_RESUME)) { (next == DWC3_LINK_STATE_RESUME)) {
dev_vdbg(dwc->dev, "ignoring transition U3 -> Resume\n"); dwc3_trace(trace_dwc3_gadget,
"ignoring transition U3 -> Resume");
return; return;
} }
} }
...@@ -2503,19 +2514,19 @@ static void dwc3_gadget_interrupt(struct dwc3 *dwc, ...@@ -2503,19 +2514,19 @@ static void dwc3_gadget_interrupt(struct dwc3 *dwc,
dwc3_gadget_linksts_change_interrupt(dwc, event->event_info); dwc3_gadget_linksts_change_interrupt(dwc, event->event_info);
break; break;
case DWC3_DEVICE_EVENT_EOPF: case DWC3_DEVICE_EVENT_EOPF:
dev_vdbg(dwc->dev, "End of Periodic Frame\n"); dwc3_trace(trace_dwc3_gadget, "End of Periodic Frame");
break; break;
case DWC3_DEVICE_EVENT_SOF: case DWC3_DEVICE_EVENT_SOF:
dev_vdbg(dwc->dev, "Start of Periodic Frame\n"); dwc3_trace(trace_dwc3_gadget, "Start of Periodic Frame");
break; break;
case DWC3_DEVICE_EVENT_ERRATIC_ERROR: case DWC3_DEVICE_EVENT_ERRATIC_ERROR:
dev_vdbg(dwc->dev, "Erratic Error\n"); dwc3_trace(trace_dwc3_gadget, "Erratic Error");
break; break;
case DWC3_DEVICE_EVENT_CMD_CMPL: case DWC3_DEVICE_EVENT_CMD_CMPL:
dev_vdbg(dwc->dev, "Command Complete\n"); dwc3_trace(trace_dwc3_gadget, "Command Complete");
break; break;
case DWC3_DEVICE_EVENT_OVERFLOW: case DWC3_DEVICE_EVENT_OVERFLOW:
dev_vdbg(dwc->dev, "Overflow\n"); dwc3_trace(trace_dwc3_gadget, "Overflow");
break; break;
default: default:
dev_WARN(dwc->dev, "UNKNOWN IRQ %d\n", event->type); dev_WARN(dwc->dev, "UNKNOWN IRQ %d\n", event->type);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment