Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1512c91f authored by Xenia Ragiadakou's avatar Xenia Ragiadakou Committed by Greg Kroah-Hartman
Browse files

ehci: enable debugging code when CONFIG_DYNAMIC_DEBUG is set



The debugging code for ehci is enabled to run if the DEBUG flag is defined.
This patch enables the debugging code also when the kernel is configured
with dynamic debugging on.

Signed-off-by: default avatarXenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent fea26ef0
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -18,7 +18,7 @@


/* this file is part of ehci-hcd.c */
/* this file is part of ehci-hcd.c */


#ifdef	DEBUG
#if defined(DEBUG) || defined(CONFIG_DYNAMIC_DEBUG)


/* check the values in the HCSPARAMS register
/* check the values in the HCSPARAMS register
 * (host controller _Structural_ parameters)
 * (host controller _Structural_ parameters)
@@ -62,7 +62,7 @@ static inline void dbg_hcs_params (struct ehci_hcd *ehci, char *label) {}


#endif
#endif


#ifdef	DEBUG
#if defined(DEBUG) || defined(CONFIG_DYNAMIC_DEBUG)


/* check the values in the HCCPARAMS register
/* check the values in the HCCPARAMS register
 * (host controller _Capability_ parameters)
 * (host controller _Capability_ parameters)
@@ -101,7 +101,7 @@ static inline void dbg_hcc_params (struct ehci_hcd *ehci, char *label) {}


#endif
#endif


#ifdef	DEBUG
#if defined(DEBUG) || defined(CONFIG_DYNAMIC_DEBUG)


static void __maybe_unused
static void __maybe_unused
dbg_qtd (const char *label, struct ehci_hcd *ehci, struct ehci_qtd *qtd)
dbg_qtd (const char *label, struct ehci_hcd *ehci, struct ehci_qtd *qtd)
@@ -301,7 +301,7 @@ static inline int __maybe_unused
dbg_port_buf (char *buf, unsigned len, const char *label, int port, u32 status)
dbg_port_buf (char *buf, unsigned len, const char *label, int port, u32 status)
{ return 0; }
{ return 0; }


#endif	/* DEBUG */
#endif	/* DEBUG || CONFIG_DYNAMIC_DEBUG */


/* functions have the "wrong" filename when they're output... */
/* functions have the "wrong" filename when they're output... */
#define dbg_status(ehci, label, status) { \
#define dbg_status(ehci, label, status) { \
+1 −1
Original line number Original line Diff line number Diff line
@@ -418,7 +418,7 @@ static int ehci_fsl_mpc512x_drv_suspend(struct device *dev)
	struct fsl_usb2_platform_data *pdata = dev_get_platdata(dev);
	struct fsl_usb2_platform_data *pdata = dev_get_platdata(dev);
	u32 tmp;
	u32 tmp;


#ifdef DEBUG
#if defined(DEBUG) || defined(CONFIG_DYNAMIC_DEBUG)
	u32 mode = ehci_readl(ehci, hcd->regs + FSL_SOC_USB_USBMODE);
	u32 mode = ehci_readl(ehci, hcd->regs + FSL_SOC_USB_USBMODE);
	mode &= USBMODE_CM_MASK;
	mode &= USBMODE_CM_MASK;
	tmp = ehci_readl(ehci, hcd->regs + 0x140);	/* usbcmd */
	tmp = ehci_readl(ehci, hcd->regs + 0x140);	/* usbcmd */
+3 −3
Original line number Original line Diff line number Diff line
@@ -1300,7 +1300,7 @@ static int __init ehci_hcd_init(void)
		 sizeof(struct ehci_qh), sizeof(struct ehci_qtd),
		 sizeof(struct ehci_qh), sizeof(struct ehci_qtd),
		 sizeof(struct ehci_itd), sizeof(struct ehci_sitd));
		 sizeof(struct ehci_itd), sizeof(struct ehci_sitd));


#ifdef DEBUG
#if defined(DEBUG) || defined(CONFIG_DYNAMIC_DEBUG)
	ehci_debug_root = debugfs_create_dir("ehci", usb_debug_root);
	ehci_debug_root = debugfs_create_dir("ehci", usb_debug_root);
	if (!ehci_debug_root) {
	if (!ehci_debug_root) {
		retval = -ENOENT;
		retval = -ENOENT;
@@ -1349,7 +1349,7 @@ static int __init ehci_hcd_init(void)
	platform_driver_unregister(&PLATFORM_DRIVER);
	platform_driver_unregister(&PLATFORM_DRIVER);
clean0:
clean0:
#endif
#endif
#ifdef DEBUG
#if defined(DEBUG) || defined(CONFIG_DYNAMIC_DEBUG)
	debugfs_remove(ehci_debug_root);
	debugfs_remove(ehci_debug_root);
	ehci_debug_root = NULL;
	ehci_debug_root = NULL;
err_debug:
err_debug:
@@ -1373,7 +1373,7 @@ static void __exit ehci_hcd_cleanup(void)
#ifdef PS3_SYSTEM_BUS_DRIVER
#ifdef PS3_SYSTEM_BUS_DRIVER
	ps3_ehci_driver_unregister(&PS3_SYSTEM_BUS_DRIVER);
	ps3_ehci_driver_unregister(&PS3_SYSTEM_BUS_DRIVER);
#endif
#endif
#ifdef DEBUG
#if defined(DEBUG) || defined(CONFIG_DYNAMIC_DEBUG)
	debugfs_remove(ehci_debug_root);
	debugfs_remove(ehci_debug_root);
#endif
#endif
	clear_bit(USB_EHCI_LOADED, &usb_hcds_loaded);
	clear_bit(USB_EHCI_LOADED, &usb_hcds_loaded);
+2 −2
Original line number Original line Diff line number Diff line
@@ -168,13 +168,13 @@ static void ehci_clear_tt_buffer(struct ehci_hcd *ehci, struct ehci_qh *qh,
	 * Note: this routine is never called for Isochronous transfers.
	 * Note: this routine is never called for Isochronous transfers.
	 */
	 */
	if (urb->dev->tt && !usb_pipeint(urb->pipe) && !qh->clearing_tt) {
	if (urb->dev->tt && !usb_pipeint(urb->pipe) && !qh->clearing_tt) {
#ifdef DEBUG
#if defined(DEBUG) || defined(CONFIG_DYNAMIC_DEBUG)
		struct usb_device *tt = urb->dev->tt->hub;
		struct usb_device *tt = urb->dev->tt->hub;
		dev_dbg(&tt->dev,
		dev_dbg(&tt->dev,
			"clear tt buffer port %d, a%d ep%d t%08x\n",
			"clear tt buffer port %d, a%d ep%d t%08x\n",
			urb->dev->ttport, urb->dev->devnum,
			urb->dev->ttport, urb->dev->devnum,
			usb_pipeendpoint(urb->pipe), token);
			usb_pipeendpoint(urb->pipe), token);
#endif /* DEBUG */
#endif /* DEBUG || CONFIG_DYNAMIC_DEBUG */
		if (!ehci_is_TDI(ehci)
		if (!ehci_is_TDI(ehci)
				|| urb->dev->tt->hub !=
				|| urb->dev->tt->hub !=
				   ehci_to_hcd(ehci)->self.root_hub) {
				   ehci_to_hcd(ehci)->self.root_hub) {
+1 −1
Original line number Original line Diff line number Diff line
@@ -169,7 +169,7 @@ periodic_usecs (struct ehci_hcd *ehci, unsigned frame, unsigned uframe)
			break;
			break;
		}
		}
	}
	}
#ifdef	DEBUG
#if defined(DEBUG) || defined(CONFIG_DYNAMIC_DEBUG)
	if (usecs > ehci->uframe_periodic_max)
	if (usecs > ehci->uframe_periodic_max)
		ehci_err (ehci, "uframe %d sched overrun: %d usecs\n",
		ehci_err (ehci, "uframe %d sched overrun: %d usecs\n",
			frame * 8 + uframe, usecs);
			frame * 8 + uframe, usecs);
Loading