Switch dev_dbg() to tracepoint debug musb_dbg(). Signed-off-by: Bin Liu <b-liu@xxxxxx> --- drivers/usb/musb/cppi_dma.c | 50 +++++++++-------- drivers/usb/musb/musb_core.c | 64 +++++++++++----------- drivers/usb/musb/musb_cppi41.c | 12 ++--- drivers/usb/musb/musb_gadget.c | 97 ++++++++++++++++----------------- drivers/usb/musb/musb_gadget_ep0.c | 22 ++++---- drivers/usb/musb/musb_host.c | 107 ++++++++++++++++++------------------- drivers/usb/musb/musb_virthub.c | 24 ++++----- drivers/usb/musb/musbhsdma.c | 10 ++-- 8 files changed, 187 insertions(+), 199 deletions(-) diff --git a/drivers/usb/musb/cppi_dma.c b/drivers/usb/musb/cppi_dma.c index cc13410..5da93ec 100644 --- a/drivers/usb/musb/cppi_dma.c +++ b/drivers/usb/musb/cppi_dma.c @@ -232,7 +232,7 @@ static void cppi_controller_stop(struct cppi *controller) musb_writel(tibase, DAVINCI_RXCPPI_INTCLR_REG, DAVINCI_DMA_ALL_CHANNELS_ENABLE); - dev_dbg(musb->controller, "Tearing down RX and TX Channels\n"); + musb_dbg(musb, "Tearing down RX and TX Channels"); for (i = 0; i < ARRAY_SIZE(controller->tx); i++) { /* FIXME restructure of txdma to use bds like rxdma */ controller->tx[i].last_processed = NULL; @@ -297,13 +297,13 @@ cppi_channel_allocate(struct dma_controller *c, */ if (transmit) { if (index >= ARRAY_SIZE(controller->tx)) { - dev_dbg(musb->controller, "no %cX%d CPPI channel\n", 'T', index); + musb_dbg(musb, "no %cX%d CPPI channel", 'T', index); return NULL; } cppi_ch = controller->tx + index; } else { if (index >= ARRAY_SIZE(controller->rx)) { - dev_dbg(musb->controller, "no %cX%d CPPI channel\n", 'R', index); + musb_dbg(musb, "no %cX%d CPPI channel", 'R', index); return NULL; } cppi_ch = controller->rx + index; @@ -314,13 +314,13 @@ cppi_channel_allocate(struct dma_controller *c, * with the other DMA engine too */ if (cppi_ch->hw_ep) - dev_dbg(musb->controller, "re-allocating DMA%d %cX channel %p\n", + musb_dbg(musb, "re-allocating DMA%d %cX channel %p", index, transmit ? 'T' : 'R', cppi_ch); cppi_ch->hw_ep = ep; cppi_ch->channel.status = MUSB_DMA_STATUS_FREE; cppi_ch->channel.max_len = 0x7fffffff; - dev_dbg(musb->controller, "Allocate CPPI%d %cX\n", index, transmit ? 'T' : 'R'); + musb_dbg(musb, "Allocate CPPI%d %cX", index, transmit ? 'T' : 'R'); return &cppi_ch->channel; } @@ -335,8 +335,8 @@ static void cppi_channel_release(struct dma_channel *channel) c = container_of(channel, struct cppi_channel, channel); tibase = c->controller->tibase; if (!c->hw_ep) - dev_dbg(c->controller->musb->controller, - "releasing idle DMA channel %p\n", c); + musb_dbg(c->controller->musb, + "releasing idle DMA channel %p", c); else if (!c->transmit) core_rxirq_enable(tibase, c->index + 1); @@ -354,11 +354,10 @@ cppi_dump_rx(int level, struct cppi_channel *c, const char *tag) musb_ep_select(base, c->index + 1); - dev_dbg(c->controller->musb->controller, + musb_dbg(c->controller->musb, "RX DMA%d%s: %d left, csr %04x, " "%08x H%08x S%08x C%08x, " - "B%08x L%08x %08x .. %08x" - "\n", + "B%08x L%08x %08x .. %08x", c->index, tag, musb_readl(c->controller->tibase, DAVINCI_RXCPPI_BUFCNT0_REG + 4 * c->index), @@ -385,11 +384,10 @@ cppi_dump_tx(int level, struct cppi_channel *c, const char *tag) musb_ep_select(base, c->index + 1); - dev_dbg(c->controller->musb->controller, + musb_dbg(c->controller->musb, "TX DMA%d%s: csr %04x, " "H%08x S%08x C%08x %08x, " - "F%08x L%08x .. %08x" - "\n", + "F%08x L%08x .. %08x", c->index, tag, musb_readw(c->hw_ep->regs, MUSB_TXCSR), @@ -590,7 +588,7 @@ cppi_next_tx_segment(struct musb *musb, struct cppi_channel *tx) length = min(n_bds * maxpacket, length); } - dev_dbg(musb->controller, "TX DMA%d, pktSz %d %s bds %d dma 0x%llx len %u\n", + musb_dbg(musb, "TX DMA%d, pktSz %d %s bds %d dma 0x%llx len %u", tx->index, maxpacket, rndis ? "rndis" : "transparent", @@ -647,7 +645,7 @@ cppi_next_tx_segment(struct musb *musb, struct cppi_channel *tx) bd->hw_options |= CPPI_ZERO_SET; } - dev_dbg(musb->controller, "TXBD %p: nxt %08x buf %08x len %04x opt %08x\n", + musb_dbg(musb, "TXBD %p: nxt %08x buf %08x len %04x opt %08x", bd, bd->hw_next, bd->hw_bufp, bd->hw_off_len, bd->hw_options); @@ -813,8 +811,8 @@ cppi_next_rx_segment(struct musb *musb, struct cppi_channel *rx, int onepacket) length = min(n_bds * maxpacket, length); - dev_dbg(musb->controller, "RX DMA%d seg, maxp %d %s bds %d (cnt %d) " - "dma 0x%llx len %u %u/%u\n", + musb_dbg(musb, "RX DMA%d seg, maxp %d %s bds %d (cnt %d) " + "dma 0x%llx len %u %u/%u", rx->index, maxpacket, onepacket ? (is_rndis ? "rndis" : "onepacket") @@ -924,7 +922,7 @@ cppi_next_rx_segment(struct musb *musb, struct cppi_channel *rx, int onepacket) DAVINCI_RXCPPI_BUFCNT0_REG + (rx->index * 4)) & 0xffff; if (i < (2 + n_bds)) { - dev_dbg(musb->controller, "bufcnt%d underrun - %d (for %d)\n", + musb_dbg(musb, "bufcnt%d underrun - %d (for %d)", rx->index, i, n_bds); musb_writel(tibase, DAVINCI_RXCPPI_BUFCNT0_REG + (rx->index * 4), @@ -973,7 +971,7 @@ static int cppi_channel_program(struct dma_channel *ch, /* WARN_ON(1); */ break; case MUSB_DMA_STATUS_UNKNOWN: - dev_dbg(musb->controller, "%cX DMA%d not allocated!\n", + musb_dbg(musb, "%cX DMA%d not allocated!", cppi_ch->transmit ? 'T' : 'R', cppi_ch->index); /* FALLTHROUGH */ @@ -1029,8 +1027,8 @@ static bool cppi_rx_scan(struct cppi *cppi, unsigned ch) if (!completed && (bd->hw_options & CPPI_OWN_SET)) break; - dev_dbg(musb->controller, "C/RXBD %llx: nxt %08x buf %08x " - "off.len %08x opt.len %08x (%d)\n", + musb_dbg(musb, "C/RXBD %llx: nxt %08x buf %08x " + "off.len %08x opt.len %08x (%d)", (unsigned long long)bd->dma, bd->hw_next, bd->hw_bufp, bd->hw_off_len, bd->hw_options, rx->channel.actual_len); @@ -1051,7 +1049,7 @@ static bool cppi_rx_scan(struct cppi *cppi, unsigned ch) * CPPI ignores those BDs even though OWN is still set. */ completed = true; - dev_dbg(musb->controller, "rx short %d/%d (%d)\n", + musb_dbg(musb, "rx short %d/%d (%d)", len, bd->buflen, rx->channel.actual_len); } @@ -1101,7 +1099,7 @@ static bool cppi_rx_scan(struct cppi *cppi, unsigned ch) musb_ep_select(cppi->mregs, rx->index + 1); csr = musb_readw(regs, MUSB_RXCSR); if (csr & MUSB_RXCSR_DMAENAB) { - dev_dbg(musb->controller, "list%d %p/%p, last %llx%s, csr %04x\n", + musb_dbg(musb, "list%d %p/%p, last %llx%s, csr %04x", rx->index, rx->head, rx->tail, rx->last_processed @@ -1164,7 +1162,7 @@ irqreturn_t cppi_interrupt(int irq, void *dev_id) return IRQ_NONE; } - dev_dbg(musb->controller, "CPPI IRQ Tx%x Rx%x\n", tx, rx); + musb_dbg(musb, "CPPI IRQ Tx%x Rx%x", tx, rx); /* process TX channels */ for (index = 0; tx; tx = tx >> 1, index++) { @@ -1192,7 +1190,7 @@ irqreturn_t cppi_interrupt(int irq, void *dev_id) * that needs to be acknowledged. */ if (NULL == bd) { - dev_dbg(musb->controller, "null BD\n"); + musb_dbg(musb, "null BD"); musb_writel(&tx_ram->tx_complete, 0, 0); continue; } @@ -1207,7 +1205,7 @@ irqreturn_t cppi_interrupt(int irq, void *dev_id) if (bd->hw_options & CPPI_OWN_SET) break; - dev_dbg(musb->controller, "C/TXBD %p n %x b %x off %x opt %x\n", + musb_dbg(musb, "C/TXBD %p n %x b %x off %x opt %x", bd, bd->hw_next, bd->hw_bufp, bd->hw_off_len, bd->hw_options); diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index 39fd958..1374c18 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c @@ -461,20 +461,21 @@ static void musb_otg_timer_func(unsigned long data) spin_lock_irqsave(&musb->lock, flags); switch (musb->xceiv->otg->state) { case OTG_STATE_B_WAIT_ACON: - dev_dbg(musb->controller, "HNP: b_wait_acon timeout; back to b_peripheral\n"); + musb_dbg(musb, + "HNP: b_wait_acon timeout; back to b_peripheral"); musb_g_disconnect(musb); musb->xceiv->otg->state = OTG_STATE_B_PERIPHERAL; musb->is_active = 0; break; case OTG_STATE_A_SUSPEND: case OTG_STATE_A_WAIT_BCON: - dev_dbg(musb->controller, "HNP: %s timeout\n", + musb_dbg(musb, "HNP: %s timeout", usb_otg_state_string(musb->xceiv->otg->state)); musb_platform_set_vbus(musb, 0); musb->xceiv->otg->state = OTG_STATE_A_WAIT_VFALL; break; default: - dev_dbg(musb->controller, "HNP: Unhandled mode %s\n", + musb_dbg(musb, "HNP: Unhandled mode %s", usb_otg_state_string(musb->xceiv->otg->state)); } spin_unlock_irqrestore(&musb->lock, flags); @@ -489,17 +490,17 @@ void musb_hnp_stop(struct musb *musb) void __iomem *mbase = musb->mregs; u8 reg; - dev_dbg(musb->controller, "HNP: stop from %s\n", + musb_dbg(musb, "HNP: stop from %s", usb_otg_state_string(musb->xceiv->otg->state)); switch (musb->xceiv->otg->state) { case OTG_STATE_A_PERIPHERAL: musb_g_disconnect(musb); - dev_dbg(musb->controller, "HNP: back to %s\n", + musb_dbg(musb, "HNP: back to %s", usb_otg_state_string(musb->xceiv->otg->state)); break; case OTG_STATE_B_HOST: - dev_dbg(musb->controller, "HNP: Disabling HR\n"); + musb_dbg(musb, "HNP: Disabling HR"); if (hcd) hcd->self.is_b_host = 0; musb->xceiv->otg->state = OTG_STATE_B_PERIPHERAL; @@ -510,7 +511,7 @@ void musb_hnp_stop(struct musb *musb) /* REVISIT: Start SESSION_REQUEST here? */ break; default: - dev_dbg(musb->controller, "HNP: Stopping in unknown state %s\n", + musb_dbg(musb, "HNP: Stopping in unknown state %s", usb_otg_state_string(musb->xceiv->otg->state)); } @@ -541,8 +542,7 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb, { irqreturn_t handled = IRQ_NONE; - dev_dbg(musb->controller, "<== DevCtl=%02x, int_usb=0x%x\n", devctl, - int_usb); + musb_dbg(musb, "<== DevCtl=%02x, int_usb=0x%x", devctl, int_usb); /* in host mode, the peripheral may issue remote wakeup. * in peripheral mode, the host may resume the link. @@ -550,7 +550,7 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb, */ if (int_usb & MUSB_INTR_RESUME) { handled = IRQ_HANDLED; - dev_dbg(musb->controller, "RESUME (%s)\n", + musb_dbg(musb, "RESUME (%s)", usb_otg_state_string(musb->xceiv->otg->state)); if (devctl & MUSB_DEVCTL_HM) { @@ -619,11 +619,11 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb, if ((devctl & MUSB_DEVCTL_VBUS) == MUSB_DEVCTL_VBUS && (devctl & MUSB_DEVCTL_BDEVICE)) { - dev_dbg(musb->controller, "SessReq while on B state\n"); + musb_dbg(musb, "SessReq while on B state"); return IRQ_HANDLED; } - dev_dbg(musb->controller, "SESSION_REQUEST (%s)\n", + musb_dbg(musb, "SESSION_REQUEST (%s)", usb_otg_state_string(musb->xceiv->otg->state)); /* IRQ arrives from ID pin sense or (later, if VBUS power @@ -714,7 +714,7 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb, } if (int_usb & MUSB_INTR_SUSPEND) { - dev_dbg(musb->controller, "SUSPEND (%s) devctl %02x\n", + musb_dbg(musb, "SUSPEND (%s) devctl %02x", usb_otg_state_string(musb->xceiv->otg->state), devctl); handled = IRQ_HANDLED; @@ -743,7 +743,7 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb, musb->is_active = musb->g.b_hnp_enable; if (musb->is_active) { musb->xceiv->otg->state = OTG_STATE_B_WAIT_ACON; - dev_dbg(musb->controller, "HNP: Setting timer for b_ase0_brst\n"); + musb_dbg(musb, "HNP: Setting timer for b_ase0_brst"); mod_timer(&musb->otg_timer, jiffies + msecs_to_jiffies( OTG_TIME_B_ASE0_BRST)); @@ -760,7 +760,7 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb, break; case OTG_STATE_B_HOST: /* Transition to B_PERIPHERAL, see 6.8.2.6 p 44 */ - dev_dbg(musb->controller, "REVISIT: SUSPEND as B_HOST\n"); + musb_dbg(musb, "REVISIT: SUSPEND as B_HOST"); break; default: /* "should not happen" */ @@ -797,14 +797,14 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb, switch (musb->xceiv->otg->state) { case OTG_STATE_B_PERIPHERAL: if (int_usb & MUSB_INTR_SUSPEND) { - dev_dbg(musb->controller, "HNP: SUSPEND+CONNECT, now b_host\n"); + musb_dbg(musb, "HNP: SUSPEND+CONNECT, now b_host"); int_usb &= ~MUSB_INTR_SUSPEND; goto b_host; } else - dev_dbg(musb->controller, "CONNECT as b_peripheral???\n"); + musb_dbg(musb, "CONNECT as b_peripheral???"); break; case OTG_STATE_B_WAIT_ACON: - dev_dbg(musb->controller, "HNP: CONNECT, now b_host\n"); + musb_dbg(musb, "HNP: CONNECT, now b_host"); b_host: musb->xceiv->otg->state = OTG_STATE_B_HOST; if (musb->hcd) @@ -823,12 +823,12 @@ b_host: musb_host_poke_root_hub(musb); - dev_dbg(musb->controller, "CONNECT (%s) devctl %02x\n", + musb_dbg(musb, "CONNECT (%s) devctl %02x", usb_otg_state_string(musb->xceiv->otg->state), devctl); } if (int_usb & MUSB_INTR_DISCONNECT) { - dev_dbg(musb->controller, "DISCONNECT (%s) as %s, devctl %02x\n", + musb_dbg(musb, "DISCONNECT (%s) as %s, devctl %02x", usb_otg_state_string(musb->xceiv->otg->state), MUSB_MODE(musb), devctl); handled = IRQ_HANDLED; @@ -891,7 +891,7 @@ b_host: if (is_host_active(musb)) musb_recover_from_babble(musb); } else { - dev_dbg(musb->controller, "BUS RESET as %s\n", + musb_dbg(musb, "BUS RESET as %s", usb_otg_state_string(musb->xceiv->otg->state)); switch (musb->xceiv->otg->state) { case OTG_STATE_A_SUSPEND: @@ -899,7 +899,7 @@ b_host: /* FALLTHROUGH */ case OTG_STATE_A_WAIT_BCON: /* OPT TD.4.7-900ms */ /* never use invalid T(a_wait_bcon) */ - dev_dbg(musb->controller, "HNP: in %s, %d msec timeout\n", + musb_dbg(musb, "HNP: in %s, %d msec timeout", usb_otg_state_string(musb->xceiv->otg->state), TA_WAIT_BCON(musb)); mod_timer(&musb->otg_timer, jiffies @@ -910,7 +910,7 @@ b_host: musb_g_reset(musb); break; case OTG_STATE_B_WAIT_ACON: - dev_dbg(musb->controller, "HNP: RESET (%s), to b_peripheral\n", + musb_dbg(musb, "HNP: RESET (%s), to b_peripheral", usb_otg_state_string(musb->xceiv->otg->state)); musb->xceiv->otg->state = OTG_STATE_B_PERIPHERAL; musb_g_reset(musb); @@ -922,7 +922,7 @@ b_host: musb_g_reset(musb); break; default: - dev_dbg(musb->controller, "Unhandled BUS RESET as %s\n", + musb_dbg(musb, "Unhandled BUS RESET as %s", usb_otg_state_string(musb->xceiv->otg->state)); } } @@ -1030,7 +1030,7 @@ void musb_start(struct musb *musb) u8 devctl = musb_readb(regs, MUSB_DEVCTL); u8 power; - dev_dbg(musb->controller, "<== devctl %02x\n", devctl); + musb_dbg(musb, "<== devctl %02x", devctl); musb_enable_interrupts(musb); musb_writeb(regs, MUSB_TESTMODE, 0); @@ -1078,7 +1078,7 @@ void musb_stop(struct musb *musb) /* stop IRQs, timers, ... */ musb_platform_disable(musb); musb_generic_disable(musb); - dev_dbg(musb->controller, "HDRC disabled\n"); + musb_dbg(musb, "HDRC disabled"); /* FIXME * - mark host and/or peripheral drivers unusable/inactive @@ -1414,7 +1414,7 @@ static int ep_config_from_hw(struct musb *musb) void __iomem *mbase = musb->mregs; int ret = 0; - dev_dbg(musb->controller, "<== static silicon ep config\n"); + musb_dbg(musb, "<== static silicon ep config"); /* FIXME pick up ep0 maxpacket size */ @@ -1555,8 +1555,7 @@ static int musb_core_init(u16 musb_type, struct musb *musb) hw_ep->tx_reinit = 1; if (hw_ep->max_packet_sz_tx) { - dev_dbg(musb->controller, - "%s: hw_ep %d%s, %smax %d\n", + musb_dbg(musb, "%s: hw_ep %d%s, %smax %d", musb_driver_name, i, hw_ep->is_shared_fifo ? "shared" : "tx", hw_ep->tx_double_buffered @@ -1564,8 +1563,7 @@ static int musb_core_init(u16 musb_type, struct musb *musb) hw_ep->max_packet_sz_tx); } if (hw_ep->max_packet_sz_rx && !hw_ep->is_shared_fifo) { - dev_dbg(musb->controller, - "%s: hw_ep %d%s, %smax %d\n", + musb_dbg(musb, "%s: hw_ep %d%s, %smax %d", musb_driver_name, i, "rx", hw_ep->rx_double_buffered @@ -1573,7 +1571,7 @@ static int musb_core_init(u16 musb_type, struct musb *musb) hw_ep->max_packet_sz_rx); } if (!(hw_ep->max_packet_sz_tx || hw_ep->max_packet_sz_rx)) - dev_dbg(musb->controller, "hw_ep %d not configured\n", i); + musb_dbg(musb, "hw_ep %d not configured", i); } return 0; @@ -1998,7 +1996,7 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) * Fail when the board needs a feature that's not enabled. */ if (!plat) { - dev_dbg(dev, "no platform_data?\n"); + dev_err(dev, "no platform_data?\n"); status = -ENODEV; goto fail0; } diff --git a/drivers/usb/musb/musb_cppi41.c b/drivers/usb/musb/musb_cppi41.c index e499b86..f7bad72 100644 --- a/drivers/usb/musb/musb_cppi41.c +++ b/drivers/usb/musb/musb_cppi41.c @@ -96,8 +96,8 @@ static void update_rx_toggle(struct cppi41_dma_channel *cppi41_channel) if (!toggle && toggle == cppi41_channel->usb_toggle) { csr |= MUSB_RXCSR_H_DATATOGGLE | MUSB_RXCSR_H_WR_DATATOGGLE; musb_writew(cppi41_channel->hw_ep->regs, MUSB_RXCSR, csr); - dev_dbg(cppi41_channel->controller->musb->controller, - "Restoring DATA1 toggle.\n"); + musb_dbg(cppi41_channel->controller->musb, + "Restoring DATA1 toggle."); } cppi41_channel->usb_toggle = toggle; @@ -240,7 +240,7 @@ static void cppi41_dma_callback(void *private_data) transferred = cppi41_channel->prog_len - txstate.residue; cppi41_channel->transferred += transferred; - dev_dbg(musb->controller, "DMA transfer done on hw_ep=%d bytes=%d/%d\n", + musb_dbg(musb, "DMA transfer done on hw_ep=%d bytes=%d/%d", hw_ep->epnum, cppi41_channel->transferred, cppi41_channel->total_len); @@ -374,8 +374,8 @@ static bool cppi41_configure_channel(struct dma_channel *channel, struct musb *musb = cppi41_channel->controller->musb; unsigned use_gen_rndis = 0; - dev_dbg(musb->controller, - "configure ep%d/%x packet_sz=%d, mode=%d, dma_addr=0x%llx, len=%d is_tx=%d\n", + musb_dbg(musb, + "configure ep%d/%x packet_sz=%d, mode=%d, dma_addr=0x%llx, len=%d is_tx=%d", cppi41_channel->port_num, RNDIS_REG(cppi41_channel->port_num), packet_sz, mode, (unsigned long long) dma_addr, len, cppi41_channel->is_tx); @@ -537,7 +537,7 @@ static int cppi41_dma_channel_abort(struct dma_channel *channel) u16 csr; is_tx = cppi41_channel->is_tx; - dev_dbg(musb->controller, "abort channel=%d, is_tx=%d\n", + musb_dbg(musb, "abort channel=%d, is_tx=%d", cppi41_channel->port_num, is_tx); if (cppi41_channel->channel.status == MUSB_DMA_STATUS_FREE) diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c index 152865b..6aa909c 100644 --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c @@ -168,11 +168,11 @@ __acquires(ep->musb->lock) unmap_dma_buffer(req, musb); if (request->status == 0) - dev_dbg(musb->controller, "%s done request %p, %d/%d\n", + musb_dbg(musb, "%s done request %p, %d/", ep->end_point.name, request, req->request.actual, req->request.length); else - dev_dbg(musb->controller, "%s request %p, %d/%d fault %d\n", + musb_dbg(musb, "%s request %p, %d/%d fault %d", ep->end_point.name, request, req->request.actual, req->request.length, request->status); @@ -217,8 +217,7 @@ static void nuke(struct musb_ep *ep, const int status) } value = c->channel_abort(ep->dma); - dev_dbg(musb->controller, "%s: abort DMA --> %d\n", - ep->name, value); + musb_dbg(musb, "%s: abort DMA --> %d", ep->name, value); c->channel_release(ep->dma); ep->dma = NULL; } @@ -266,14 +265,14 @@ static void txstate(struct musb *musb, struct musb_request *req) /* Check if EP is disabled */ if (!musb_ep->desc) { - dev_dbg(musb->controller, "ep:%s disabled - ignore request\n", + musb_dbg(musb, "ep:%s disabled - ignore request", musb_ep->end_point.name); return; } /* we shouldn't get here while DMA is active ... but we do ... */ if (dma_channel_status(musb_ep->dma) == MUSB_DMA_STATUS_BUSY) { - dev_dbg(musb->controller, "dma pending...\n"); + musb_dbg(musb, "dma pending..."); return; } @@ -285,18 +284,18 @@ static void txstate(struct musb *musb, struct musb_request *req) (int)(request->length - request->actual)); if (csr & MUSB_TXCSR_TXPKTRDY) { - dev_dbg(musb->controller, "%s old packet still ready , txcsr %03x\n", + musb_dbg(musb, "%s old packet still ready , txcsr %03x", musb_ep->end_point.name, csr); return; } if (csr & MUSB_TXCSR_P_SENDSTALL) { - dev_dbg(musb->controller, "%s stalling, txcsr %03x\n", + musb_dbg(musb, "%s stalling, txcsr %03x", musb_ep->end_point.name, csr); return; } - dev_dbg(musb->controller, "hw_ep%d, maxpacket %d, fifo count %d, txcsr %03x\n", + musb_dbg(musb, "hw_ep%d, maxpacket %d, fifo count %d, txcsr %03x", epnum, musb_ep->packet_sz, fifo_count, csr); @@ -424,7 +423,7 @@ static void txstate(struct musb *musb, struct musb_request *req) } /* host may already have the data when this message shows... */ - dev_dbg(musb->controller, "%s TX/IN %s len %d/%d, txcsr %04x, fifo %d/%d\n", + musb_dbg(musb, "%s TX/IN %s len %d/%d, txcsr %04x, fifo %d/%d", musb_ep->end_point.name, use_dma ? "dma" : "pio", request->actual, request->length, musb_readw(epio, MUSB_TXCSR), @@ -451,7 +450,7 @@ void musb_g_tx(struct musb *musb, u8 epnum) request = &req->request; csr = musb_readw(epio, MUSB_TXCSR); - dev_dbg(musb->controller, "<== %s, txcsr %04x\n", musb_ep->end_point.name, csr); + musb_dbg(musb, "<== %s, txcsr %04x", musb_ep->end_point.name, csr); dma = is_dma_capable() ? musb_ep->dma : NULL; @@ -480,7 +479,7 @@ void musb_g_tx(struct musb *musb, u8 epnum) * SHOULD NOT HAPPEN... has with CPPI though, after * changing SENDSTALL (and other cases); harmless? */ - dev_dbg(musb->controller, "%s dma still busy?\n", musb_ep->end_point.name); + musb_dbg(musb, "%s dma still busy?", musb_ep->end_point.name); return; } @@ -497,7 +496,7 @@ void musb_g_tx(struct musb *musb, u8 epnum) /* Ensure writebuffer is empty. */ csr = musb_readw(epio, MUSB_TXCSR); request->actual += musb_ep->dma->actual_len; - dev_dbg(musb->controller, "TXCSR%d %04x, DMA off, len %zu, req %p\n", + musb_dbg(musb, "TXCSR%d %04x, DMA off, len %zu, req %p", epnum, csr, musb_ep->dma->actual_len, request); } @@ -524,7 +523,6 @@ void musb_g_tx(struct musb *musb, u8 epnum) if (csr & MUSB_TXCSR_TXPKTRDY) return; - dev_dbg(musb->controller, "sending zero pkt\n"); musb_writew(epio, MUSB_TXCSR, MUSB_TXCSR_MODE | MUSB_TXCSR_TXPKTRDY); request->zero = 0; @@ -543,7 +541,7 @@ void musb_g_tx(struct musb *musb, u8 epnum) musb_ep_select(mbase, epnum); req = musb_ep->desc ? next_request(musb_ep) : NULL; if (!req) { - dev_dbg(musb->controller, "%s idle now\n", + musb_dbg(musb, "%s idle now", musb_ep->end_point.name); return; } @@ -579,19 +577,19 @@ static void rxstate(struct musb *musb, struct musb_request *req) /* Check if EP is disabled */ if (!musb_ep->desc) { - dev_dbg(musb->controller, "ep:%s disabled - ignore request\n", + musb_dbg(musb, "ep:%s disabled - ignore request", musb_ep->end_point.name); return; } /* We shouldn't get here while DMA is active, but we do... */ if (dma_channel_status(musb_ep->dma) == MUSB_DMA_STATUS_BUSY) { - dev_dbg(musb->controller, "DMA pending...\n"); + musb_dbg(musb, "DMA pending..."); return; } if (csr & MUSB_RXCSR_P_SENDSTALL) { - dev_dbg(musb->controller, "%s stalling, RXCSR %04x\n", + musb_dbg(musb, "%s stalling, RXCSR %04x", musb_ep->end_point.name, csr); return; } @@ -766,7 +764,7 @@ static void rxstate(struct musb *musb, struct musb_request *req) } len = request->length - request->actual; - dev_dbg(musb->controller, "%s OUT/RX pio fifo %d/%d, maxpacket %d\n", + musb_dbg(musb, "%s OUT/RX pio fifo %d/%d, maxpacket %d", musb_ep->end_point.name, fifo_count, len, musb_ep->packet_sz); @@ -854,7 +852,7 @@ void musb_g_rx(struct musb *musb, u8 epnum) csr = musb_readw(epio, MUSB_RXCSR); dma = is_dma_capable() ? musb_ep->dma : NULL; - dev_dbg(musb->controller, "<== %s, rxcsr %04x%s %p\n", musb_ep->end_point.name, + musb_dbg(musb, "<== %s, rxcsr %04x%s %p", musb_ep->end_point.name, csr, dma ? " (dma)" : "", request); if (csr & MUSB_RXCSR_P_SENTSTALL) { @@ -869,18 +867,18 @@ void musb_g_rx(struct musb *musb, u8 epnum) csr &= ~MUSB_RXCSR_P_OVERRUN; musb_writew(epio, MUSB_RXCSR, csr); - dev_dbg(musb->controller, "%s iso overrun on %p\n", musb_ep->name, request); + musb_dbg(musb, "%s iso overrun on %p", musb_ep->name, request); if (request->status == -EINPROGRESS) request->status = -EOVERFLOW; } if (csr & MUSB_RXCSR_INCOMPRX) { /* REVISIT not necessarily an error */ - dev_dbg(musb->controller, "%s, incomprx\n", musb_ep->end_point.name); + musb_dbg(musb, "%s, incomprx", musb_ep->end_point.name); } if (dma_channel_status(dma) == MUSB_DMA_STATUS_BUSY) { /* "should not happen"; likely RXPKTRDY pending for DMA */ - dev_dbg(musb->controller, "%s busy, csr %04x\n", + musb_dbg(musb, "%s busy, csr %04x", musb_ep->end_point.name, csr); return; } @@ -894,7 +892,7 @@ void musb_g_rx(struct musb *musb, u8 epnum) request->actual += musb_ep->dma->actual_len; - dev_dbg(musb->controller, "RXCSR%d %04x, dma off, %04x, len %zu, req %p\n", + musb_dbg(musb, "RXCSR%d %04x, dma off, %04x, len %zu, req %p", epnum, csr, musb_readw(epio, MUSB_RXCSR), musb_ep->dma->actual_len, request); @@ -996,7 +994,7 @@ static int musb_gadget_enable(struct usb_ep *ep, ok = musb->hb_iso_rx; if (!ok) { - dev_dbg(musb->controller, "no support for high bandwidth ISO\n"); + musb_dbg(musb, "no support for high bandwidth ISO"); goto fail; } musb_ep->hb_mult = (tmp >> 11) & 3; @@ -1019,7 +1017,7 @@ static int musb_gadget_enable(struct usb_ep *ep, goto fail; if (tmp > hw_ep->max_packet_sz_tx) { - dev_dbg(musb->controller, "packet size beyond hardware FIFO size\n"); + musb_dbg(musb, "packet size beyond hardware FIFO size"); goto fail; } @@ -1062,7 +1060,7 @@ static int musb_gadget_enable(struct usb_ep *ep, goto fail; if (tmp > hw_ep->max_packet_sz_rx) { - dev_dbg(musb->controller, "packet size beyond hardware FIFO size\n"); + musb_dbg(musb, "packet size beyond hardware FIFO size"); goto fail; } @@ -1174,7 +1172,7 @@ static int musb_gadget_disable(struct usb_ep *ep) spin_unlock_irqrestore(&(musb->lock), flags); - dev_dbg(musb->controller, "%s\n", musb_ep->end_point.name); + musb_dbg(musb, "%s", musb_ep->end_point.name); return status; } @@ -1186,14 +1184,11 @@ static int musb_gadget_disable(struct usb_ep *ep) struct usb_request *musb_alloc_request(struct usb_ep *ep, gfp_t gfp_flags) { struct musb_ep *musb_ep = to_musb_ep(ep); - struct musb *musb = musb_ep->musb; struct musb_request *request = NULL; request = kzalloc(sizeof *request, gfp_flags); - if (!request) { - dev_dbg(musb->controller, "not enough memory\n"); + if (!request) return NULL; - } request->request.dma = DMA_ADDR_INVALID; request->epnum = musb_ep->current_epnum; @@ -1225,7 +1220,7 @@ struct free_record { */ void musb_ep_restart(struct musb *musb, struct musb_request *req) { - dev_dbg(musb->controller, "<== %s request %p len %u on hw_ep%d\n", + musb_dbg(musb, "<== %s request %p len %u on hw_ep%d", req->tx ? "TX/IN" : "RX/OUT", &req->request, req->request.length, req->epnum); @@ -1259,7 +1254,7 @@ static int musb_gadget_queue(struct usb_ep *ep, struct usb_request *req, if (request->ep != musb_ep) return -EINVAL; - dev_dbg(musb->controller, "<== to %s request=%p\n", ep->name, req); + musb_dbg(musb, "<== to %s request=%p", ep->name, req); /* request is mine now... */ request->request.actual = 0; @@ -1273,7 +1268,7 @@ static int musb_gadget_queue(struct usb_ep *ep, struct usb_request *req, /* don't queue if the ep is down */ if (!musb_ep->desc) { - dev_dbg(musb->controller, "req %p queued to %s while ep %s\n", + musb_dbg(musb, "req %p queued to %s while ep %s", req, ep->name, "disabled"); status = -ESHUTDOWN; unmap_dma_buffer(request, musb); @@ -1311,7 +1306,8 @@ static int musb_gadget_dequeue(struct usb_ep *ep, struct usb_request *request) break; } if (r != req) { - dev_dbg(musb->controller, "request %p not queued to %s\n", request, ep->name); + dev_err(musb->controller, "request %p not queued to %s\n", + request, ep->name); status = -EINVAL; goto done; } @@ -1377,7 +1373,7 @@ static int musb_gadget_set_halt(struct usb_ep *ep, int value) request = next_request(musb_ep); if (value) { if (request) { - dev_dbg(musb->controller, "request in progress, cannot halt %s\n", + musb_dbg(musb, "request in progress, cannot halt %s", ep->name); status = -EAGAIN; goto done; @@ -1386,7 +1382,8 @@ static int musb_gadget_set_halt(struct usb_ep *ep, int value) if (musb_ep->is_in) { csr = musb_readw(epio, MUSB_TXCSR); if (csr & MUSB_TXCSR_FIFONOTEMPTY) { - dev_dbg(musb->controller, "FIFO busy, cannot halt %s\n", ep->name); + musb_dbg(musb, "FIFO busy, cannot halt %s", + ep->name); status = -EAGAIN; goto done; } @@ -1395,7 +1392,7 @@ static int musb_gadget_set_halt(struct usb_ep *ep, int value) musb_ep->wedged = 0; /* set/clear the stall and toggle bits */ - dev_dbg(musb->controller, "%s: %s stall\n", ep->name, value ? "set" : "clear"); + musb_dbg(musb, "%s: %s stall", ep->name, value ? "set" : "clear"); if (musb_ep->is_in) { csr = musb_readw(epio, MUSB_TXCSR); csr |= MUSB_TXCSR_P_WZC_BITS @@ -1422,7 +1419,7 @@ static int musb_gadget_set_halt(struct usb_ep *ep, int value) /* maybe start the first request in the queue */ if (!musb_ep->busy && !value && request) { - dev_dbg(musb->controller, "restarting the request\n"); + musb_dbg(musb, "restarting the request"); musb_ep_restart(musb, request); } @@ -1558,7 +1555,7 @@ static int musb_gadget_wakeup(struct usb_gadget *gadget) case OTG_STATE_B_IDLE: /* Start SRP ... OTG not required. */ devctl = musb_readb(mregs, MUSB_DEVCTL); - dev_dbg(musb->controller, "Sending SRP: devctl: %02x\n", devctl); + musb_dbg(musb, "Sending SRP: devctl: %02x", devctl); devctl |= MUSB_DEVCTL_SESSION; musb_writeb(mregs, MUSB_DEVCTL, devctl); devctl = musb_readb(mregs, MUSB_DEVCTL); @@ -1586,7 +1583,7 @@ static int musb_gadget_wakeup(struct usb_gadget *gadget) status = 0; goto done; default: - dev_dbg(musb->controller, "Unhandled wake: %s\n", + musb_dbg(musb, "Unhandled wake: %s", usb_otg_state_string(musb->xceiv->otg->state)); goto done; } @@ -1596,7 +1593,7 @@ static int musb_gadget_wakeup(struct usb_gadget *gadget) power = musb_readb(mregs, MUSB_POWER); power |= MUSB_POWER_RESUME; musb_writeb(mregs, MUSB_POWER, power); - dev_dbg(musb->controller, "issue wakeup\n"); + musb_dbg(musb, "issue wakeup"); /* FIXME do this next chunk in a timer callback, no udelay */ mdelay(2); @@ -1628,7 +1625,7 @@ static void musb_pullup(struct musb *musb, int is_on) /* FIXME if on, HdrcStart; if off, HdrcStop */ - dev_dbg(musb->controller, "gadget D+ pullup %s\n", + musb_dbg(musb, "gadget D+ pullup %s", is_on ? "on" : "off"); musb_writeb(musb->mregs, MUSB_POWER, power); } @@ -1636,7 +1633,7 @@ static void musb_pullup(struct musb *musb, int is_on) #if 0 static int musb_gadget_vbus_session(struct usb_gadget *gadget, int is_active) { - dev_dbg(musb->controller, "<= %s =>\n", __func__); + musb_dbg(musb, "<= %s =>\n", __func__); /* * FIXME iff driver's softconnect flag is set (as it is during probe, @@ -1999,7 +1996,7 @@ void musb_g_suspend(struct musb *musb) u8 devctl; devctl = musb_readb(musb->mregs, MUSB_DEVCTL); - dev_dbg(musb->controller, "devctl %02x\n", devctl); + musb_dbg(musb, "musb_g_suspend: devctl %02x", devctl); switch (musb->xceiv->otg->state) { case OTG_STATE_B_IDLE: @@ -2018,7 +2015,7 @@ void musb_g_suspend(struct musb *musb) /* REVISIT if B_HOST, clear DEVCTL.HOSTREQ; * A_PERIPHERAL may need care too */ - WARNING("unhandled SUSPEND transition (%s)\n", + WARNING("unhandled SUSPEND transition (%s)", usb_otg_state_string(musb->xceiv->otg->state)); } } @@ -2035,7 +2032,7 @@ void musb_g_disconnect(struct musb *musb) void __iomem *mregs = musb->mregs; u8 devctl = musb_readb(mregs, MUSB_DEVCTL); - dev_dbg(musb->controller, "devctl %02x\n", devctl); + musb_dbg(musb, "musb_g_disconnect: devctl %02x", devctl); /* clear HR */ musb_writeb(mregs, MUSB_DEVCTL, devctl & MUSB_DEVCTL_SESSION); @@ -2052,7 +2049,7 @@ void musb_g_disconnect(struct musb *musb) switch (musb->xceiv->otg->state) { default: - dev_dbg(musb->controller, "Unhandled disconnect %s, setting a_idle\n", + musb_dbg(musb, "Unhandled disconnect %s, setting a_idle", usb_otg_state_string(musb->xceiv->otg->state)); musb->xceiv->otg->state = OTG_STATE_A_IDLE; MUSB_HST_MODE(musb); @@ -2082,7 +2079,7 @@ __acquires(musb->lock) u8 devctl = musb_readb(mbase, MUSB_DEVCTL); u8 power; - dev_dbg(musb->controller, "<== %s driver '%s'\n", + musb_dbg(musb, "<== %s driver '%s'", (devctl & MUSB_DEVCTL_BDEVICE) ? "B-Device" : "A-Device", musb->gadget_driver diff --git a/drivers/usb/musb/musb_gadget_ep0.c b/drivers/usb/musb/musb_gadget_ep0.c index 10d30af..844a309 100644 --- a/drivers/usb/musb/musb_gadget_ep0.c +++ b/drivers/usb/musb/musb_gadget_ep0.c @@ -206,7 +206,7 @@ static inline void musb_try_b_hnp_enable(struct musb *musb) void __iomem *mbase = musb->mregs; u8 devctl; - dev_dbg(musb->controller, "HNP: Setting HR\n"); + musb_dbg(musb, "HNP: Setting HR"); devctl = musb_readb(mbase, MUSB_DEVCTL); musb_writeb(mbase, MUSB_DEVCTL, devctl | MUSB_DEVCTL_HR); } @@ -303,7 +303,7 @@ __acquires(musb->lock) /* Maybe start the first request in the queue */ request = next_request(musb_ep); if (!musb_ep->busy && request) { - dev_dbg(musb->controller, "restarting the request\n"); + musb_dbg(musb, "restarting the request"); musb_ep_restart(musb, request); } @@ -550,7 +550,7 @@ static void ep0_txstate(struct musb *musb) if (!req) { /* WARN_ON(1); */ - dev_dbg(musb->controller, "odd; csr0 %04x\n", musb_readw(regs, MUSB_CSR0)); + musb_dbg(musb, "odd; csr0 %04x", musb_readw(regs, MUSB_CSR0)); return; } @@ -607,7 +607,7 @@ musb_read_setup(struct musb *musb, struct usb_ctrlrequest *req) /* NOTE: earlier 2.6 versions changed setup packets to host * order, but now USB packets always stay in USB byte order. */ - dev_dbg(musb->controller, "SETUP req%02x.%02x v%04x i%04x l%d\n", + musb_dbg(musb, "SETUP req%02x.%02x v%04x i%04x l%d", req->bRequestType, req->bRequest, le16_to_cpu(req->wValue), @@ -675,7 +675,7 @@ irqreturn_t musb_g_ep0_irq(struct musb *musb) csr = musb_readw(regs, MUSB_CSR0); len = musb_readb(regs, MUSB_COUNT0); - dev_dbg(musb->controller, "csr %04x, count %d, ep0stage %s\n", + musb_dbg(musb, "csr %04x, count %d, ep0stage %s", csr, len, decode_ep0stage(musb->ep0_state)); if (csr & MUSB_CSR0_P_DATAEND) { @@ -752,7 +752,7 @@ irqreturn_t musb_g_ep0_irq(struct musb *musb) /* enter test mode if needed (exit by reset) */ else if (musb->test_mode) { - dev_dbg(musb->controller, "entering TESTMODE\n"); + musb_dbg(musb, "entering TESTMODE"); if (MUSB_TEST_PACKET == musb->test_mode_nr) musb_load_testpacket(musb); @@ -864,7 +864,7 @@ setup: break; } - dev_dbg(musb->controller, "handled %d, csr %04x, ep0stage %s\n", + musb_dbg(musb, "handled %d, csr %04x, ep0stage %s", handled, csr, decode_ep0stage(musb->ep0_state)); @@ -881,7 +881,7 @@ setup: if (handled < 0) { musb_ep_select(mbase, 0); stall: - dev_dbg(musb->controller, "stall (%d)\n", handled); + musb_dbg(musb, "stall (%d)", handled); musb->ackpend |= MUSB_CSR0_P_SENDSTALL; musb->ep0_state = MUSB_EP0_STAGE_IDLE; finish: @@ -961,7 +961,7 @@ musb_g_ep0_queue(struct usb_ep *e, struct usb_request *r, gfp_t gfp_flags) status = 0; break; default: - dev_dbg(musb->controller, "ep0 request queued in state %d\n", + musb_dbg(musb, "ep0 request queued in state %d", musb->ep0_state); status = -EINVAL; goto cleanup; @@ -970,7 +970,7 @@ musb_g_ep0_queue(struct usb_ep *e, struct usb_request *r, gfp_t gfp_flags) /* add request to the list */ list_add_tail(&req->list, &ep->req_list); - dev_dbg(musb->controller, "queue to %s (%s), length=%d\n", + musb_dbg(musb, "queue to %s (%s), length=%d", ep->name, ep->is_in ? "IN/TX" : "OUT/RX", req->request.length); @@ -1063,7 +1063,7 @@ static int musb_g_ep0_halt(struct usb_ep *e, int value) musb->ackpend = 0; break; default: - dev_dbg(musb->controller, "ep0 can't halt in state %d\n", musb->ep0_state); + musb_dbg(musb, "ep0 can't halt in state %d", musb->ep0_state); status = -EINVAL; } diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c index 2f8ad7f..9496f55 100644 --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c @@ -131,7 +131,7 @@ static void musb_h_tx_flush_fifo(struct musb_hw_ep *ep) * I found using a usb-ethernet device and running iperf * (client on AM335x) has very high chance to trigger it. * - * Better to turn on dev_dbg() in musb_cleanup_urb() with + * Better to turn on musb_dbg() in musb_cleanup_urb() with * CPPI enabled to see the issue when aborting the tx channel. */ if (dev_WARN_ONCE(musb->controller, retries-- < 1, @@ -254,7 +254,7 @@ musb_start_urb(struct musb *musb, int is_in, struct musb_qh *qh) len = urb->transfer_buffer_length - urb->actual_length; } - dev_dbg(musb->controller, "qh %p urb %p dev%d ep%d%s%s, hw_ep %d, %p/%d\n", + musb_dbg(musb, "qh %p urb %p dev%d ep%d%s%s, hw_ep %d, %p/%d", qh, urb, address, qh->epnum, is_in ? "in" : "out", ({char *s; switch (qh->type) { @@ -277,7 +277,7 @@ musb_start_urb(struct musb *musb, int is_in, struct musb_qh *qh) switch (qh->type) { case USB_ENDPOINT_XFER_ISOC: case USB_ENDPOINT_XFER_INT: - dev_dbg(musb->controller, "check whether there's still time for periodic Tx\n"); + musb_dbg(musb, "check whether there's still time for periodic Tx"); frame = musb_readw(mbase, MUSB_FRAME); /* FIXME this doesn't implement that scheduling policy ... * or handle framecounter wrapping @@ -291,7 +291,7 @@ musb_start_urb(struct musb *musb, int is_in, struct musb_qh *qh) } else { qh->frame = urb->start_frame; /* enable SOF interrupt so we can count down */ - dev_dbg(musb->controller, "SOF for %d\n", epnum); + musb_dbg(musb, "SOF for %d", epnum); #if 1 /* ifndef CONFIG_ARCH_DAVINCI */ musb_writeb(mbase, MUSB_INTRUSBE, 0xff); #endif @@ -299,7 +299,7 @@ musb_start_urb(struct musb *musb, int is_in, struct musb_qh *qh) break; default: start: - dev_dbg(musb->controller, "Start TX%d %s\n", epnum, + musb_dbg(musb, "Start TX%d %s", epnum, hw_ep->tx_channel ? "dma" : "pio"); if (!hw_ep->tx_channel) @@ -314,8 +314,7 @@ static void musb_giveback(struct musb *musb, struct urb *urb, int status) __releases(musb->lock) __acquires(musb->lock) { - dev_dbg(musb->controller, - "complete %p %pF (%d), dev%d ep%d%s, %d/%d\n", + musb_dbg(musb, "complete %p %pF (%d), dev%d ep%d%s, %d/%d", urb, urb->complete, status, usb_pipedevice(urb->pipe), usb_pipeendpoint(urb->pipe), @@ -435,7 +434,7 @@ static void musb_advance_schedule(struct musb *musb, struct urb *urb, } if (qh != NULL && qh->is_ready) { - dev_dbg(musb->controller, "... next ep%d %cX urb %p\n", + musb_dbg(musb, "... next ep%d %cX urb %p", hw_ep->epnum, is_in ? 'R' : 'T', next_urb(qh)); musb_start_urb(musb, is_in, qh); } @@ -480,7 +479,7 @@ musb_host_packet_rx(struct musb *musb, struct urb *urb, u8 epnum, u8 iso_err) /* musb_ep_select(mbase, epnum); */ rx_count = musb_readw(epio, MUSB_RXCOUNT); - dev_dbg(musb->controller, "RX%d count %d, buffer %p len %d/%d\n", epnum, rx_count, + musb_dbg(musb, "RX%d count %d, buffer %p len %d/%d", epnum, rx_count, urb->transfer_buffer, qh->offset, urb->transfer_buffer_length); @@ -502,7 +501,7 @@ musb_host_packet_rx(struct musb *musb, struct urb *urb, u8 epnum, u8 iso_err) status = -EOVERFLOW; urb->error_count++; } - dev_dbg(musb->controller, "** OVERFLOW %d into %d\n", rx_count, length); + musb_dbg(musb, "OVERFLOW %d into %d", rx_count, length); do_flush = 1; } else length = rx_count; @@ -520,7 +519,7 @@ musb_host_packet_rx(struct musb *musb, struct urb *urb, u8 epnum, u8 iso_err) if (rx_count > length) { if (urb->status == -EINPROGRESS) urb->status = -EOVERFLOW; - dev_dbg(musb->controller, "** OVERFLOW %d into %d\n", rx_count, length); + musb_dbg(musb, "OVERFLOW %d into %d", rx_count, length); do_flush = 1; } else length = rx_count; @@ -753,8 +752,8 @@ static void musb_ep_program(struct musb *musb, u8 epnum, u8 use_dma = 1; u16 csr; - dev_dbg(musb->controller, "%s hw%d urb %p spd%d dev%d ep%d%s " - "h_addr%02x h_port%02x bytes %d\n", + musb_dbg(musb, "%s hw%d urb %p spd%d dev%d ep%d%s " + "h_addr%02x h_port%02x bytes %d", is_out ? "-->" : "<--", epnum, urb, urb->dev->speed, qh->addr_reg, qh->epnum, is_out ? "out" : "in", @@ -972,7 +971,7 @@ finish: } csr |= MUSB_RXCSR_H_REQPKT; - dev_dbg(musb->controller, "RXCSR%d := %04x\n", epnum, csr); + musb_dbg(musb, "RXCSR%d := %04x", epnum, csr); musb_writew(hw_ep->regs, MUSB_RXCSR, csr); csr = musb_readw(hw_ep->regs, MUSB_RXCSR); } @@ -1082,15 +1081,15 @@ static bool musb_h_ep0_continue(struct musb *musb, u16 len, struct urb *urb) request = (struct usb_ctrlrequest *) urb->setup_packet; if (!request->wLength) { - dev_dbg(musb->controller, "start no-DATA\n"); + musb_dbg(musb, "start no-DATA"); break; } else if (request->bRequestType & USB_DIR_IN) { - dev_dbg(musb->controller, "start IN-DATA\n"); + musb_dbg(musb, "start IN-DATA"); musb->ep0_stage = MUSB_EP0_IN; more = true; break; } else { - dev_dbg(musb->controller, "start OUT-DATA\n"); + musb_dbg(musb, "start OUT-DATA"); musb->ep0_stage = MUSB_EP0_OUT; more = true; } @@ -1102,7 +1101,7 @@ static bool musb_h_ep0_continue(struct musb *musb, u16 len, struct urb *urb) if (fifo_count) { fifo_dest = (u8 *) (urb->transfer_buffer + urb->actual_length); - dev_dbg(musb->controller, "Sending %d byte%s to ep0 fifo %p\n", + musb_dbg(musb, "Sending %d byte%s to ep0 fifo %p", fifo_count, (fifo_count == 1) ? "" : "s", fifo_dest); @@ -1147,7 +1146,7 @@ irqreturn_t musb_h_ep0_irq(struct musb *musb) ? musb_readb(epio, MUSB_COUNT0) : 0; - dev_dbg(musb->controller, "<== csr0 %04x, qh %p, count %d, urb %p, stage %d\n", + musb_dbg(musb, "<== csr0 %04x, qh %p, count %d, urb %p, stage %d", csr, qh, len, urb, musb->ep0_stage); /* if we just did status stage, we are done */ @@ -1158,15 +1157,15 @@ irqreturn_t musb_h_ep0_irq(struct musb *musb) /* prepare status */ if (csr & MUSB_CSR0_H_RXSTALL) { - dev_dbg(musb->controller, "STALLING ENDPOINT\n"); + musb_dbg(musb, "STALLING ENDPOINT"); status = -EPIPE; } else if (csr & MUSB_CSR0_H_ERROR) { - dev_dbg(musb->controller, "no response, csr0 %04x\n", csr); + musb_dbg(musb, "no response, csr0 %04x", csr); status = -EPROTO; } else if (csr & MUSB_CSR0_H_NAKTIMEOUT) { - dev_dbg(musb->controller, "control NAK timeout\n"); + musb_dbg(musb, "control NAK timeout"); /* NOTE: this code path would be a good place to PAUSE a * control transfer, if another one is queued, so that @@ -1181,7 +1180,7 @@ irqreturn_t musb_h_ep0_irq(struct musb *musb) } if (status) { - dev_dbg(musb->controller, "aborting\n"); + musb_dbg(musb, "aborting"); retval = IRQ_HANDLED; if (urb) urb->status = status; @@ -1234,7 +1233,7 @@ irqreturn_t musb_h_ep0_irq(struct musb *musb) /* flag status stage */ musb->ep0_stage = MUSB_EP0_STATUS; - dev_dbg(musb->controller, "ep0 STATUS, csr %04x\n", csr); + musb_dbg(musb, "ep0 STATUS, csr %04x", csr); } musb_writew(epio, MUSB_CSR0, csr); @@ -1288,38 +1287,36 @@ void musb_host_tx(struct musb *musb, u8 epnum) /* with CPPI, DMA sometimes triggers "extra" irqs */ if (!urb) { - dev_dbg(musb->controller, "extra TX%d ready, csr %04x\n", epnum, tx_csr); + musb_dbg(musb, "extra TX%d ready, csr %04x", epnum, tx_csr); return; } pipe = urb->pipe; dma = is_dma_capable() ? hw_ep->tx_channel : NULL; - dev_dbg(musb->controller, "OUT/TX%d end, csr %04x%s\n", epnum, tx_csr, + musb_dbg(musb, "OUT/TX%d end, csr %04x%s", epnum, tx_csr, dma ? ", dma" : ""); /* check for errors */ if (tx_csr & MUSB_TXCSR_H_RXSTALL) { /* dma was disabled, fifo flushed */ - dev_dbg(musb->controller, "TX end %d stall\n", epnum); + musb_dbg(musb, "TX end %d stall", epnum); /* stall; record URB status */ status = -EPIPE; } else if (tx_csr & MUSB_TXCSR_H_ERROR) { /* (NON-ISO) dma was disabled, fifo flushed */ - dev_dbg(musb->controller, "TX 3strikes on ep=%d\n", epnum); + musb_dbg(musb, "TX 3strikes on ep=%d", epnum); status = -ETIMEDOUT; } else if (tx_csr & MUSB_TXCSR_H_NAKTIMEOUT) { if (USB_ENDPOINT_XFER_BULK == qh->type && qh->mux == 1 && !list_is_singular(&musb->out_bulk)) { - dev_dbg(musb->controller, - "NAK timeout on TX%d ep\n", epnum); + musb_dbg(musb, "NAK timeout on TX%d ep", epnum); musb_bulk_nak_timeout(musb, hw_ep, 0); } else { - dev_dbg(musb->controller, - "TX end=%d device not responding\n", epnum); + musb_dbg(musb, "TX ep%d device not responding", epnum); /* NOTE: this code path would be a good place to PAUSE a * transfer, if there's some other (nonperiodic) tx urb * that could use this fifo. (dma complicates it...) @@ -1365,7 +1362,7 @@ done: /* second cppi case */ if (dma_channel_status(dma) == MUSB_DMA_STATUS_BUSY) { - dev_dbg(musb->controller, "extra TX%d ready, csr %04x\n", epnum, tx_csr); + musb_dbg(musb, "extra TX%d ready, csr %04x", epnum, tx_csr); return; } @@ -1424,8 +1421,9 @@ done: * FIFO mode too... */ if (tx_csr & (MUSB_TXCSR_FIFONOTEMPTY | MUSB_TXCSR_TXPKTRDY)) { - dev_dbg(musb->controller, "DMA complete but packet still in FIFO, " - "CSR %04x\n", tx_csr); + musb_dbg(musb, + "DMA complete but FIFO not empty, CSR %04x", + tx_csr); return; } } @@ -1491,7 +1489,7 @@ done: return; } } else if (tx_csr & MUSB_TXCSR_DMAENAB) { - dev_dbg(musb->controller, "not complete, but DMA enabled?\n"); + musb_dbg(musb, "not complete, but DMA enabled?"); return; } @@ -1720,7 +1718,7 @@ static int musb_rx_dma_in_inventra_cppi41(struct dma_controller *dma, d_status = -EOVERFLOW; urb->error_count++; } - dev_dbg(musb->controller, "** OVERFLOW %d into %d\n", + musb_dbg(musb, "** OVERFLOW %d into %d", rx_count, d->length); length = d->length; @@ -1844,28 +1842,28 @@ void musb_host_rx(struct musb *musb, u8 epnum) * usbtest #11 (unlinks) triggers it regularly, sometimes * with fifo full. (Only with DMA??) */ - dev_dbg(musb->controller, "BOGUS RX%d ready, csr %04x, count %d\n", epnum, val, - musb_readw(epio, MUSB_RXCOUNT)); + musb_dbg(musb, "BOGUS RX%d ready, csr %04x, count %d", + epnum, val, musb_readw(epio, MUSB_RXCOUNT)); musb_h_flush_rxfifo(hw_ep, MUSB_RXCSR_CLRDATATOG); return; } pipe = urb->pipe; - dev_dbg(musb->controller, "<== hw %d rxcsr %04x, urb actual %d (+dma %zu)\n", + musb_dbg(musb, "<== hw %d rxcsr %04x, urb actual %d (+dma %zu)", epnum, rx_csr, urb->actual_length, dma ? dma->actual_len : 0); /* check for errors, concurrent stall & unlink is not really * handled yet! */ if (rx_csr & MUSB_RXCSR_H_RXSTALL) { - dev_dbg(musb->controller, "RX end %d STALL\n", epnum); + musb_dbg(musb, "RX end %d STALL", epnum); /* stall; record URB status */ status = -EPIPE; } else if (rx_csr & MUSB_RXCSR_H_ERROR) { - dev_dbg(musb->controller, "end %d RX proto error\n", epnum); + musb_dbg(musb, "end %d RX proto error", epnum); status = -EPROTO; musb_writeb(epio, MUSB_RXINTERVAL, 0); @@ -1873,7 +1871,7 @@ void musb_host_rx(struct musb *musb, u8 epnum) } else if (rx_csr & MUSB_RXCSR_DATAERROR) { if (USB_ENDPOINT_XFER_ISOC != qh->type) { - dev_dbg(musb->controller, "RX end %d NAK timeout\n", epnum); + musb_dbg(musb, "RX end %d NAK timeout", epnum); /* NOTE: NAKing is *NOT* an error, so we want to * continue. Except ... if there's a request for @@ -1896,12 +1894,12 @@ void musb_host_rx(struct musb *musb, u8 epnum) goto finish; } else { - dev_dbg(musb->controller, "RX end %d ISO data error\n", epnum); + musb_dbg(musb, "RX end %d ISO data error", epnum); /* packet error reported later */ iso_err = true; } } else if (rx_csr & MUSB_RXCSR_INCOMPRX) { - dev_dbg(musb->controller, "end %d high bandwidth incomplete ISO packet RX\n", + musb_dbg(musb, "end %d high bandwidth incomplete ISO packet RX", epnum); status = -EPROTO; } @@ -1946,7 +1944,7 @@ void musb_host_rx(struct musb *musb, u8 epnum) done = true; } - dev_dbg(musb->controller, "RXCSR%d %04x, reqpkt, len %zu%s\n", epnum, rx_csr, + musb_dbg(musb, "RXCSR%d %04x, reqpkt, len %zu%s", epnum, rx_csr, xfer_len, dma ? ", dma" : ""); rx_csr &= ~MUSB_RXCSR_H_REQPKT; @@ -1967,8 +1965,8 @@ void musb_host_rx(struct musb *musb, u8 epnum) if (musb_dma_inventra(musb) || musb_dma_ux500(musb) || musb_dma_cppi41(musb)) { done = musb_rx_dma_inventra_cppi41(c, hw_ep, qh, urb, xfer_len); - dev_dbg(hw_ep->musb->controller, - "ep %d dma %s, rxcsr %04x, rxcount %d\n", + musb_dbg(hw_ep->musb, + "ep %d dma %s, rxcsr %04x, rxcount %d", epnum, done ? "off" : "reset", musb_readw(epio, MUSB_RXCSR), musb_readw(epio, MUSB_RXCOUNT)); @@ -1995,8 +1993,8 @@ void musb_host_rx(struct musb *musb, u8 epnum) /* we are expecting IN packets */ if ((musb_dma_inventra(musb) || musb_dma_ux500(musb) || musb_dma_cppi41(musb)) && dma) { - dev_dbg(hw_ep->musb->controller, - "RX%d count %d, buffer 0x%llx len %d/%d\n", + musb_dbg(hw_ep->musb, + "RX%d count %d, buffer 0x%llx len %d/%d", epnum, musb_readw(epio, MUSB_RXCOUNT), (unsigned long long) urb->transfer_dma + urb->actual_length, @@ -2048,7 +2046,7 @@ void musb_host_rx(struct musb *musb, u8 epnum) done = musb_host_packet_rx(musb, urb, epnum, iso_err); } - dev_dbg(musb->controller, "read %spacket\n", done ? "last " : ""); + musb_dbg(musb, "read %spacket", done ? "last " : ""); } } @@ -2172,7 +2170,7 @@ static int musb_schedule( idle = 1; qh->mux = 0; hw_ep = musb->endpoints + best_end; - dev_dbg(musb->controller, "qh %p periodic slot %d\n", qh, best_end); + musb_dbg(musb, "qh %p periodic slot %d", qh, best_end); success: if (head) { idle = list_empty(head); @@ -2394,8 +2392,7 @@ static int musb_cleanup_urb(struct urb *urb, struct musb_qh *qh) dma = is_in ? ep->rx_channel : ep->tx_channel; if (dma) { status = ep->musb->dma_controller->channel_abort(dma); - dev_dbg(musb->controller, - "abort %cX%d DMA for urb %p --> %d\n", + musb_dbg(musb, "abort %cX%d DMA for urb %p --> %d", is_in ? 'R' : 'T', ep->epnum, urb, status); urb->actual_length += dma->actual_len; @@ -2441,7 +2438,7 @@ static int musb_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status) int is_in = usb_pipein(urb->pipe); int ret; - dev_dbg(musb->controller, "urb=%p, dev%d ep%d%s\n", urb, + musb_dbg(musb, "urb=%p, dev%d ep%d%s", urb, usb_pipedevice(urb->pipe), usb_pipeendpoint(urb->pipe), is_in ? "in" : "out"); diff --git a/drivers/usb/musb/musb_virthub.c b/drivers/usb/musb/musb_virthub.c index 92d5f71..192248f 100644 --- a/drivers/usb/musb/musb_virthub.c +++ b/drivers/usb/musb/musb_virthub.c @@ -55,8 +55,7 @@ void musb_host_finish_resume(struct work_struct *work) power = musb_readb(musb->mregs, MUSB_POWER); power &= ~MUSB_POWER_RESUME; - dev_dbg(musb->controller, "root port resume stopped, power %02x\n", - power); + musb_dbg(musb, "root port resume stopped, power %02x", power); musb_writeb(musb->mregs, MUSB_POWER, power); /* @@ -104,7 +103,7 @@ void musb_port_suspend(struct musb *musb, bool do_suspend) break; } - dev_dbg(musb->controller, "Root port suspended, power %02x\n", power); + musb_dbg(musb, "Root port suspended, power %02x", power); musb->port1_status |= USB_PORT_STAT_SUSPEND; switch (musb->xceiv->otg->state) { @@ -123,7 +122,7 @@ void musb_port_suspend(struct musb *musb, bool do_suspend) musb_platform_try_idle(musb, 0); break; default: - dev_dbg(musb->controller, "bogus rh suspend? %s\n", + musb_dbg(musb, "bogus rh suspend? %s", usb_otg_state_string(musb->xceiv->otg->state)); } } else if (power & MUSB_POWER_SUSPENDM) { @@ -131,7 +130,7 @@ void musb_port_suspend(struct musb *musb, bool do_suspend) power |= MUSB_POWER_RESUME; musb_writeb(mbase, MUSB_POWER, power); - dev_dbg(musb->controller, "Root port resuming, power %02x\n", power); + musb_dbg(musb, "Root port resuming, power %02x", power); /* later, GetPortStatus will stop RESUME signaling */ musb->port1_status |= MUSB_PORT_STAT_RESUME; @@ -146,7 +145,7 @@ void musb_port_reset(struct musb *musb, bool do_reset) void __iomem *mbase = musb->mregs; if (musb->xceiv->otg->state == OTG_STATE_B_IDLE) { - dev_dbg(musb->controller, "HNP: Returning from HNP; no hub reset from b_idle\n"); + musb_dbg(musb, "HNP: Returning from HNP; no hub reset from b_idle"); musb->port1_status &= ~USB_PORT_STAT_RESET; return; } @@ -194,7 +193,7 @@ void musb_port_reset(struct musb *musb, bool do_reset) schedule_delayed_work(&musb->deassert_reset_work, msecs_to_jiffies(50)); } else { - dev_dbg(musb->controller, "root port reset stopped\n"); + musb_dbg(musb, "root port reset stopped"); musb_platform_pre_root_reset_end(musb); musb_writeb(mbase, MUSB_POWER, power & ~MUSB_POWER_RESET); @@ -202,7 +201,7 @@ void musb_port_reset(struct musb *musb, bool do_reset) power = musb_readb(mbase, MUSB_POWER); if (power & MUSB_POWER_HSMODE) { - dev_dbg(musb->controller, "high-speed device connected\n"); + musb_dbg(musb, "high-speed device connected"); musb->port1_status |= USB_PORT_STAT_HIGH_SPEED; } @@ -242,7 +241,7 @@ void musb_root_disconnect(struct musb *musb) musb->xceiv->otg->state = OTG_STATE_B_IDLE; break; default: - dev_dbg(musb->controller, "host disconnect (%s)\n", + musb_dbg(musb, "host disconnect (%s)", usb_otg_state_string(musb->xceiv->otg->state)); } } @@ -337,7 +336,7 @@ int musb_hub_control( default: goto error; } - dev_dbg(musb->controller, "clear feature %d\n", wValue); + musb_dbg(musb, "clear feature %d", wValue); musb->port1_status &= ~(1 << wValue); break; case GetHubDescriptor: @@ -372,8 +371,7 @@ int musb_hub_control( (__le32 *) buf); /* port change status is more interesting */ - dev_dbg(musb->controller, "port status %08x\n", - musb->port1_status); + musb_dbg(musb, "port status %08x", musb->port1_status); break; case SetPortFeature: if ((wIndex & 0xff) != 1) @@ -443,7 +441,7 @@ int musb_hub_control( default: goto error; } - dev_dbg(musb->controller, "set feature %d\n", wValue); + musb_dbg(musb, "set feature %d", wValue); musb->port1_status |= 1 << wValue; break; diff --git a/drivers/usb/musb/musbhsdma.c b/drivers/usb/musb/musbhsdma.c index 8abfe4e..3620073 100644 --- a/drivers/usb/musb/musbhsdma.c +++ b/drivers/usb/musb/musbhsdma.c @@ -117,7 +117,7 @@ static void configure_channel(struct dma_channel *channel, u8 bchannel = musb_channel->idx; u16 csr = 0; - dev_dbg(musb->controller, "%p, pkt_sz %d, addr %pad, len %d, mode %d\n", + musb_dbg(musb, "%p, pkt_sz %d, addr %pad, len %d, mode %d", channel, packet_sz, &dma_addr, len, mode); if (mode) { @@ -152,7 +152,7 @@ static int dma_channel_program(struct dma_channel *channel, struct musb_dma_controller *controller = musb_channel->controller; struct musb *musb = controller->private_data; - dev_dbg(musb->controller, "ep%d-%s pkt_sz %d, dma_addr %pad length %d, mode %d\n", + musb_dbg(musb, "ep%d-%s pkt_sz %d, dma_addr %pad length %d, mode %d", musb_channel->epnum, musb_channel->transmit ? "Tx" : "Rx", packet_sz, &dma_addr, len, mode); @@ -266,7 +266,7 @@ static irqreturn_t dma_controller_irq(int irq, void *private_data) #endif if (!int_hsdma) { - dev_dbg(musb->controller, "spurious DMA irq\n"); + musb_dbg(musb, "spurious DMA irq"); for (bchannel = 0; bchannel < MUSB_HSDMA_CHANNELS; bchannel++) { musb_channel = (struct musb_dma_channel *) @@ -280,7 +280,7 @@ static irqreturn_t dma_controller_irq(int irq, void *private_data) } } - dev_dbg(musb->controller, "int_hsdma = 0x%x\n", int_hsdma); + musb_dbg(musb, "int_hsdma = 0x%x", int_hsdma); if (!int_hsdma) goto done; @@ -307,7 +307,7 @@ static irqreturn_t dma_controller_irq(int irq, void *private_data) channel->actual_len = addr - musb_channel->start_addr; - dev_dbg(musb->controller, "ch %p, 0x%x -> 0x%x (%zu / %d) %s\n", + musb_dbg(musb, "ch %p, 0x%x -> 0x%x (%zu / %d) %s", channel, musb_channel->start_addr, addr, channel->actual_len, musb_channel->len, -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html