From a90b8fc6f477ef40bd7a50354ce4ae029d8c70c5 Mon Sep 17 00:00:00 2001 From: Oliver Neukum Date: Mon, 18 Nov 2013 13:23:03 +0100 Subject: fotg210: remove conditional compilation Always compile in the debugfs support Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/fotg210-hcd.c | 8 -------- 1 file changed, 8 deletions(-) (limited to 'drivers/usb/host/fotg210-hcd.c') diff --git a/drivers/usb/host/fotg210-hcd.c b/drivers/usb/host/fotg210-hcd.c index 55486bd..3af0533 100644 --- a/drivers/usb/host/fotg210-hcd.c +++ b/drivers/usb/host/fotg210-hcd.c @@ -352,13 +352,6 @@ dbg_port_buf(char *buf, unsigned len, const char *label, int port, u32 status) /*-------------------------------------------------------------------------*/ -#ifdef STUB_DEBUG_FILES - -static inline void create_debug_files(struct fotg210_hcd *bus) { } -static inline void remove_debug_files(struct fotg210_hcd *bus) { } - -#else - /* troubleshooting help: expose state in debugfs */ static int debug_async_open(struct inode *, struct file *); @@ -954,7 +947,6 @@ static inline void remove_debug_files(struct fotg210_hcd *fotg210) debugfs_remove_recursive(fotg210->debug_dir); } -#endif /* STUB_DEBUG_FILES */ /*-------------------------------------------------------------------------*/ /* -- cgit v1.1 From 063635ec3ac6d02cefce06038f2166bbff85d840 Mon Sep 17 00:00:00 2001 From: Oliver Neukum Date: Mon, 18 Nov 2013 13:23:04 +0100 Subject: fotg210: always compile the support for debugfs Simply remove the conditional compilation and remove the empty stubs. Signed-off-by: Oliver Neukum Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/fotg210-hcd.c | 47 ------------------------------------------ 1 file changed, 47 deletions(-) (limited to 'drivers/usb/host/fotg210-hcd.c') diff --git a/drivers/usb/host/fotg210-hcd.c b/drivers/usb/host/fotg210-hcd.c index 3af0533..15ee566 100644 --- a/drivers/usb/host/fotg210-hcd.c +++ b/drivers/usb/host/fotg210-hcd.c @@ -59,9 +59,7 @@ static const char hcd_name[] = "fotg210_hcd"; #undef VERBOSE_DEBUG #undef FOTG210_URB_TRACE -#ifdef DEBUG #define FOTG210_STATS -#endif /* magic numbers that can affect system performance */ #define FOTG210_TUNE_CERR 3 /* 0-3 qtd retries; 0 == don't stop */ @@ -113,8 +111,6 @@ MODULE_PARM_DESC(hird, "host initiated resume duration, +1 for each 75us"); static inline void fotg210_vdbg(struct fotg210_hcd *fotg210, ...) {} #endif -#ifdef DEBUG - /* check the values in the HCSPARAMS register * (host controller _Structural_ parameters) * see EHCI spec, Table 2-4 for each value @@ -129,13 +125,6 @@ static void dbg_hcs_params(struct fotg210_hcd *fotg210, char *label) HCS_N_PORTS(params) ); } -#else - -static inline void dbg_hcs_params(struct fotg210_hcd *fotg210, char *label) {} - -#endif - -#ifdef DEBUG /* check the values in the HCCPARAMS register * (host controller _Capability_ parameters) @@ -152,13 +141,6 @@ static void dbg_hcc_params(struct fotg210_hcd *fotg210, char *label) HCC_PGM_FRAMELISTLEN(params) ? "256/512/1024" : "1024", HCC_CANPARK(params) ? " park" : ""); } -#else - -static inline void dbg_hcc_params(struct fotg210_hcd *fotg210, char *label) {} - -#endif - -#ifdef DEBUG static void __maybe_unused dbg_qtd(const char *label, struct fotg210_hcd *fotg210, struct fotg210_qtd *qtd) @@ -308,29 +290,6 @@ dbg_port_buf(char *buf, unsigned len, const char *label, int port, u32 status) (status & PORT_CONNECT) ? " CONNECT" : ""); } -#else -static inline void __maybe_unused -dbg_qh(char *label, struct fotg210_hcd *fotg210, struct fotg210_qh *qh) -{} - -static inline int __maybe_unused -dbg_status_buf(char *buf, unsigned len, const char *label, u32 status) -{ return 0; } - -static inline int __maybe_unused -dbg_command_buf(char *buf, unsigned len, const char *label, u32 command) -{ return 0; } - -static inline int __maybe_unused -dbg_intr_buf(char *buf, unsigned len, const char *label, u32 enable) -{ return 0; } - -static inline int __maybe_unused -dbg_port_buf(char *buf, unsigned len, const char *label, int port, u32 status) -{ return 0; } - -#endif /* DEBUG */ - /* functions have the "wrong" filename when they're output... */ #define dbg_status(fotg210, label, status) { \ char _buf[80]; \ @@ -6005,13 +5964,11 @@ static int __init fotg210_hcd_init(void) sizeof(struct fotg210_qh), sizeof(struct fotg210_qtd), sizeof(struct fotg210_itd)); -#ifdef DEBUG fotg210_debug_root = debugfs_create_dir("fotg210", usb_debug_root); if (!fotg210_debug_root) { retval = -ENOENT; goto err_debug; } -#endif retval = platform_driver_register(&fotg210_hcd_driver); if (retval < 0) @@ -6020,11 +5977,9 @@ static int __init fotg210_hcd_init(void) platform_driver_unregister(&fotg210_hcd_driver); clean: -#ifdef DEBUG debugfs_remove(fotg210_debug_root); fotg210_debug_root = NULL; err_debug: -#endif clear_bit(USB_EHCI_LOADED, &usb_hcds_loaded); return retval; } @@ -6033,9 +5988,7 @@ module_init(fotg210_hcd_init); static void __exit fotg210_hcd_cleanup(void) { platform_driver_unregister(&fotg210_hcd_driver); -#ifdef DEBUG debugfs_remove(fotg210_debug_root); -#endif clear_bit(USB_EHCI_LOADED, &usb_hcds_loaded); } module_exit(fotg210_hcd_cleanup); -- cgit v1.1 From f848a88d223cafa43cb318839a1171b498cf5ec8 Mon Sep 17 00:00:00 2001 From: Oliver Neukum Date: Mon, 18 Nov 2013 13:23:05 +0100 Subject: fotg210: change dbg_port() to evaluate parameters only if needed For dynamic debug the overhead for evaluating parameters must be sacrificed only if the message is actually printed Signed-off-by: Oliver Neukum Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/fotg210-hcd.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'drivers/usb/host/fotg210-hcd.c') diff --git a/drivers/usb/host/fotg210-hcd.c b/drivers/usb/host/fotg210-hcd.c index 15ee566..4acb6a4 100644 --- a/drivers/usb/host/fotg210-hcd.c +++ b/drivers/usb/host/fotg210-hcd.c @@ -254,8 +254,8 @@ dbg_command_buf(char *buf, unsigned len, const char *label, u32 command) ); } -static int -dbg_port_buf(char *buf, unsigned len, const char *label, int port, u32 status) +static char +*dbg_port_buf(char *buf, unsigned len, const char *label, int port, u32 status) { char *sig; @@ -275,7 +275,7 @@ dbg_port_buf(char *buf, unsigned len, const char *label, int port, u32 status) break; } - return scnprintf(buf, len, + scnprintf(buf, len, "%s%sport:%d status %06x %d " "sig=%s%s%s%s%s%s%s%s", label, label[0] ? " " : "", port, status, @@ -288,6 +288,7 @@ dbg_port_buf(char *buf, unsigned len, const char *label, int port, u32 status) (status & PORT_PE) ? " PE" : "", (status & PORT_CSC) ? " CSC" : "", (status & PORT_CONNECT) ? " CONNECT" : ""); + return buf; } /* functions have the "wrong" filename when they're output... */ @@ -305,8 +306,7 @@ dbg_port_buf(char *buf, unsigned len, const char *label, int port, u32 status) #define dbg_port(fotg210, label, port, status) { \ char _buf[80]; \ - dbg_port_buf(_buf, sizeof(_buf), label, port, status); \ - fotg210_dbg(fotg210, "%s\n", _buf); \ + fotg210_dbg(fotg210, "%s\n", dbg_port_buf(_buf, sizeof(_buf), label, port, status) ); \ } /*-------------------------------------------------------------------------*/ -- cgit v1.1 From 3b707ece5b286cca47104364b2064ebb526d69ea Mon Sep 17 00:00:00 2001 From: Oliver Neukum Date: Mon, 18 Nov 2013 13:23:06 +0100 Subject: fotg210: remove conditional compilation The decision what is interesting is made in user space. Signed-off-by: Oliver Neukum Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/fotg210-hcd.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'drivers/usb/host/fotg210-hcd.c') diff --git a/drivers/usb/host/fotg210-hcd.c b/drivers/usb/host/fotg210-hcd.c index 4acb6a4..22f0b68 100644 --- a/drivers/usb/host/fotg210-hcd.c +++ b/drivers/usb/host/fotg210-hcd.c @@ -1761,10 +1761,8 @@ static int fotg210_hub_control( if (test_bit(wIndex, &fotg210->port_c_suspend)) status |= USB_PORT_STAT_C_SUSPEND << 16; -#ifndef VERBOSE_DEBUG - if (status & ~0xffff) /* only if wPortChange is interesting */ -#endif - dbg_port(fotg210, "GetStatus", wIndex + 1, temp); + if (status & ~0xffff) /* only if wPortChange is interesting */ + dbg_port(fotg210, "GetStatus", wIndex + 1, temp); put_unaligned_le32(status, buf); break; case SetHubFeature: @@ -2225,13 +2223,12 @@ static void fotg210_clear_tt_buffer(struct fotg210_hcd *fotg210, * Note: this routine is never called for Isochronous transfers. */ if (urb->dev->tt && !usb_pipeint(urb->pipe) && !qh->clearing_tt) { -#ifdef DEBUG struct usb_device *tt = urb->dev->tt->hub; dev_dbg(&tt->dev, "clear tt buffer port %d, a%d ep%d t%08x\n", urb->dev->ttport, urb->dev->devnum, usb_pipeendpoint(urb->pipe), token); -#endif /* DEBUG */ + if (urb->dev->tt->hub != fotg210_to_hcd(fotg210)->self.root_hub) { if (usb_hub_clear_tt_buffer(urb) == 0) @@ -3534,11 +3531,9 @@ periodic_usecs(struct fotg210_hcd *fotg210, unsigned frame, unsigned uframe) break; } } -#ifdef DEBUG if (usecs > fotg210->uframe_periodic_max) fotg210_err(fotg210, "uframe %d sched overrun: %d usecs\n", frame * 8 + uframe, usecs); -#endif return usecs; } @@ -5395,10 +5390,8 @@ static irqreturn_t fotg210_irq(struct usb_hcd *hcd) cmd = fotg210_readl(fotg210, &fotg210->regs->command); bh = 0; -#ifdef VERBOSE_DEBUG /* unrequested/ignored: Frame List Rollover */ dbg_status(fotg210, "irq", status); -#endif /* INT, ERR, and IAA interrupt rates can be throttled */ -- cgit v1.1 From be5ac4c43d13f68320de16c2d1bcecdba0adbea1 Mon Sep 17 00:00:00 2001 From: Oliver Neukum Date: Mon, 18 Nov 2013 13:23:07 +0100 Subject: fotg210: kill fotg210_vdbg() The decision what is interesting is shifted to user space by dynamic debugging. Signed-off-by: Oliver Neukum Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/fotg210-hcd.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'drivers/usb/host/fotg210-hcd.c') diff --git a/drivers/usb/host/fotg210-hcd.c b/drivers/usb/host/fotg210-hcd.c index 22f0b68..070582b 100644 --- a/drivers/usb/host/fotg210-hcd.c +++ b/drivers/usb/host/fotg210-hcd.c @@ -105,12 +105,6 @@ MODULE_PARM_DESC(hird, "host initiated resume duration, +1 for each 75us"); #define fotg210_warn(fotg210, fmt, args...) \ dev_warn(fotg210_to_hcd(fotg210)->self.controller , fmt , ## args) -#ifdef VERBOSE_DEBUG -# define fotg210_vdbg fotg210_dbg -#else - static inline void fotg210_vdbg(struct fotg210_hcd *fotg210, ...) {} -#endif - /* check the values in the HCSPARAMS register * (host controller _Structural_ parameters) * see EHCI spec, Table 2-4 for each value @@ -1349,7 +1343,7 @@ static void fotg210_iaa_watchdog(struct fotg210_hcd *fotg210) &fotg210->regs->status); } - fotg210_vdbg(fotg210, "IAA watchdog: status %x cmd %x\n", + fotg210_dbg(fotg210, "IAA watchdog: status %x cmd %x\n", status, cmd); end_unlink_async(fotg210); } @@ -1805,7 +1799,7 @@ static int fotg210_hub_control( * which can be fine if this root hub has a * transaction translator built in. */ - fotg210_vdbg(fotg210, "port %d reset\n", wIndex + 1); + fotg210_dbg(fotg210, "port %d reset\n", wIndex + 1); temp |= PORT_RESET; temp &= ~PORT_PE; @@ -2289,7 +2283,7 @@ static int qtd_copy_status( status = -EPROTO; } - fotg210_vdbg(fotg210, + fotg210_dbg(fotg210, "dev%d ep%d%s qtd token %08x --> status %d\n", usb_pipedevice(urb->pipe), usb_pipeendpoint(urb->pipe), @@ -4592,7 +4586,7 @@ static void itd_link_urb( if (unlikely(list_empty(&stream->td_list))) { fotg210_to_hcd(fotg210)->self.bandwidth_allocated += stream->bandwidth; - fotg210_vdbg(fotg210, + fotg210_dbg(fotg210, "schedule devp %s ep%d%s-iso period %d start %d.%d\n", urb->dev->devpath, stream->bEndpointAddress & 0x0f, (stream->bEndpointAddress & USB_DIR_IN) ? "in" : "out", @@ -4725,7 +4719,7 @@ static bool itd_complete(struct fotg210_hcd *fotg210, struct fotg210_itd *itd) if (unlikely(list_is_singular(&stream->td_list))) { fotg210_to_hcd(fotg210)->self.bandwidth_allocated -= stream->bandwidth; - fotg210_vdbg(fotg210, + fotg210_dbg(fotg210, "deschedule devp %s ep%d%s-iso\n", dev->devpath, stream->bEndpointAddress & 0x0f, (stream->bEndpointAddress & USB_DIR_IN) ? "in" : "out"); -- cgit v1.1 From c793d08ecd944b1a180c6712bb47825e37cc0626 Mon Sep 17 00:00:00 2001 From: Oliver Neukum Date: Mon, 18 Nov 2013 13:23:17 +0100 Subject: USB: kill #undef VERBOSE_DEBUG It is useless now. Straight removal. Signed-off-by: Oliver Neukum Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/fotg210-hcd.c | 1 - 1 file changed, 1 deletion(-) (limited to 'drivers/usb/host/fotg210-hcd.c') diff --git a/drivers/usb/host/fotg210-hcd.c b/drivers/usb/host/fotg210-hcd.c index 070582b..97d6939 100644 --- a/drivers/usb/host/fotg210-hcd.c +++ b/drivers/usb/host/fotg210-hcd.c @@ -56,7 +56,6 @@ static const char hcd_name[] = "fotg210_hcd"; -#undef VERBOSE_DEBUG #undef FOTG210_URB_TRACE #define FOTG210_STATS -- cgit v1.1 From 3c9740a117d40a74412775b5d3fe2b88a7635a0e Mon Sep 17 00:00:00 2001 From: Peter Chen Date: Tue, 5 Nov 2013 10:46:02 +0800 Subject: usb: hcd: move controller wakeup setting initialization to individual driver Individual controller driver has different requirement for wakeup setting, so move it from core to itself. In order to align with current etting the default wakeup setting is enabled (except for chipidea host). Pass compile test with below commands: make O=outout/all allmodconfig make -j$CPU_NUM O=outout/all drivers/usb Signed-off-by: Peter Chen Acked-by: Alan Stern Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/fotg210-hcd.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/usb/host/fotg210-hcd.c') diff --git a/drivers/usb/host/fotg210-hcd.c b/drivers/usb/host/fotg210-hcd.c index 97d6939..98a89d1 100644 --- a/drivers/usb/host/fotg210-hcd.c +++ b/drivers/usb/host/fotg210-hcd.c @@ -5889,6 +5889,7 @@ static int fotg210_hcd_probe(struct platform_device *pdev) dev_err(dev, "failed to add hcd with err %d\n", retval); goto fail_add_hcd; } + device_wakeup_enable(hcd->self.controller); return retval; -- cgit v1.1