This reduces the quantity of messages, by using the
newer dev_*() macros, and by deleting some messages.
This applies on top of the previous patch, with fuzz.
- Dave
--- ./drivers/usb-dist/host/ehci-mem.c Wed Nov 27 21:23:16 2002
+++ ./drivers/usb/host/ehci-mem.c Fri Nov 29 11:03:15 2002
@@ -103,7 +103,7 @@
/* dummy td enables safe urb queuing */
qh->dummy = ehci_qtd_alloc (ehci, flags);
if (qh->dummy == 0) {
- dbg ("no dummy td");
+ ehci_dbg (ehci, "no dummy td\n");
pci_pool_free (ehci->qh_pool, qh, qh->qh_dma);
qh = 0;
}
@@ -113,19 +113,17 @@
/* to share a qh (cpu threads, or hc) */
static inline struct ehci_qh *qh_get (/* ehci, */ struct ehci_qh *qh)
{
- // dbg ("get %p (%d++)", qh, qh->refcount.counter);
atomic_inc (&qh->refcount);
return qh;
}
static void qh_put (struct ehci_hcd *ehci, struct ehci_qh *qh)
{
- // dbg ("put %p (--%d)", qh, qh->refcount.counter);
if (!atomic_dec_and_test (&qh->refcount))
return;
/* clean qtds first, and know this is not linked */
if (!list_empty (&qh->qtd_list) || qh->qh_next.ptr) {
- dbg ("unused qh not empty!");
+ ehci_dbg (ehci, "unused qh not empty!\n");
BUG ();
}
if (qh->dummy)
--- ./drivers/usb-dist/host/ehci-hcd.c Wed Nov 27 21:23:16 2002
+++ ./drivers/usb/host/ehci-hcd.c Fri Nov 29 11:03:15 2002
@@ -260,7 +260,7 @@
spin_lock_irqsave (&ehci->lock, flags);
/* guard against lost IAA, which wedges everything */
ehci_irq (&ehci->hcd);
- /* unlink the last qh after it's idled a while */
+ /* stop async processing after it's idled a while */
if (ehci->async_idle) {
start_unlink_async (ehci, ehci->async);
ehci->async_idle = 0;
@@ -287,12 +287,13 @@
pci_read_config_dword (ehci->hcd.pdev, where, &cap);
} while ((cap & (1 << 16)) && msec);
if (cap & (1 << 16)) {
- info ("BIOS handoff failed (%d, %04x)", where, cap);
+ dev_info (*ehci->hcd.controller,
+ "BIOS handoff failed (%d, %04x)\n",
+ where, cap);
return 1;
}
- dbg ("BIOS handoff succeeded");
- } else
- dbg ("BIOS handoff not needed");
+ ehci_dbg (ehci, "BIOS handoff succeeded\n");
+ }
return 0;
}
@@ -323,14 +324,15 @@
u32 cap;
pci_read_config_dword (ehci->hcd.pdev, temp, &cap);
- dbg ("capability %04x at %02x", cap, temp);
+ ehci_dbg (ehci, "capability %04x at %02x\n", cap, temp);
switch (cap & 0xff) {
case 1: /* BIOS/SMM/... handoff */
if (bios_handoff (ehci, temp, cap) != 0)
return -EOPNOTSUPP;
break;
case 0: /* illegal reserved capability */
- warn ("illegal capability!");
+ dev_warn (*ehci->hcd.controller,
+ "illegal capability!\n");
cap = 0;
/* FALLTHROUGH */
default: /* unknown */
@@ -388,7 +390,8 @@
if (HCC_64BIT_ADDR (hcc_params)) {
writel (0, &ehci->regs->segment);
if (!pci_set_dma_mask (ehci->hcd.pdev, 0xffffffffffffffffULL))
- info ("enabled 64bit PCI DMA (DAC)");
+ dev_info (*ehci->hcd.controller,
+ "enabled 64bit PCI DMA (DAC)\n");
}
/* clear interrupt enables, set irq latency */
@@ -435,10 +438,10 @@
/* PCI Serial Bus Release Number is at 0x60 offset */
pci_read_config_byte (hcd->pdev, 0x60, &tempbyte);
temp = readw (&ehci->caps->hci_version);
- info ("USB %x.%x support enabled, EHCI rev %x.%02x, %s %s",
- ((tempbyte & 0xf0)>>4), (tempbyte & 0x0f),
- temp >> 8, temp & 0xff,
- hcd_name, DRIVER_VERSION);
+ dev_info (*hcd->controller,
+ "USB %x.%x enabled, EHCI %x.%02x, driver %s\n",
+ ((tempbyte & 0xf0)>>4), (tempbyte & 0x0f),
+ temp >> 8, temp & 0xff, DRIVER_VERSION);
/*
* From here on, khubd concurrently accesses the root
@@ -470,13 +473,13 @@
{
struct ehci_hcd *ehci = hcd_to_ehci (hcd);
- dbg ("%s: stop", hcd_to_bus (hcd)->bus_name);
+ ehci_dbg (ehci, "stop\n");
/* no more interrupts ... */
if (hcd->state == USB_STATE_RUNNING)
ehci_ready (ehci);
if (in_interrupt ()) /* should not happen!! */
- err ("stopped %s!", RUN_CONTEXT);
+ dev_err (*hcd->controller, "stopped %s!\n", RUN_CONTEXT);
else
del_timer_sync (&ehci->watchdog);
ehci_reset (ehci);
@@ -492,9 +495,9 @@
ehci_mem_cleanup (ehci);
#ifdef EHCI_STATS
- dbg ("irq normal %ld err %ld reclaim %ld",
+ ehci_dbg (ehci, "irq normal %ld err %ld reclaim %ld\n",
ehci->stats.normal, ehci->stats.error, ehci->stats.reclaim);
- dbg ("complete %ld unlink %ld",
+ ehci_dbg (ehci, "complete %ld unlink %ld\n",
ehci->stats.complete, ehci->stats.unlink);
#endif
@@ -738,8 +741,8 @@
struct ehci_qh *qh = (struct ehci_qh *) urb->hcpriv;
unsigned long flags;
- dbg ("%s urb_dequeue %p qh %p state %d",
- hcd_to_bus (hcd)->bus_name, urb, qh, qh->qh_state);
+ ehci_vdbg (ehci, "urb_dequeue %p qh %p state %d\n",
+ urb, qh, qh->qh_state);
switch (usb_pipetype (urb->pipe)) {
// case PIPE_CONTROL:
@@ -982,7 +985,6 @@
static int __init init (void)
{
- dbg (DRIVER_INFO);
if (usb_disabled())
return -ENODEV;
--- ./drivers/usb-dist/host/ehci-q.c Wed Nov 27 21:23:16 2002
+++ ./drivers/usb/host/ehci-q.c Fri Nov 29 11:03:15 2002
@@ -130,8 +130,9 @@
else /* unknown */
urb->status = -EPROTO;
- dbg ("ep %d-%s qtd token %08x --> status %d",
- /* devpath */
+ ehci_vdbg (ehci,
+ "dev%d ep%d%s qtd token %08x --> status %d\n",
+ usb_pipedev (urb->pipe),
usb_pipeendpoint (urb->pipe),
usb_pipein (urb->pipe) ? "in" : "out",
token, urb->status);
--- ./drivers/usb-dist/host/ehci-dbg.c Wed Nov 27 21:23:15 2002
+++ ./drivers/usb/host/ehci-dbg.c Fri Nov 29 11:03:15 2002
@@ -34,7 +34,8 @@
{
u32 params = readl (&ehci->caps->hcs_params);
- dbg ("%s hcs_params 0x%x dbg=%d%s cc=%d pcc=%d%s%s ports=%d",
+ ehci_dbg (ehci,
+ "%s hcs_params 0x%x dbg=%d%s cc=%d pcc=%d%s%s ports=%d\n",
label, params,
HCS_DEBUG_PORT (params),
HCS_INDICATOR (params) ? " ind" : "",
@@ -56,9 +57,8 @@
((i & 0x1) ? ((byte)&0xf) : ((byte>>4)&0xf)));
strcat(buf, tmp);
}
- dbg ("%s: %s portroute %s",
- hcd_to_bus (&ehci->hcd)->bus_name, label,
- buf);
+ ehci_dbg (ehci, "%s portroute %s\n",
+ label, buf);
}
}
#else
@@ -77,19 +77,16 @@
{
u32 params = readl (&ehci->caps->hcc_params);
- if (HCC_EXT_CAPS (params)) {
- // EHCI 0.96 ... could interpret these (legacy?)
- dbg ("%s extended capabilities at pci %2x",
- label, HCC_EXT_CAPS (params));
- }
if (HCC_ISOC_CACHE (params)) {
- dbg ("%s hcc_params %04x caching frame %s%s%s",
+ ehci_dbg (ehci,
+ "%s hcc_params %04x caching frame %s%s%s\n",
label, params,
HCC_PGM_FRAMELISTLEN (params) ? "256/512/1024" : "1024",
HCC_CANPARK (params) ? " park" : "",
HCC_64BIT_ADDR (params) ? " 64 bit addr" : "");
} else {
- dbg ("%s hcc_params %04x caching %d uframes %s%s%s",
+ ehci_dbg (ehci,
+ "%s hcc_params %04x thresh %d uframes %s%s%s\n",
label,
params,
HCC_ISOC_THRES (params),
@@ -235,19 +232,19 @@
#define dbg_status(ehci, label, status) { \
char _buf [80]; \
dbg_status_buf (_buf, sizeof _buf, label, status); \
- dbg ("%s", _buf); \
+ ehci_dbg (ehci, "%s\n", _buf); \
}
#define dbg_cmd(ehci, label, command) { \
char _buf [80]; \
dbg_command_buf (_buf, sizeof _buf, label, command); \
- dbg ("%s", _buf); \
+ ehci_dbg (ehci, "%s\n", _buf); \
}
-#define dbg_port(hcd, label, port, status) { \
+#define dbg_port(ehci, label, port, status) { \
char _buf [80]; \
dbg_port_buf (_buf, sizeof _buf, label, port, status); \
- dbg ("%s", _buf); \
+ ehci_dbg (ehci, "%s\n", _buf); \
}
/*-------------------------------------------------------------------------*/
--- ./drivers/usb-dist/host/ehci-hub.c Wed Nov 27 21:23:16 2002
+++ ./drivers/usb/host/ehci-hub.c Fri Nov 29 11:02:52 2002
@@ -40,18 +40,15 @@
/* if reset finished and it's still not enabled -- handoff */
if (!(port_status & PORT_PE)) {
- dbg ("%s port %d full speed, give to companion, 0x%x",
- hcd_to_bus (&ehci->hcd)->bus_name,
- index + 1, port_status);
+ ehci_dbg (ehci, "port %d full speed --> companion\n",
+ index + 1);
// what happens if HCS_N_CC(params) == 0 ?
port_status |= PORT_OWNER;
writel (port_status, &ehci->regs->port_status [index]);
} else
- dbg ("%s port %d high speed",
- hcd_to_bus (&ehci->hcd)->bus_name,
- index + 1);
+ ehci_dbg (ehci, "port %d high speed\n", index + 1);
return port_status;
}
@@ -277,7 +274,7 @@
#ifndef EHCI_VERBOSE_DEBUG
if (status & ~0xffff) /* only if wPortChange is interesting */
#endif
- dbg_port (hcd, "GetStatus", wIndex + 1, temp);
+ dbg_port (ehci, "GetStatus", wIndex + 1, temp);
// we "know" this alignment is good, caller used kmalloc()...
*((u32 *) buf) = cpu_to_le32 (status);
break;
@@ -313,14 +310,12 @@
/* line status bits may report this as low speed */
if ((temp & (PORT_PE|PORT_CONNECT)) == PORT_CONNECT
&& PORT_USB11 (temp)) {
- dbg ("%s port %d low speed, give to companion",
- hcd_to_bus (&ehci->hcd)->bus_name,
+ ehci_dbg (ehci,
+ "port %d low speed --> companion\n",
wIndex + 1);
temp |= PORT_OWNER;
} else {
- vdbg ("%s port %d reset",
- hcd_to_bus (&ehci->hcd)->bus_name,
- wIndex + 1);
+ ehci_vdbg (ehci, "port %d reset", wIndex + 1);
temp |= PORT_RESET;
temp &= ~PORT_PE;