All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] Allow xHCI drivers to be built as separate modules
@ 2014-07-10  1:05 Andrew Bresticker
  2014-07-10  1:05   ` Andrew Bresticker
                   ` (4 more replies)
  0 siblings, 5 replies; 18+ messages in thread
From: Andrew Bresticker @ 2014-07-10  1:05 UTC (permalink / raw
  To: Greg Kroah-Hartman, Mathias Nyman, Alan Stern, Julius Werner,
	linux-usb, linux-kernel
  Cc: linux-tegra, Andrew Bresticker

It was suggested in the review of the Tegra xHCI driver [1] that we
allow xHCI drivers to be built as individual modules (like EHCI) instead
of building them all into the single xhci-hcd module as they are today.

Patches 1-3 prepare for making the xHCI PCI and platform drivers able
to be built as individual modules and patch 4 actually creates the 3
separate modules (core, platform, PCI).

Based on 3.16-rc4.

[1] http://patchwork.ozlabs.org/patch/361265/

Andrew Bresticker (4):
  xhci: Introduce xhci_init_driver()
  xhci: Check for XHCI_COMP_MODE_QUIRK when disabling D3cold
  xhci: Export symbols used by host-controller drivers
  xhci: Allow xHCI drivers to be built as separate modules

 drivers/usb/host/Kconfig     |  5 +++
 drivers/usb/host/Makefile    | 10 ++---
 drivers/usb/host/xhci-dbg.c  |  1 +
 drivers/usb/host/xhci-pci.c  | 80 +++++++-----------------------------
 drivers/usb/host/xhci-plat.c | 69 +++++--------------------------
 drivers/usb/host/xhci.c      | 96 +++++++++++++++++++++++++++++++++-----------
 drivers/usb/host/xhci.h      | 23 +----------
 7 files changed, 111 insertions(+), 173 deletions(-)

-- 
2.0.0.526.g5318336


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 1/4] xhci: Introduce xhci_init_driver()
@ 2014-07-10  1:05   ` Andrew Bresticker
  0 siblings, 0 replies; 18+ messages in thread
From: Andrew Bresticker @ 2014-07-10  1:05 UTC (permalink / raw
  To: Greg Kroah-Hartman, Mathias Nyman, Alan Stern, Julius Werner,
	linux-usb, linux-kernel
  Cc: linux-tegra, Andrew Bresticker

Since the struct hc_driver is mostly the same across the xhci-pci,
xhci-plat, and the upcoming xhci-tegra driver, introduce the function
xhci_init_driver() which will populate the hc_driver with the default
xHCI operations.  The caller must supply a setup function which will
be used as the hc_driver's reset callback.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
---
 drivers/usb/host/xhci-pci.c  | 69 +++++---------------------------------------
 drivers/usb/host/xhci-plat.c | 60 +++-----------------------------------
 drivers/usb/host/xhci.c      | 68 +++++++++++++++++++++++++++++++++++++++++++
 drivers/usb/host/xhci.h      |  1 +
 4 files changed, 80 insertions(+), 118 deletions(-)

diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
index e20520f..97648e4 100644
--- a/drivers/usb/host/xhci-pci.c
+++ b/drivers/usb/host/xhci-pci.c
@@ -40,6 +40,8 @@
 
 static const char hcd_name[] = "xhci_hcd";
 
+static struct hc_driver __read_mostly xhci_pci_hc_driver;
+
 /* called after powerup, by probe or system-pm "wakeup" */
 static int xhci_pci_reinit(struct xhci_hcd *xhci, struct pci_dev *pdev)
 {
@@ -313,68 +315,6 @@ static int xhci_pci_resume(struct usb_hcd *hcd, bool hibernated)
 }
 #endif /* CONFIG_PM */
 
-static const struct hc_driver xhci_pci_hc_driver = {
-	.description =		hcd_name,
-	.product_desc =		"xHCI Host Controller",
-	.hcd_priv_size =	sizeof(struct xhci_hcd *),
-
-	/*
-	 * generic hardware linkage
-	 */
-	.irq =			xhci_irq,
-	.flags =		HCD_MEMORY | HCD_USB3 | HCD_SHARED,
-
-	/*
-	 * basic lifecycle operations
-	 */
-	.reset =		xhci_pci_setup,
-	.start =		xhci_run,
-#ifdef CONFIG_PM
-	.pci_suspend =          xhci_pci_suspend,
-	.pci_resume =           xhci_pci_resume,
-#endif
-	.stop =			xhci_stop,
-	.shutdown =		xhci_shutdown,
-
-	/*
-	 * managing i/o requests and associated device resources
-	 */
-	.urb_enqueue =		xhci_urb_enqueue,
-	.urb_dequeue =		xhci_urb_dequeue,
-	.alloc_dev =		xhci_alloc_dev,
-	.free_dev =		xhci_free_dev,
-	.alloc_streams =	xhci_alloc_streams,
-	.free_streams =		xhci_free_streams,
-	.add_endpoint =		xhci_add_endpoint,
-	.drop_endpoint =	xhci_drop_endpoint,
-	.endpoint_reset =	xhci_endpoint_reset,
-	.check_bandwidth =	xhci_check_bandwidth,
-	.reset_bandwidth =	xhci_reset_bandwidth,
-	.address_device =	xhci_address_device,
-	.enable_device =	xhci_enable_device,
-	.update_hub_device =	xhci_update_hub_device,
-	.reset_device =		xhci_discover_or_reset_device,
-
-	/*
-	 * scheduling support
-	 */
-	.get_frame_number =	xhci_get_frame,
-
-	/* Root hub support */
-	.hub_control =		xhci_hub_control,
-	.hub_status_data =	xhci_hub_status_data,
-	.bus_suspend =		xhci_bus_suspend,
-	.bus_resume =		xhci_bus_resume,
-	/*
-	 * call back when device connected and addressed
-	 */
-	.update_device =        xhci_update_device,
-	.set_usb2_hw_lpm =	xhci_set_usb2_hardware_lpm,
-	.enable_usb3_lpm_timeout =	xhci_enable_usb3_lpm_timeout,
-	.disable_usb3_lpm_timeout =	xhci_disable_usb3_lpm_timeout,
-	.find_raw_port_number =	xhci_find_raw_port_number,
-};
-
 /*-------------------------------------------------------------------------*/
 
 /* PCI driver selection metadata; PCI hotplugging uses this */
@@ -406,6 +346,11 @@ static struct pci_driver xhci_pci_driver = {
 
 int __init xhci_register_pci(void)
 {
+	xhci_init_driver(&xhci_pci_hc_driver, xhci_pci_setup);
+#ifdef CONFIG_PM
+	xhci_pci_hc_driver.pci_suspend = xhci_pci_suspend;
+	xhci_pci_hc_driver.pci_resume = xhci_pci_resume;
+#endif
 	return pci_register_driver(&xhci_pci_driver);
 }
 
diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
index 29d8adb..49799db 100644
--- a/drivers/usb/host/xhci-plat.c
+++ b/drivers/usb/host/xhci-plat.c
@@ -21,6 +21,8 @@
 #include "xhci.h"
 #include "xhci-mvebu.h"
 
+static struct hc_driver __read_mostly xhci_plat_hc_driver;
+
 static void xhci_plat_quirks(struct device *dev, struct xhci_hcd *xhci)
 {
 	/*
@@ -37,61 +39,6 @@ static int xhci_plat_setup(struct usb_hcd *hcd)
 	return xhci_gen_setup(hcd, xhci_plat_quirks);
 }
 
-static int xhci_plat_start(struct usb_hcd *hcd)
-{
-	return xhci_run(hcd);
-}
-
-static const struct hc_driver xhci_plat_xhci_driver = {
-	.description =		"xhci-hcd",
-	.product_desc =		"xHCI Host Controller",
-	.hcd_priv_size =	sizeof(struct xhci_hcd *),
-
-	/*
-	 * generic hardware linkage
-	 */
-	.irq =			xhci_irq,
-	.flags =		HCD_MEMORY | HCD_USB3 | HCD_SHARED,
-
-	/*
-	 * basic lifecycle operations
-	 */
-	.reset =		xhci_plat_setup,
-	.start =		xhci_plat_start,
-	.stop =			xhci_stop,
-	.shutdown =		xhci_shutdown,
-
-	/*
-	 * managing i/o requests and associated device resources
-	 */
-	.urb_enqueue =		xhci_urb_enqueue,
-	.urb_dequeue =		xhci_urb_dequeue,
-	.alloc_dev =		xhci_alloc_dev,
-	.free_dev =		xhci_free_dev,
-	.alloc_streams =	xhci_alloc_streams,
-	.free_streams =		xhci_free_streams,
-	.add_endpoint =		xhci_add_endpoint,
-	.drop_endpoint =	xhci_drop_endpoint,
-	.endpoint_reset =	xhci_endpoint_reset,
-	.check_bandwidth =	xhci_check_bandwidth,
-	.reset_bandwidth =	xhci_reset_bandwidth,
-	.address_device =	xhci_address_device,
-	.enable_device =	xhci_enable_device,
-	.update_hub_device =	xhci_update_hub_device,
-	.reset_device =		xhci_discover_or_reset_device,
-
-	/*
-	 * scheduling support
-	 */
-	.get_frame_number =	xhci_get_frame,
-
-	/* Root hub support */
-	.hub_control =		xhci_hub_control,
-	.hub_status_data =	xhci_hub_status_data,
-	.bus_suspend =		xhci_bus_suspend,
-	.bus_resume =		xhci_bus_resume,
-};
-
 static int xhci_plat_probe(struct platform_device *pdev)
 {
 	const struct hc_driver	*driver;
@@ -105,7 +52,7 @@ static int xhci_plat_probe(struct platform_device *pdev)
 	if (usb_disabled())
 		return -ENODEV;
 
-	driver = &xhci_plat_xhci_driver;
+	driver = &xhci_plat_hc_driver;
 
 	irq = platform_get_irq(pdev, 0);
 	if (irq < 0)
@@ -288,6 +235,7 @@ MODULE_ALIAS("platform:xhci-hcd");
 
 int xhci_register_plat(void)
 {
+	xhci_init_driver(&xhci_plat_hc_driver, xhci_plat_setup);
 	return platform_driver_register(&usb_xhci_driver);
 }
 
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 7436d5f..8de75b7 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -4873,6 +4873,74 @@ error:
 	return retval;
 }
 
+static const struct hc_driver xhci_hc_driver = {
+	.description =		"xhci-hcd",
+	.product_desc =		"xHCI Host Controller",
+	.hcd_priv_size =	sizeof(struct xhci_hcd *),
+
+	/*
+	 * generic hardware linkage
+	 */
+	.irq =			xhci_irq,
+	.flags =		HCD_MEMORY | HCD_USB3 | HCD_SHARED,
+
+	/*
+	 * basic lifecycle operations
+	 */
+	.reset =		NULL, /* set in xhci_init_driver() */
+	.start =		xhci_run,
+	.stop =			xhci_stop,
+	.shutdown =		xhci_shutdown,
+
+	/*
+	 * managing i/o requests and associated device resources
+	 */
+	.urb_enqueue =		xhci_urb_enqueue,
+	.urb_dequeue =		xhci_urb_dequeue,
+	.alloc_dev =		xhci_alloc_dev,
+	.free_dev =		xhci_free_dev,
+	.alloc_streams =	xhci_alloc_streams,
+	.free_streams =		xhci_free_streams,
+	.add_endpoint =		xhci_add_endpoint,
+	.drop_endpoint =	xhci_drop_endpoint,
+	.endpoint_reset =	xhci_endpoint_reset,
+	.check_bandwidth =	xhci_check_bandwidth,
+	.reset_bandwidth =	xhci_reset_bandwidth,
+	.address_device =	xhci_address_device,
+	.enable_device =	xhci_enable_device,
+	.update_hub_device =	xhci_update_hub_device,
+	.reset_device =		xhci_discover_or_reset_device,
+
+	/*
+	 * scheduling support
+	 */
+	.get_frame_number =	xhci_get_frame,
+
+	/*
+	 * root hub support
+	 */
+	.hub_control =		xhci_hub_control,
+	.hub_status_data =	xhci_hub_status_data,
+	.bus_suspend =		xhci_bus_suspend,
+	.bus_resume =		xhci_bus_resume,
+
+	/*
+	 * call back when device connected and addressed
+	 */
+	.update_device =        xhci_update_device,
+	.set_usb2_hw_lpm =	xhci_set_usb2_hardware_lpm,
+	.enable_usb3_lpm_timeout =	xhci_enable_usb3_lpm_timeout,
+	.disable_usb3_lpm_timeout =	xhci_disable_usb3_lpm_timeout,
+	.find_raw_port_number =	xhci_find_raw_port_number,
+};
+
+void xhci_init_driver(struct hc_driver *drv, int (*setup_fn)(struct usb_hcd *))
+{
+	*drv = xhci_hc_driver;
+	drv->reset = setup_fn;
+}
+EXPORT_SYMBOL_GPL(xhci_init_driver);
+
 MODULE_DESCRIPTION(DRIVER_DESC);
 MODULE_AUTHOR(DRIVER_AUTHOR);
 MODULE_LICENSE("GPL");
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index 9ffecd5..0d9b2cf 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -1760,6 +1760,7 @@ int xhci_run(struct usb_hcd *hcd);
 void xhci_stop(struct usb_hcd *hcd);
 void xhci_shutdown(struct usb_hcd *hcd);
 int xhci_gen_setup(struct usb_hcd *hcd, xhci_get_quirks_t get_quirks);
+void xhci_init_driver(struct hc_driver *drv, int (*setup_fn)(struct usb_hcd *));
 
 #ifdef	CONFIG_PM
 int xhci_suspend(struct xhci_hcd *xhci);
-- 
2.0.0.526.g5318336


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 1/4] xhci: Introduce xhci_init_driver()
@ 2014-07-10  1:05   ` Andrew Bresticker
  0 siblings, 0 replies; 18+ messages in thread
From: Andrew Bresticker @ 2014-07-10  1:05 UTC (permalink / raw
  To: Greg Kroah-Hartman, Mathias Nyman, Alan Stern, Julius Werner,
	linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA
  Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA, Andrew Bresticker

Since the struct hc_driver is mostly the same across the xhci-pci,
xhci-plat, and the upcoming xhci-tegra driver, introduce the function
xhci_init_driver() which will populate the hc_driver with the default
xHCI operations.  The caller must supply a setup function which will
be used as the hc_driver's reset callback.

Signed-off-by: Andrew Bresticker <abrestic-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
---
 drivers/usb/host/xhci-pci.c  | 69 +++++---------------------------------------
 drivers/usb/host/xhci-plat.c | 60 +++-----------------------------------
 drivers/usb/host/xhci.c      | 68 +++++++++++++++++++++++++++++++++++++++++++
 drivers/usb/host/xhci.h      |  1 +
 4 files changed, 80 insertions(+), 118 deletions(-)

diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
index e20520f..97648e4 100644
--- a/drivers/usb/host/xhci-pci.c
+++ b/drivers/usb/host/xhci-pci.c
@@ -40,6 +40,8 @@
 
 static const char hcd_name[] = "xhci_hcd";
 
+static struct hc_driver __read_mostly xhci_pci_hc_driver;
+
 /* called after powerup, by probe or system-pm "wakeup" */
 static int xhci_pci_reinit(struct xhci_hcd *xhci, struct pci_dev *pdev)
 {
@@ -313,68 +315,6 @@ static int xhci_pci_resume(struct usb_hcd *hcd, bool hibernated)
 }
 #endif /* CONFIG_PM */
 
-static const struct hc_driver xhci_pci_hc_driver = {
-	.description =		hcd_name,
-	.product_desc =		"xHCI Host Controller",
-	.hcd_priv_size =	sizeof(struct xhci_hcd *),
-
-	/*
-	 * generic hardware linkage
-	 */
-	.irq =			xhci_irq,
-	.flags =		HCD_MEMORY | HCD_USB3 | HCD_SHARED,
-
-	/*
-	 * basic lifecycle operations
-	 */
-	.reset =		xhci_pci_setup,
-	.start =		xhci_run,
-#ifdef CONFIG_PM
-	.pci_suspend =          xhci_pci_suspend,
-	.pci_resume =           xhci_pci_resume,
-#endif
-	.stop =			xhci_stop,
-	.shutdown =		xhci_shutdown,
-
-	/*
-	 * managing i/o requests and associated device resources
-	 */
-	.urb_enqueue =		xhci_urb_enqueue,
-	.urb_dequeue =		xhci_urb_dequeue,
-	.alloc_dev =		xhci_alloc_dev,
-	.free_dev =		xhci_free_dev,
-	.alloc_streams =	xhci_alloc_streams,
-	.free_streams =		xhci_free_streams,
-	.add_endpoint =		xhci_add_endpoint,
-	.drop_endpoint =	xhci_drop_endpoint,
-	.endpoint_reset =	xhci_endpoint_reset,
-	.check_bandwidth =	xhci_check_bandwidth,
-	.reset_bandwidth =	xhci_reset_bandwidth,
-	.address_device =	xhci_address_device,
-	.enable_device =	xhci_enable_device,
-	.update_hub_device =	xhci_update_hub_device,
-	.reset_device =		xhci_discover_or_reset_device,
-
-	/*
-	 * scheduling support
-	 */
-	.get_frame_number =	xhci_get_frame,
-
-	/* Root hub support */
-	.hub_control =		xhci_hub_control,
-	.hub_status_data =	xhci_hub_status_data,
-	.bus_suspend =		xhci_bus_suspend,
-	.bus_resume =		xhci_bus_resume,
-	/*
-	 * call back when device connected and addressed
-	 */
-	.update_device =        xhci_update_device,
-	.set_usb2_hw_lpm =	xhci_set_usb2_hardware_lpm,
-	.enable_usb3_lpm_timeout =	xhci_enable_usb3_lpm_timeout,
-	.disable_usb3_lpm_timeout =	xhci_disable_usb3_lpm_timeout,
-	.find_raw_port_number =	xhci_find_raw_port_number,
-};
-
 /*-------------------------------------------------------------------------*/
 
 /* PCI driver selection metadata; PCI hotplugging uses this */
@@ -406,6 +346,11 @@ static struct pci_driver xhci_pci_driver = {
 
 int __init xhci_register_pci(void)
 {
+	xhci_init_driver(&xhci_pci_hc_driver, xhci_pci_setup);
+#ifdef CONFIG_PM
+	xhci_pci_hc_driver.pci_suspend = xhci_pci_suspend;
+	xhci_pci_hc_driver.pci_resume = xhci_pci_resume;
+#endif
 	return pci_register_driver(&xhci_pci_driver);
 }
 
diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
index 29d8adb..49799db 100644
--- a/drivers/usb/host/xhci-plat.c
+++ b/drivers/usb/host/xhci-plat.c
@@ -21,6 +21,8 @@
 #include "xhci.h"
 #include "xhci-mvebu.h"
 
+static struct hc_driver __read_mostly xhci_plat_hc_driver;
+
 static void xhci_plat_quirks(struct device *dev, struct xhci_hcd *xhci)
 {
 	/*
@@ -37,61 +39,6 @@ static int xhci_plat_setup(struct usb_hcd *hcd)
 	return xhci_gen_setup(hcd, xhci_plat_quirks);
 }
 
-static int xhci_plat_start(struct usb_hcd *hcd)
-{
-	return xhci_run(hcd);
-}
-
-static const struct hc_driver xhci_plat_xhci_driver = {
-	.description =		"xhci-hcd",
-	.product_desc =		"xHCI Host Controller",
-	.hcd_priv_size =	sizeof(struct xhci_hcd *),
-
-	/*
-	 * generic hardware linkage
-	 */
-	.irq =			xhci_irq,
-	.flags =		HCD_MEMORY | HCD_USB3 | HCD_SHARED,
-
-	/*
-	 * basic lifecycle operations
-	 */
-	.reset =		xhci_plat_setup,
-	.start =		xhci_plat_start,
-	.stop =			xhci_stop,
-	.shutdown =		xhci_shutdown,
-
-	/*
-	 * managing i/o requests and associated device resources
-	 */
-	.urb_enqueue =		xhci_urb_enqueue,
-	.urb_dequeue =		xhci_urb_dequeue,
-	.alloc_dev =		xhci_alloc_dev,
-	.free_dev =		xhci_free_dev,
-	.alloc_streams =	xhci_alloc_streams,
-	.free_streams =		xhci_free_streams,
-	.add_endpoint =		xhci_add_endpoint,
-	.drop_endpoint =	xhci_drop_endpoint,
-	.endpoint_reset =	xhci_endpoint_reset,
-	.check_bandwidth =	xhci_check_bandwidth,
-	.reset_bandwidth =	xhci_reset_bandwidth,
-	.address_device =	xhci_address_device,
-	.enable_device =	xhci_enable_device,
-	.update_hub_device =	xhci_update_hub_device,
-	.reset_device =		xhci_discover_or_reset_device,
-
-	/*
-	 * scheduling support
-	 */
-	.get_frame_number =	xhci_get_frame,
-
-	/* Root hub support */
-	.hub_control =		xhci_hub_control,
-	.hub_status_data =	xhci_hub_status_data,
-	.bus_suspend =		xhci_bus_suspend,
-	.bus_resume =		xhci_bus_resume,
-};
-
 static int xhci_plat_probe(struct platform_device *pdev)
 {
 	const struct hc_driver	*driver;
@@ -105,7 +52,7 @@ static int xhci_plat_probe(struct platform_device *pdev)
 	if (usb_disabled())
 		return -ENODEV;
 
-	driver = &xhci_plat_xhci_driver;
+	driver = &xhci_plat_hc_driver;
 
 	irq = platform_get_irq(pdev, 0);
 	if (irq < 0)
@@ -288,6 +235,7 @@ MODULE_ALIAS("platform:xhci-hcd");
 
 int xhci_register_plat(void)
 {
+	xhci_init_driver(&xhci_plat_hc_driver, xhci_plat_setup);
 	return platform_driver_register(&usb_xhci_driver);
 }
 
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 7436d5f..8de75b7 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -4873,6 +4873,74 @@ error:
 	return retval;
 }
 
+static const struct hc_driver xhci_hc_driver = {
+	.description =		"xhci-hcd",
+	.product_desc =		"xHCI Host Controller",
+	.hcd_priv_size =	sizeof(struct xhci_hcd *),
+
+	/*
+	 * generic hardware linkage
+	 */
+	.irq =			xhci_irq,
+	.flags =		HCD_MEMORY | HCD_USB3 | HCD_SHARED,
+
+	/*
+	 * basic lifecycle operations
+	 */
+	.reset =		NULL, /* set in xhci_init_driver() */
+	.start =		xhci_run,
+	.stop =			xhci_stop,
+	.shutdown =		xhci_shutdown,
+
+	/*
+	 * managing i/o requests and associated device resources
+	 */
+	.urb_enqueue =		xhci_urb_enqueue,
+	.urb_dequeue =		xhci_urb_dequeue,
+	.alloc_dev =		xhci_alloc_dev,
+	.free_dev =		xhci_free_dev,
+	.alloc_streams =	xhci_alloc_streams,
+	.free_streams =		xhci_free_streams,
+	.add_endpoint =		xhci_add_endpoint,
+	.drop_endpoint =	xhci_drop_endpoint,
+	.endpoint_reset =	xhci_endpoint_reset,
+	.check_bandwidth =	xhci_check_bandwidth,
+	.reset_bandwidth =	xhci_reset_bandwidth,
+	.address_device =	xhci_address_device,
+	.enable_device =	xhci_enable_device,
+	.update_hub_device =	xhci_update_hub_device,
+	.reset_device =		xhci_discover_or_reset_device,
+
+	/*
+	 * scheduling support
+	 */
+	.get_frame_number =	xhci_get_frame,
+
+	/*
+	 * root hub support
+	 */
+	.hub_control =		xhci_hub_control,
+	.hub_status_data =	xhci_hub_status_data,
+	.bus_suspend =		xhci_bus_suspend,
+	.bus_resume =		xhci_bus_resume,
+
+	/*
+	 * call back when device connected and addressed
+	 */
+	.update_device =        xhci_update_device,
+	.set_usb2_hw_lpm =	xhci_set_usb2_hardware_lpm,
+	.enable_usb3_lpm_timeout =	xhci_enable_usb3_lpm_timeout,
+	.disable_usb3_lpm_timeout =	xhci_disable_usb3_lpm_timeout,
+	.find_raw_port_number =	xhci_find_raw_port_number,
+};
+
+void xhci_init_driver(struct hc_driver *drv, int (*setup_fn)(struct usb_hcd *))
+{
+	*drv = xhci_hc_driver;
+	drv->reset = setup_fn;
+}
+EXPORT_SYMBOL_GPL(xhci_init_driver);
+
 MODULE_DESCRIPTION(DRIVER_DESC);
 MODULE_AUTHOR(DRIVER_AUTHOR);
 MODULE_LICENSE("GPL");
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index 9ffecd5..0d9b2cf 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -1760,6 +1760,7 @@ int xhci_run(struct usb_hcd *hcd);
 void xhci_stop(struct usb_hcd *hcd);
 void xhci_shutdown(struct usb_hcd *hcd);
 int xhci_gen_setup(struct usb_hcd *hcd, xhci_get_quirks_t get_quirks);
+void xhci_init_driver(struct hc_driver *drv, int (*setup_fn)(struct usb_hcd *));
 
 #ifdef	CONFIG_PM
 int xhci_suspend(struct xhci_hcd *xhci);
-- 
2.0.0.526.g5318336

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 2/4] xhci: Check for XHCI_COMP_MODE_QUIRK when disabling D3cold
  2014-07-10  1:05 [PATCH 0/4] Allow xHCI drivers to be built as separate modules Andrew Bresticker
  2014-07-10  1:05   ` Andrew Bresticker
@ 2014-07-10  1:05 ` Andrew Bresticker
  2014-07-10  1:05   ` Andrew Bresticker
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 18+ messages in thread
From: Andrew Bresticker @ 2014-07-10  1:05 UTC (permalink / raw
  To: Greg Kroah-Hartman, Mathias Nyman, Alan Stern, Julius Werner,
	linux-usb, linux-kernel
  Cc: linux-tegra, Andrew Bresticker

Instead of calling xhci_compliance_mode_recovery_timer_quirk_check() again
in the PCI suspend path, just check for XHCI_COMP_MODE_QUIRK which will
have been set based on xhci_compliance_mode_recovery_timer_quirk_check()
in xhci_init().

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
---
 drivers/usb/host/xhci-pci.c | 2 +-
 drivers/usb/host/xhci.c     | 3 ++-
 drivers/usb/host/xhci.h     | 3 ---
 3 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
index 97648e4..d06ffe7 100644
--- a/drivers/usb/host/xhci-pci.c
+++ b/drivers/usb/host/xhci-pci.c
@@ -277,7 +277,7 @@ static int xhci_pci_suspend(struct usb_hcd *hcd, bool do_wakeup)
 	 * Systems with the TI redriver that loses port status change events
 	 * need to have the registers polled during D3, so avoid D3cold.
 	 */
-	if (xhci_compliance_mode_recovery_timer_quirk_check())
+	if (xhci->quirks & XHCI_COMP_MODE_QUIRK)
 		pdev->no_d3cold = true;
 
 	return xhci_suspend(xhci);
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 8de75b7..f681087 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -491,7 +491,7 @@ static void compliance_mode_recovery_timer_init(struct xhci_hcd *xhci)
  * Systems:
  * Vendor: Hewlett-Packard -> System Models: Z420, Z620 and Z820
  */
-bool xhci_compliance_mode_recovery_timer_quirk_check(void)
+static bool xhci_compliance_mode_recovery_timer_quirk_check(void)
 {
 	const char *dmi_product_name, *dmi_sys_vendor;
 
@@ -4936,6 +4936,7 @@ static const struct hc_driver xhci_hc_driver = {
 
 void xhci_init_driver(struct hc_driver *drv, int (*setup_fn)(struct usb_hcd *))
 {
+	BUG_ON(!setup_fn);
 	*drv = xhci_hc_driver;
 	drv->reset = setup_fn;
 }
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index 0d9b2cf..902f55b 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -1886,7 +1886,4 @@ struct xhci_input_control_ctx *xhci_get_input_control_ctx(struct xhci_hcd *xhci,
 struct xhci_slot_ctx *xhci_get_slot_ctx(struct xhci_hcd *xhci, struct xhci_container_ctx *ctx);
 struct xhci_ep_ctx *xhci_get_ep_ctx(struct xhci_hcd *xhci, struct xhci_container_ctx *ctx, unsigned int ep_index);
 
-/* xHCI quirks */
-bool xhci_compliance_mode_recovery_timer_quirk_check(void);
-
 #endif /* __LINUX_XHCI_HCD_H */
-- 
2.0.0.526.g5318336


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 3/4] xhci: Export symbols used by host-controller drivers
@ 2014-07-10  1:05   ` Andrew Bresticker
  0 siblings, 0 replies; 18+ messages in thread
From: Andrew Bresticker @ 2014-07-10  1:05 UTC (permalink / raw
  To: Greg Kroah-Hartman, Mathias Nyman, Alan Stern, Julius Werner,
	linux-usb, linux-kernel
  Cc: linux-tegra, Andrew Bresticker

In preparation for allowing the xHCI host controller drivers to be built
as separate modules, export symbols from the xHCI core that may be used
by the host controller drivers.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
---
 drivers/usb/host/xhci-dbg.c | 1 +
 drivers/usb/host/xhci.c     | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/drivers/usb/host/xhci-dbg.c b/drivers/usb/host/xhci-dbg.c
index eb009a4..bb89175 100644
--- a/drivers/usb/host/xhci-dbg.c
+++ b/drivers/usb/host/xhci-dbg.c
@@ -594,3 +594,4 @@ void xhci_dbg_trace(struct xhci_hcd *xhci, void (*trace)(struct va_format *),
 	trace(&vaf);
 	va_end(args);
 }
+EXPORT_SYMBOL_GPL(xhci_dbg_trace);
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index f681087..4958a60 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -927,6 +927,7 @@ int xhci_suspend(struct xhci_hcd *xhci)
 
 	return rc;
 }
+EXPORT_SYMBOL_GPL(xhci_suspend);
 
 /*
  * start xHC (not bus-specific)
@@ -1078,6 +1079,7 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated)
 
 	return retval;
 }
+EXPORT_SYMBOL_GPL(xhci_resume);
 #endif	/* CONFIG_PM */
 
 /*-------------------------------------------------------------------------*/
@@ -4872,6 +4874,7 @@ error:
 	kfree(xhci);
 	return retval;
 }
+EXPORT_SYMBOL_GPL(xhci_gen_setup);
 
 static const struct hc_driver xhci_hc_driver = {
 	.description =		"xhci-hcd",
-- 
2.0.0.526.g5318336


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 3/4] xhci: Export symbols used by host-controller drivers
@ 2014-07-10  1:05   ` Andrew Bresticker
  0 siblings, 0 replies; 18+ messages in thread
From: Andrew Bresticker @ 2014-07-10  1:05 UTC (permalink / raw
  To: Greg Kroah-Hartman, Mathias Nyman, Alan Stern, Julius Werner,
	linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA
  Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA, Andrew Bresticker

In preparation for allowing the xHCI host controller drivers to be built
as separate modules, export symbols from the xHCI core that may be used
by the host controller drivers.

Signed-off-by: Andrew Bresticker <abrestic-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
---
 drivers/usb/host/xhci-dbg.c | 1 +
 drivers/usb/host/xhci.c     | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/drivers/usb/host/xhci-dbg.c b/drivers/usb/host/xhci-dbg.c
index eb009a4..bb89175 100644
--- a/drivers/usb/host/xhci-dbg.c
+++ b/drivers/usb/host/xhci-dbg.c
@@ -594,3 +594,4 @@ void xhci_dbg_trace(struct xhci_hcd *xhci, void (*trace)(struct va_format *),
 	trace(&vaf);
 	va_end(args);
 }
+EXPORT_SYMBOL_GPL(xhci_dbg_trace);
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index f681087..4958a60 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -927,6 +927,7 @@ int xhci_suspend(struct xhci_hcd *xhci)
 
 	return rc;
 }
+EXPORT_SYMBOL_GPL(xhci_suspend);
 
 /*
  * start xHC (not bus-specific)
@@ -1078,6 +1079,7 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated)
 
 	return retval;
 }
+EXPORT_SYMBOL_GPL(xhci_resume);
 #endif	/* CONFIG_PM */
 
 /*-------------------------------------------------------------------------*/
@@ -4872,6 +4874,7 @@ error:
 	kfree(xhci);
 	return retval;
 }
+EXPORT_SYMBOL_GPL(xhci_gen_setup);
 
 static const struct hc_driver xhci_hc_driver = {
 	.description =		"xhci-hcd",
-- 
2.0.0.526.g5318336

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 4/4] xhci: Allow xHCI drivers to be built as separate modules
  2014-07-10  1:05 [PATCH 0/4] Allow xHCI drivers to be built as separate modules Andrew Bresticker
                   ` (2 preceding siblings ...)
  2014-07-10  1:05   ` Andrew Bresticker
@ 2014-07-10  1:05 ` Andrew Bresticker
  2014-07-10 18:34     ` Julius Werner
  2014-07-21 23:41   ` Andrew Bresticker
  4 siblings, 1 reply; 18+ messages in thread
From: Andrew Bresticker @ 2014-07-10  1:05 UTC (permalink / raw
  To: Greg Kroah-Hartman, Mathias Nyman, Alan Stern, Julius Werner,
	linux-usb, linux-kernel
  Cc: linux-tegra, Andrew Bresticker

Instead of building all of the xHCI code into a single module, separate
it out into the core (xhci-hcd), PCI (xhci-pci, now selected by the new
config option CONFIG_USB_XHCI_PCI), and platform (xhci-plat) drivers.
Also update the PCI/platform drivers with module descriptions/licenses
and have them register their respective drivers in their initcalls.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
---
 drivers/usb/host/Kconfig     |  5 +++++
 drivers/usb/host/Makefile    | 10 +++++-----
 drivers/usb/host/xhci-pci.c  |  9 +++++++--
 drivers/usb/host/xhci-plat.c |  9 +++++++--
 drivers/usb/host/xhci.c      | 22 ----------------------
 drivers/usb/host/xhci.h      | 19 -------------------
 6 files changed, 24 insertions(+), 50 deletions(-)

diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 03314f8..aea6a13 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -26,6 +26,11 @@ config USB_XHCI_HCD
 
 if USB_XHCI_HCD
 
+config USB_XHCI_PCI
+       tristate
+       depends on PCI
+       default y
+
 config USB_XHCI_PLATFORM
 	tristate
 
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
index af89a90..bafba71 100644
--- a/drivers/usb/host/Makefile
+++ b/drivers/usb/host/Makefile
@@ -15,19 +15,19 @@ fhci-$(CONFIG_FHCI_DEBUG) += fhci-dbg.o
 xhci-hcd-y := xhci.o xhci-mem.o
 xhci-hcd-y += xhci-ring.o xhci-hub.o xhci-dbg.o
 xhci-hcd-y += xhci-trace.o
-xhci-hcd-$(CONFIG_PCI)	+= xhci-pci.o
 
-ifneq ($(CONFIG_USB_XHCI_PLATFORM), )
-	xhci-hcd-y		+= xhci-plat.o
+xhci-plat-hcd-y := xhci-plat.o
 ifneq ($(CONFIG_USB_XHCI_MVEBU), )
-	xhci-hcd-y		+= xhci-mvebu.o
-endif
+	xhci-plat-hcd-y		+= xhci-mvebu.o
 endif
 
 obj-$(CONFIG_USB_WHCI_HCD)	+= whci/
 
 obj-$(CONFIG_PCI)		+= pci-quirks.o
 
+obj-$(CONFIG_USB_XHCI_PCI)	+= xhci-pci.o
+obj-$(CONFIG_USB_XHCI_PLATFORM) += xhci-plat-hcd.o
+
 obj-$(CONFIG_USB_EHCI_HCD)	+= ehci-hcd.o
 obj-$(CONFIG_USB_EHCI_PCI)	+= ehci-pci.o
 obj-$(CONFIG_USB_EHCI_HCD_PLATFORM)	+= ehci-platform.o
diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
index d06ffe7..fbfd4a7 100644
--- a/drivers/usb/host/xhci-pci.c
+++ b/drivers/usb/host/xhci-pci.c
@@ -344,7 +344,7 @@ static struct pci_driver xhci_pci_driver = {
 #endif
 };
 
-int __init xhci_register_pci(void)
+static int __init xhci_pci_init(void)
 {
 	xhci_init_driver(&xhci_pci_hc_driver, xhci_pci_setup);
 #ifdef CONFIG_PM
@@ -353,8 +353,13 @@ int __init xhci_register_pci(void)
 #endif
 	return pci_register_driver(&xhci_pci_driver);
 }
+module_init(xhci_pci_init);
 
-void xhci_unregister_pci(void)
+static void __exit xhci_pci_exit(void)
 {
 	pci_unregister_driver(&xhci_pci_driver);
 }
+module_exit(xhci_pci_exit);
+
+MODULE_DESCRIPTION("xHCI PCI Host Controller Driver");
+MODULE_LICENSE("GPL");
diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
index 49799db..c324408 100644
--- a/drivers/usb/host/xhci-plat.c
+++ b/drivers/usb/host/xhci-plat.c
@@ -233,13 +233,18 @@ static struct platform_driver usb_xhci_driver = {
 };
 MODULE_ALIAS("platform:xhci-hcd");
 
-int xhci_register_plat(void)
+static int __init xhci_plat_init(void)
 {
 	xhci_init_driver(&xhci_plat_hc_driver, xhci_plat_setup);
 	return platform_driver_register(&usb_xhci_driver);
 }
+module_init(xhci_plat_init);
 
-void xhci_unregister_plat(void)
+static void __exit xhci_plat_exit(void)
 {
 	platform_driver_unregister(&usb_xhci_driver);
 }
+module_exit(xhci_plat_exit);
+
+MODULE_DESCRIPTION("xHCI Platform Host Controller Driver");
+MODULE_LICENSE("GPL");
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 4958a60..3f32b5a 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -4951,18 +4951,6 @@ MODULE_LICENSE("GPL");
 
 static int __init xhci_hcd_init(void)
 {
-	int retval;
-
-	retval = xhci_register_pci();
-	if (retval < 0) {
-		pr_debug("Problem registering PCI driver.\n");
-		return retval;
-	}
-	retval = xhci_register_plat();
-	if (retval < 0) {
-		pr_debug("Problem registering platform driver.\n");
-		goto unreg_pci;
-	}
 	/*
 	 * Check the compiler generated sizes of structures that must be laid
 	 * out in specific ways for hardware access.
@@ -4981,15 +4969,5 @@ static int __init xhci_hcd_init(void)
 	/* xhci_run_regs has eight fields and embeds 128 xhci_intr_regs */
 	BUILD_BUG_ON(sizeof(struct xhci_run_regs) != (8+8*128)*32/8);
 	return 0;
-unreg_pci:
-	xhci_unregister_pci();
-	return retval;
 }
 module_init(xhci_hcd_init);
-
-static void __exit xhci_hcd_cleanup(void)
-{
-	xhci_unregister_pci();
-	xhci_unregister_plat();
-}
-module_exit(xhci_hcd_cleanup);
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index 902f55b..ac03d22 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -1729,25 +1729,6 @@ void xhci_urb_free_priv(struct xhci_hcd *xhci, struct urb_priv *urb_priv);
 void xhci_free_command(struct xhci_hcd *xhci,
 		struct xhci_command *command);
 
-#ifdef CONFIG_PCI
-/* xHCI PCI glue */
-int xhci_register_pci(void);
-void xhci_unregister_pci(void);
-#else
-static inline int xhci_register_pci(void) { return 0; }
-static inline void xhci_unregister_pci(void) {}
-#endif
-
-#if IS_ENABLED(CONFIG_USB_XHCI_PLATFORM)
-int xhci_register_plat(void);
-void xhci_unregister_plat(void);
-#else
-static inline int xhci_register_plat(void)
-{ return 0; }
-static inline void xhci_unregister_plat(void)
-{  }
-#endif
-
 /* xHCI host controller glue */
 typedef void (*xhci_get_quirks_t)(struct device *, struct xhci_hcd *);
 int xhci_handshake(struct xhci_hcd *xhci, void __iomem *ptr,
-- 
2.0.0.526.g5318336


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [PATCH 4/4] xhci: Allow xHCI drivers to be built as separate modules
@ 2014-07-10 18:34     ` Julius Werner
  0 siblings, 0 replies; 18+ messages in thread
From: Julius Werner @ 2014-07-10 18:34 UTC (permalink / raw
  To: Andrew Bresticker
  Cc: Greg Kroah-Hartman, Mathias Nyman, Alan Stern, Julius Werner,
	linux-usb@vger.kernel.org, LKML, linux-tegra

> diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
> index af89a90..bafba71 100644
> --- a/drivers/usb/host/Makefile
> +++ b/drivers/usb/host/Makefile
> @@ -15,19 +15,19 @@ fhci-$(CONFIG_FHCI_DEBUG) += fhci-dbg.o
>  xhci-hcd-y := xhci.o xhci-mem.o
>  xhci-hcd-y += xhci-ring.o xhci-hub.o xhci-dbg.o
>  xhci-hcd-y += xhci-trace.o
> -xhci-hcd-$(CONFIG_PCI) += xhci-pci.o
>
> -ifneq ($(CONFIG_USB_XHCI_PLATFORM), )
> -       xhci-hcd-y              += xhci-plat.o
> +xhci-plat-hcd-y := xhci-plat.o
>  ifneq ($(CONFIG_USB_XHCI_MVEBU), )
> -       xhci-hcd-y              += xhci-mvebu.o
> -endif

nit: Can do this even simpler now, just
"xhci-plat-hcd-$(CONFIG_USB_XHCI_MVEBU) += xhci-mvebu.o" without the
ifneq.

> +       xhci-plat-hcd-y         += xhci-mvebu.o
>  endif
>
>  obj-$(CONFIG_USB_WHCI_HCD)     += whci/
>
>  obj-$(CONFIG_PCI)              += pci-quirks.o
>
> +obj-$(CONFIG_USB_XHCI_PCI)     += xhci-pci.o
> +obj-$(CONFIG_USB_XHCI_PLATFORM) += xhci-plat-hcd.o
> +
>  obj-$(CONFIG_USB_EHCI_HCD)     += ehci-hcd.o
>  obj-$(CONFIG_USB_EHCI_PCI)     += ehci-pci.o
>  obj-$(CONFIG_USB_EHCI_HCD_PLATFORM)    += ehci-platform.o

Great patch series, thank you!

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 4/4] xhci: Allow xHCI drivers to be built as separate modules
@ 2014-07-10 18:34     ` Julius Werner
  0 siblings, 0 replies; 18+ messages in thread
From: Julius Werner @ 2014-07-10 18:34 UTC (permalink / raw
  To: Andrew Bresticker
  Cc: Greg Kroah-Hartman, Mathias Nyman, Alan Stern, Julius Werner,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, LKML,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA

> diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
> index af89a90..bafba71 100644
> --- a/drivers/usb/host/Makefile
> +++ b/drivers/usb/host/Makefile
> @@ -15,19 +15,19 @@ fhci-$(CONFIG_FHCI_DEBUG) += fhci-dbg.o
>  xhci-hcd-y := xhci.o xhci-mem.o
>  xhci-hcd-y += xhci-ring.o xhci-hub.o xhci-dbg.o
>  xhci-hcd-y += xhci-trace.o
> -xhci-hcd-$(CONFIG_PCI) += xhci-pci.o
>
> -ifneq ($(CONFIG_USB_XHCI_PLATFORM), )
> -       xhci-hcd-y              += xhci-plat.o
> +xhci-plat-hcd-y := xhci-plat.o
>  ifneq ($(CONFIG_USB_XHCI_MVEBU), )
> -       xhci-hcd-y              += xhci-mvebu.o
> -endif

nit: Can do this even simpler now, just
"xhci-plat-hcd-$(CONFIG_USB_XHCI_MVEBU) += xhci-mvebu.o" without the
ifneq.

> +       xhci-plat-hcd-y         += xhci-mvebu.o
>  endif
>
>  obj-$(CONFIG_USB_WHCI_HCD)     += whci/
>
>  obj-$(CONFIG_PCI)              += pci-quirks.o
>
> +obj-$(CONFIG_USB_XHCI_PCI)     += xhci-pci.o
> +obj-$(CONFIG_USB_XHCI_PLATFORM) += xhci-plat-hcd.o
> +
>  obj-$(CONFIG_USB_EHCI_HCD)     += ehci-hcd.o
>  obj-$(CONFIG_USB_EHCI_PCI)     += ehci-pci.o
>  obj-$(CONFIG_USB_EHCI_HCD_PLATFORM)    += ehci-platform.o

Great patch series, thank you!
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 4/4] xhci: Allow xHCI drivers to be built as separate modules
@ 2014-07-14 17:20       ` Andrew Bresticker
  0 siblings, 0 replies; 18+ messages in thread
From: Andrew Bresticker @ 2014-07-14 17:20 UTC (permalink / raw
  To: Julius Werner
  Cc: Greg Kroah-Hartman, Mathias Nyman, Alan Stern,
	linux-usb@vger.kernel.org, LKML, linux-tegra@vger.kernel.org

On Thu, Jul 10, 2014 at 11:34 AM, Julius Werner <jwerner@chromium.org> wrote:
>> diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
>> index af89a90..bafba71 100644
>> --- a/drivers/usb/host/Makefile
>> +++ b/drivers/usb/host/Makefile
>> @@ -15,19 +15,19 @@ fhci-$(CONFIG_FHCI_DEBUG) += fhci-dbg.o
>>  xhci-hcd-y := xhci.o xhci-mem.o
>>  xhci-hcd-y += xhci-ring.o xhci-hub.o xhci-dbg.o
>>  xhci-hcd-y += xhci-trace.o
>> -xhci-hcd-$(CONFIG_PCI) += xhci-pci.o
>>
>> -ifneq ($(CONFIG_USB_XHCI_PLATFORM), )
>> -       xhci-hcd-y              += xhci-plat.o
>> +xhci-plat-hcd-y := xhci-plat.o
>>  ifneq ($(CONFIG_USB_XHCI_MVEBU), )
>> -       xhci-hcd-y              += xhci-mvebu.o
>> -endif
>
> nit: Can do this even simpler now, just
> "xhci-plat-hcd-$(CONFIG_USB_XHCI_MVEBU) += xhci-mvebu.o" without the
> ifneq.

Nope - since CONFIG_USB_XHCI_MVEBU can be 'y' or 'm' we need the ifneq
here (which matches against both) to ensure xhci-mvebu.o is built is
part of xhci-plat-hcd.o.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 4/4] xhci: Allow xHCI drivers to be built as separate modules
@ 2014-07-14 17:20       ` Andrew Bresticker
  0 siblings, 0 replies; 18+ messages in thread
From: Andrew Bresticker @ 2014-07-14 17:20 UTC (permalink / raw
  To: Julius Werner
  Cc: Greg Kroah-Hartman, Mathias Nyman, Alan Stern,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, LKML,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org

On Thu, Jul 10, 2014 at 11:34 AM, Julius Werner <jwerner-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> wrote:
>> diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
>> index af89a90..bafba71 100644
>> --- a/drivers/usb/host/Makefile
>> +++ b/drivers/usb/host/Makefile
>> @@ -15,19 +15,19 @@ fhci-$(CONFIG_FHCI_DEBUG) += fhci-dbg.o
>>  xhci-hcd-y := xhci.o xhci-mem.o
>>  xhci-hcd-y += xhci-ring.o xhci-hub.o xhci-dbg.o
>>  xhci-hcd-y += xhci-trace.o
>> -xhci-hcd-$(CONFIG_PCI) += xhci-pci.o
>>
>> -ifneq ($(CONFIG_USB_XHCI_PLATFORM), )
>> -       xhci-hcd-y              += xhci-plat.o
>> +xhci-plat-hcd-y := xhci-plat.o
>>  ifneq ($(CONFIG_USB_XHCI_MVEBU), )
>> -       xhci-hcd-y              += xhci-mvebu.o
>> -endif
>
> nit: Can do this even simpler now, just
> "xhci-plat-hcd-$(CONFIG_USB_XHCI_MVEBU) += xhci-mvebu.o" without the
> ifneq.

Nope - since CONFIG_USB_XHCI_MVEBU can be 'y' or 'm' we need the ifneq
here (which matches against both) to ensure xhci-mvebu.o is built is
part of xhci-plat-hcd.o.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 4/4] xhci: Allow xHCI drivers to be built as separate modules
@ 2014-07-14 18:36         ` Julius Werner
  0 siblings, 0 replies; 18+ messages in thread
From: Julius Werner @ 2014-07-14 18:36 UTC (permalink / raw
  To: Andrew Bresticker
  Cc: Julius Werner, Greg Kroah-Hartman, Mathias Nyman, Alan Stern,
	linux-usb@vger.kernel.org, LKML, linux-tegra@vger.kernel.org

> Nope - since CONFIG_USB_XHCI_MVEBU can be 'y' or 'm' we need the ifneq
> here (which matches against both) to ensure xhci-mvebu.o is built is
> part of xhci-plat-hcd.o.

Oh... does it make sense to have it tristate at all, then? Looks like
was never really buildable as an independent module (and still won't
be after this patch), so I bet that was just a mistake when the
Kconfig for it was first written that should be fixed. (Ideally,
xhci-plat.c should probably go away in favor of dwc3/host.c and
xhci-mvebu.c implementing the wrapper to xhci_init_driver() directly,
but that is a longer-term goal.)

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 4/4] xhci: Allow xHCI drivers to be built as separate modules
@ 2014-07-14 18:36         ` Julius Werner
  0 siblings, 0 replies; 18+ messages in thread
From: Julius Werner @ 2014-07-14 18:36 UTC (permalink / raw
  To: Andrew Bresticker
  Cc: Julius Werner, Greg Kroah-Hartman, Mathias Nyman, Alan Stern,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, LKML,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org

> Nope - since CONFIG_USB_XHCI_MVEBU can be 'y' or 'm' we need the ifneq
> here (which matches against both) to ensure xhci-mvebu.o is built is
> part of xhci-plat-hcd.o.

Oh... does it make sense to have it tristate at all, then? Looks like
was never really buildable as an independent module (and still won't
be after this patch), so I bet that was just a mistake when the
Kconfig for it was first written that should be fixed. (Ideally,
xhci-plat.c should probably go away in favor of dwc3/host.c and
xhci-mvebu.c implementing the wrapper to xhci_init_driver() directly,
but that is a longer-term goal.)

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 4/4] xhci: Allow xHCI drivers to be built as separate modules
@ 2014-07-14 18:50           ` Andrew Bresticker
  0 siblings, 0 replies; 18+ messages in thread
From: Andrew Bresticker @ 2014-07-14 18:50 UTC (permalink / raw
  To: Julius Werner
  Cc: Greg Kroah-Hartman, Mathias Nyman, Alan Stern,
	linux-usb@vger.kernel.org, LKML, linux-tegra@vger.kernel.org,
	gregory.clement

+Gregory

On Mon, Jul 14, 2014 at 11:36 AM, Julius Werner <jwerner@chromium.org> wrote:
>> Nope - since CONFIG_USB_XHCI_MVEBU can be 'y' or 'm' we need the ifneq
>> here (which matches against both) to ensure xhci-mvebu.o is built is
>> part of xhci-plat-hcd.o.
>
> Oh... does it make sense to have it tristate at all, then? Looks like
> was never really buildable as an independent module (and still won't
> be after this patch), so I bet that was just a mistake when the
> Kconfig for it was first written that should be fixed.

Making it a bool wouldn't really be accurate either since it could
still be built as part of the xhci-plat-hcd loadable module.  Gregory,
do you have a preference?  I could also re-spin making xhci-mvebu and
independently-loadable module.

> (Ideally, xhci-plat.c should probably go away in favor of dwc3/host.c
> and xhci-mvebu.c implementing the wrapper to xhci_init_driver()
> directly, but that is a longer-term goal.)

Well I don't think xhci-plat can ever go away (it's possible that
there are XHCI platform devices that need no extra platform-specific
setup), but yes, I agree that dwc3 and xhci-mvebu should be converted
over to use xhci_init_driver().

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 4/4] xhci: Allow xHCI drivers to be built as separate modules
@ 2014-07-14 18:50           ` Andrew Bresticker
  0 siblings, 0 replies; 18+ messages in thread
From: Andrew Bresticker @ 2014-07-14 18:50 UTC (permalink / raw
  To: Julius Werner
  Cc: Greg Kroah-Hartman, Mathias Nyman, Alan Stern,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, LKML,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	gregory.clement-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8

+Gregory

On Mon, Jul 14, 2014 at 11:36 AM, Julius Werner <jwerner-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> wrote:
>> Nope - since CONFIG_USB_XHCI_MVEBU can be 'y' or 'm' we need the ifneq
>> here (which matches against both) to ensure xhci-mvebu.o is built is
>> part of xhci-plat-hcd.o.
>
> Oh... does it make sense to have it tristate at all, then? Looks like
> was never really buildable as an independent module (and still won't
> be after this patch), so I bet that was just a mistake when the
> Kconfig for it was first written that should be fixed.

Making it a bool wouldn't really be accurate either since it could
still be built as part of the xhci-plat-hcd loadable module.  Gregory,
do you have a preference?  I could also re-spin making xhci-mvebu and
independently-loadable module.

> (Ideally, xhci-plat.c should probably go away in favor of dwc3/host.c
> and xhci-mvebu.c implementing the wrapper to xhci_init_driver()
> directly, but that is a longer-term goal.)

Well I don't think xhci-plat can ever go away (it's possible that
there are XHCI platform devices that need no extra platform-specific
setup), but yes, I agree that dwc3 and xhci-mvebu should be converted
over to use xhci_init_driver().

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 0/4] Allow xHCI drivers to be built as separate modules
@ 2014-07-21 23:41   ` Andrew Bresticker
  0 siblings, 0 replies; 18+ messages in thread
From: Andrew Bresticker @ 2014-07-21 23:41 UTC (permalink / raw
  To: Greg Kroah-Hartman, Mathias Nyman, Alan Stern, Julius Werner,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	Stephen Warren, Thierry Reding, gregory.clement
  Cc: linux-tegra@vger.kernel.org, Andrew Bresticker

On Wed, Jul 9, 2014 at 6:05 PM, Andrew Bresticker <abrestic@chromium.org> wrote:
> It was suggested in the review of the Tegra xHCI driver [1] that we
> allow xHCI drivers to be built as individual modules (like EHCI) instead
> of building them all into the single xhci-hcd module as they are today.
>
> Patches 1-3 prepare for making the xHCI PCI and platform drivers able
> to be built as individual modules and patch 4 actually creates the 3
> separate modules (core, platform, PCI).
>
> Based on 3.16-rc4.
>
> [1] http://patchwork.ozlabs.org/patch/361265/
>
> Andrew Bresticker (4):
>   xhci: Introduce xhci_init_driver()
>   xhci: Check for XHCI_COMP_MODE_QUIRK when disabling D3cold
>   xhci: Export symbols used by host-controller drivers
>   xhci: Allow xHCI drivers to be built as separate modules

Ping.  I was hoping to get these in for 3.17 (though it may be too
late now...) as they're a dependency for the upcoming Tegra XHCI
driver.

Thanks!
Andrew

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 0/4] Allow xHCI drivers to be built as separate modules
@ 2014-07-21 23:41   ` Andrew Bresticker
  0 siblings, 0 replies; 18+ messages in thread
From: Andrew Bresticker @ 2014-07-21 23:41 UTC (permalink / raw
  To: Greg Kroah-Hartman, Mathias Nyman, Alan Stern, Julius Werner,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Stephen Warren, Thierry Reding,
	gregory.clement-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8
  Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Andrew Bresticker

On Wed, Jul 9, 2014 at 6:05 PM, Andrew Bresticker <abrestic-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> wrote:
> It was suggested in the review of the Tegra xHCI driver [1] that we
> allow xHCI drivers to be built as individual modules (like EHCI) instead
> of building them all into the single xhci-hcd module as they are today.
>
> Patches 1-3 prepare for making the xHCI PCI and platform drivers able
> to be built as individual modules and patch 4 actually creates the 3
> separate modules (core, platform, PCI).
>
> Based on 3.16-rc4.
>
> [1] http://patchwork.ozlabs.org/patch/361265/
>
> Andrew Bresticker (4):
>   xhci: Introduce xhci_init_driver()
>   xhci: Check for XHCI_COMP_MODE_QUIRK when disabling D3cold
>   xhci: Export symbols used by host-controller drivers
>   xhci: Allow xHCI drivers to be built as separate modules

Ping.  I was hoping to get these in for 3.17 (though it may be too
late now...) as they're a dependency for the upcoming Tegra XHCI
driver.

Thanks!
Andrew

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 0/4] Allow xHCI drivers to be built as separate modules
  2014-07-21 23:41   ` Andrew Bresticker
  (?)
@ 2014-07-22  2:10   ` Greg Kroah-Hartman
  -1 siblings, 0 replies; 18+ messages in thread
From: Greg Kroah-Hartman @ 2014-07-22  2:10 UTC (permalink / raw
  To: Andrew Bresticker
  Cc: Mathias Nyman, Alan Stern, Julius Werner,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	Stephen Warren, Thierry Reding, gregory.clement,
	linux-tegra@vger.kernel.org

On Mon, Jul 21, 2014 at 04:41:08PM -0700, Andrew Bresticker wrote:
> On Wed, Jul 9, 2014 at 6:05 PM, Andrew Bresticker <abrestic@chromium.org> wrote:
> > It was suggested in the review of the Tegra xHCI driver [1] that we
> > allow xHCI drivers to be built as individual modules (like EHCI) instead
> > of building them all into the single xhci-hcd module as they are today.
> >
> > Patches 1-3 prepare for making the xHCI PCI and platform drivers able
> > to be built as individual modules and patch 4 actually creates the 3
> > separate modules (core, platform, PCI).
> >
> > Based on 3.16-rc4.
> >
> > [1] http://patchwork.ozlabs.org/patch/361265/
> >
> > Andrew Bresticker (4):
> >   xhci: Introduce xhci_init_driver()
> >   xhci: Check for XHCI_COMP_MODE_QUIRK when disabling D3cold
> >   xhci: Export symbols used by host-controller drivers
> >   xhci: Allow xHCI drivers to be built as separate modules
> 
> Ping.  I was hoping to get these in for 3.17 (though it may be too
> late now...) as they're a dependency for the upcoming Tegra XHCI
> driver.

That's up to Mathias, when he sends them on to me, or not...

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2014-07-22  2:10 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-10  1:05 [PATCH 0/4] Allow xHCI drivers to be built as separate modules Andrew Bresticker
2014-07-10  1:05 ` [PATCH 1/4] xhci: Introduce xhci_init_driver() Andrew Bresticker
2014-07-10  1:05   ` Andrew Bresticker
2014-07-10  1:05 ` [PATCH 2/4] xhci: Check for XHCI_COMP_MODE_QUIRK when disabling D3cold Andrew Bresticker
2014-07-10  1:05 ` [PATCH 3/4] xhci: Export symbols used by host-controller drivers Andrew Bresticker
2014-07-10  1:05   ` Andrew Bresticker
2014-07-10  1:05 ` [PATCH 4/4] xhci: Allow xHCI drivers to be built as separate modules Andrew Bresticker
2014-07-10 18:34   ` Julius Werner
2014-07-10 18:34     ` Julius Werner
2014-07-14 17:20     ` Andrew Bresticker
2014-07-14 17:20       ` Andrew Bresticker
2014-07-14 18:36       ` Julius Werner
2014-07-14 18:36         ` Julius Werner
2014-07-14 18:50         ` Andrew Bresticker
2014-07-14 18:50           ` Andrew Bresticker
2014-07-21 23:41 ` [PATCH 0/4] " Andrew Bresticker
2014-07-21 23:41   ` Andrew Bresticker
2014-07-22  2:10   ` Greg Kroah-Hartman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.