Re: [REGRESSION] -rc7/-rc4+: unable to USB boot - enumeration partially broken (was: Linux v3.8-rc7)

2013-02-10 Thread Andreas Mohr
Hi,

On Sun, Feb 10, 2013 at 01:14:42AM +0100, Andreas Mohr wrote:
> After the reinstall I tried to get a current -rc (-rc4+) working.
> To my surprise initramfs USB boot failed, completely.
> (the tell-tale sign that it likely is a regression was that the same 3.7.0
> kernel that had been working previously, built via make oldconfig of
> the **-rc** .config and with identical commands as -rc - using make install -
> was then again found to be booting fine!)

Regression sorta confirmed now. -rc3 with a fully suitable .config does
not boot either. Will start bisection. Will take ages.

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


Re: [Bisected] [-next-20130204] usb/hcd: irq 18: nobody cared

2013-02-10 Thread Peter Hurley
On Sat, 2013-02-09 at 22:14 -0500, Peter Hurley wrote:
> On Tue, 2013-02-05 at 15:26 -0500, Alan Stern wrote:
> > On Tue, 5 Feb 2013, Peter Hurley wrote:
> > 
> > > With -next-20130204:
> > > 
> > > [   33.855570] irq 18: nobody cared (try booting with the "irqpoll" 
> > > option)
> > > [   33.855580] Pid: 0, comm: swapper/4 Not tainted 
> > > 3.8.0-next-20130204-xeon #20130204
> > > [   33.855582] Call Trace:
> > > [   33.855585][] __report_bad_irq+0x36/0xe0
> > > [   33.855600]  [] note_interrupt+0x1aa/0x200
> > > [   33.855606]  [] ? mwait_idle+0x82/0x1b0
> > > [   33.855610]  [] handle_irq_event_percpu+0xc9/0x260
> > > [   33.855614]  [] handle_irq_event+0x48/0x70
> > > [   33.855618]  [] handle_fasteoi_irq+0x5a/0x100
> > > [   33.855624]  [] handle_irq+0x22/0x40
> > > [   33.855630]  [] do_IRQ+0x5a/0xd0
> > > [   33.855636]  [] common_interrupt+0x6d/0x6d
> > > [   33.855638][] ? 
> > > rcu_eqs_enter_common+0x4a/0x320
> > > [   33.855646]  [] ? mwait_idle+0x82/0x1b0
> > > [   33.855649]  [] ? mwait_idle+0x29/0x1b0
> > > [   33.855653]  [] cpu_idle+0x116/0x130
> > > [   33.855658]  [] start_secondary+0x251/0x258
> > > [   33.855660] handlers:
> > > [   33.855664] [] usb_hcd_irq
> > > [   33.855667] Disabling IRQ #18
> > > 
> > > From earlier in the boot log:
> > > [1.297020] uhci_hcd :00:1d.2: setting latency timer to 64
> > > [1.297032] uhci_hcd :00:1d.2: UHCI Host Controller
> > > [1.297040] uhci_hcd :00:1d.2: new USB bus registered, assigned 
> > > bus number 4
> > > [1.297076] uhci_hcd :00:1d.2: irq 18, io base 0xff40
> > > [1.297213] hub 4-0:1.0: USB hub found
> > > [1.297221] hub 4-0:1.0: 2 ports detected
> > > 
> > > lsusb:
> > > ...
> > > Bus 004 Device 002: ID 0764:0501 Cyber Power System, Inc. CP1500 AVR UPS
> > > Bus 004 Device 003: ID 046d:c52b Logitech, Inc. Unifying Receiver
> 
> [...]
> 
> > If the suggestion above doesn't work out, bisection may be the best way
> > to find the answer.
> 
> This bad irq bisected to:
> 
> 4f535093cf8f6da8cfda7c36c2c1ecd2e9586ee4 is the first bad commit
> commit 4f535093cf8f6da8cfda7c36c2c1ecd2e9586ee4
> Author: Yinghai Lu 
> Date:   Mon Jan 21 13:20:52 2013 -0800
> 
> PCI: Put pci_dev in device tree as early as possible
> 
> We want to put pci_dev structs in the device tree as soon as possible so
> for_each_pci_dev() iteration will not miss them, but driver attachment
> needs to be delayed until after pci_assign_unassigned_resources() to make
> sure all devices have resources assigned first.
> 
> This patch moves device registering from pci_bus_add_devices() to
> pci_device_add(), which happens earlier, leaving driver attachment in
> pci_bus_add_devices().
> 
> It also removes unattached child bus handling in pci_bus_add_devices().
> That's not needed because child bus via pci_add_new_bus() is already
> in parent bus children list.
> 
> [bhelgaas: changelog]
> Signed-off-by: Yinghai Lu 
> Signed-off-by: Bjorn Helgaas 
> Acked-by: Rafael J. Wysocki 
> 
> :04 04 0540c98d04d00de24b4e12fa750f6cd26c5addd2 
> 2e24946cb7165a4028b7efb0a622271cc3990005 Mdrivers
> 
> All is fine if I revert these 2 commits:
> 
> 40064ac PCI: Remove unused "rc" in virtfn_add_bus()
> 4f53509 (HEAD, refs/bisect/bad) PCI: Put pci_dev in device tree as early as 
> possible
> 
> Any ideas how these are causing the USB HCD core / hid-logitech-dj
> driver to drop interrupts?

https://bugzilla.kernel.org/show_bug.cgi?id=53561

Maybe this is some interaction with all the new ACPI code and fixes
written in those 8 days.

peter@thor:~/src/kernels/next$ git log --oneline next-20130125..next-20130204 | 
grep -i acpi
65d6ce7 Merge remote-tracking branch 'acpi/next'
0d50e8c Merge branch 'acpi-pm-next' into linux-next
be6d286 PCI: acpiphp: Remove dead code for PCI host bridge hotplug
4b794a0 Merge branch 'acpi-assorted' into linux-next
bd3e4a3 Merge branch 'acpi-cleanup' into linux-next
02df734 ACPI / dock: Fix acpi_bus_get_device() check in drivers/acpi/dock.c
7217dac Merge branch 'acpi-lpss' into linux-next
4bede3f Merge branch 'acpi-pm' into linux-next
cc0755b Merge branch 'acpica' into linux-next
308b10d Merge branch 'acpi-scan' into linux-next
2ca344e PCI: acpiphp: Create companion ACPI devices before creating PCI devices
741220e cpufreq: Make acpi-cpufreq link first
c40a451 acpi-cpufreq: Do not load on K8
b378549 ACPI / PM: Do not power manage devices in unknown initial states
cfc5755 PNPACPI: Fix acpi_bus_get_device() check in drivers/pnp/pnpacpi/core.c
dde3bb4 ACPI / PM: Fix acpi_bus_get_device() check in drivers/acpi/device_pm.c
456de89 ACPI / scan: Clean up acpi_bus_get_parent()
0613e1f ACPI / scan: Fix acpi_bus_get_device() check in acpi_match_device()
141a297 ACPI / platform: Use struct acpi_scan_handler for creating devices
4daeaf6 ACPI / PCI: Make PCI IRQ link driver use struct acpi_scan_handler
00c43b9 ACPI / PCI: Make PCI root driver use struct a

Re: Linux 3.8 broken for MacBookAir5,1

2013-02-10 Thread Alan Stern
On Sun, 10 Feb 2013, Otavio Salvador wrote:

> Hello,
> 
> On Sat, Jan 12, 2013 at 8:41 PM, Otavio Salvador
>  wrote:
> > Today I tried to update my kernel from 3.7.2 to 3.8-rc3 and I had no
> > success; I used localmodconfig to generate the .config for my machine
> > but keyboard does not work.
> >
> > Using same generated .config with 3.7.2 works fine.
> >
> > Anyone has a clue about?
> 
> I finally found time to do a bisect and I found:
> 
> commit adfa79d1c06a32650332930ca4c488ca570b3407
> Author: Alan Stern 
> Date:   Thu Nov 1 11:13:04 2012 -0400
> 
> USB: EHCI: make ehci-pci a separate driver
> 
> This patch (as1625) splits the PCI portion of ehci-hcd out into its
> own separate driver module, called ehci-pci.  Consistently with the
> current practice, the decision whether to build this module is not
> user-configurable.  If EHCI and PCI are enabled then the module will
> be built, always.
> 
> Signed-off-by: Alan Stern 
> CC: Felipe Balbi 
> Signed-off-by: Greg Kroah-Hartman 
> 
> As the problem start.
> 
> I do have EHCI and PCI enabled so it should be working. Any clue about
> why it breaks it?

Perhaps your system is not loading the new ehci-pci kernel module.

Alan Stern

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


Re: Linux 3.8 broken for MacBookAir5,1

2013-02-10 Thread Otavio Salvador
On Sun, Feb 10, 2013 at 12:47 PM, Alan Stern  wrote:
> On Sun, 10 Feb 2013, Otavio Salvador wrote:
>> I do have EHCI and PCI enabled so it should be working. Any clue about
>> why it breaks it?
>
> Perhaps your system is not loading the new ehci-pci kernel module.

Yes; it should be the cause as building it built-in makes it work.
However it is a regression from my point of view.

Those are the controllers I have in my system:

00:14.0 USB controller [0c03]: Intel Corporation 7 Series/C210 Series
Chipset Family USB xHCI Host Controller [8086:1e31] (rev 04)
00:1a.0 USB controller [0c03]: Intel Corporation 7 Series/C210 Series
Chipset Family USB Enhanced Host Controller #2 [8086:1e2d] (rev 04)
00:1d.0 USB controller [0c03]: Intel Corporation 7 Series/C210 Series
Chipset Family USB Enhanced Host Controller #1 [8086:1e26] (rev 04)

I thought the ehci-pci module would be load for every ehci PCI; What
do you think?

--
Otavio Salvador O.S. Systems
E-mail: ota...@ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854  http://projetos.ossystems.com.br
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/8] usb: ehci: more bus glues as separate modules

2013-02-10 Thread manjunath . goudar
From: Manjunath Goudar 

Separate the SOC On-Chip host controller driver from ehci-hcd 
host code into its own driver module

Manjunath Goudar (8):
  USB: EHCI: make ehci-spear a separate driver
  USB: EHCI: make ehci-atmel a separate driver
  USB: EHCI: make ehci-s5p a separate driver
  USB: EHCI: make ehci-mv a separate driver
  USB: EHCI: make ehci-vt8500 a separate driver
  USB: EHCI: make ehci-msm a separate driver
  USB: EHCI: make ehci-w90X900 a separate driver
  USB: EHCI: make ehci-orion a separate driver

 drivers/usb/host/Kconfig|   42 +++--
 drivers/usb/host/Makefile   |9 ++-
 drivers/usb/host/ehci-atmel.c   |   77 ---
 drivers/usb/host/ehci-hcd.c |   52 +++-
 drivers/usb/host/ehci-msm.c |   85 +++--
 drivers/usb/host/ehci-mv.c  |   80 +++-
 drivers/usb/host/ehci-orion.c   |   91 +--
 drivers/usb/host/ehci-s5p.c |   69 -
 drivers/usb/host/ehci-spear.c   |  131 ---
 drivers/usb/host/ehci-vt8500.c  |   73 ++
 drivers/usb/host/ehci-w90x900.c |   90 ---
 drivers/usb/host/ehci.h |2 +-
 12 files changed, 392 insertions(+), 409 deletions(-)

-- 
1.7.9.5

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


[PATCH 1/8] USB: EHCI: make ehci-spear a separate driver

2013-02-10 Thread manjunath . goudar
From: Manjunath Goudar 

Separate the Spear host controller driver from ehci-hcd host code
into its own driver module.

Signed-off-by: Manjunath Goudar 
Signed-off-by: Deepak Saxena 
Cc: Greg KH 
Cc: Alan Stern 
Cc: Viresh Kumar 
Cc: Shiraz Hashim 
Cc: linux-usb@vger.kernel.org
Cc: spear-de...@list.st.com
---
 drivers/usb/host/Kconfig  |8 +++
 drivers/usb/host/Makefile |2 +-
 drivers/usb/host/ehci-hcd.c   |8 +--
 drivers/usb/host/ehci-spear.c |  131 +
 4 files changed, 78 insertions(+), 71 deletions(-)

diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 3a21c5d..15e8032 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -162,6 +162,14 @@ config USB_EHCI_HCD_OMAP
  Enables support for the on-chip EHCI controller on
  OMAP3 and later chips.
 
+config USB_EHCI_HCD_SPEAR
+tristate "Support for ST SPEAr on-chip EHCI USB controller"
+depends on USB_EHCI_HCD && PLAT_SPEAR
+default y
+---help---
+  Enables support for the on-chip EHCI controller on
+  ST SPEAr chips.
+
 config USB_EHCI_MSM
bool "Support for MSM on-chip EHCI USB controller"
depends on USB_EHCI_HCD && ARCH_MSM
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
index 001fbff..c8fcde9 100644
--- a/drivers/usb/host/Makefile
+++ b/drivers/usb/host/Makefile
@@ -27,7 +27,7 @@ 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
 obj-$(CONFIG_USB_EHCI_MXC) += ehci-mxc.o
-
+obj-$(CONFIG_USB_EHCI_HCD_SPEAR)+= ehci-spear.o
 obj-$(CONFIG_USB_OXU210HP_HCD) += oxu210hp-hcd.o
 obj-$(CONFIG_USB_ISP116X_HCD)  += isp116x-hcd.o
 obj-$(CONFIG_USB_ISP1362_HCD)  += isp1362-hcd.o
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index b416a3f..be7247b 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -1274,7 +1274,7 @@ MODULE_LICENSE ("GPL");
 
 #ifdef CONFIG_PLAT_ORION
 #include "ehci-orion.c"
-#definePLATFORM_DRIVER ehci_orion_driver
+#definePLATFORM_DRIVER ehci_orion_driver
 #endif
 
 #ifdef CONFIG_USB_W90X900_EHCI
@@ -1297,11 +1297,6 @@ MODULE_LICENSE ("GPL");
 #definePLATFORM_DRIVER vt8500_ehci_driver
 #endif
 
-#ifdef CONFIG_PLAT_SPEAR
-#include "ehci-spear.c"
-#define PLATFORM_DRIVERspear_ehci_hcd_driver
-#endif
-
 #ifdef CONFIG_USB_EHCI_MSM
 #include "ehci-msm.c"
 #define PLATFORM_DRIVERehci_msm_driver
@@ -1347,6 +1342,7 @@ MODULE_LICENSE ("GPL");
!IS_ENABLED(CONFIG_USB_CHIPIDEA_HOST) && \
!IS_ENABLED(CONFIG_USB_EHCI_MXC) && \
!defined(PLATFORM_DRIVER) && \
+   !IS_ENABLED(CONFIG_PLAT_SPEAR) && \
!defined(PS3_SYSTEM_BUS_DRIVER) && \
!defined(OF_PLATFORM_DRIVER) && \
!defined(XILINX_OF_PLATFORM_DRIVER)
diff --git a/drivers/usb/host/ehci-spear.c b/drivers/usb/host/ehci-spear.c
index 466c1bb..0d9ed11 100644
--- a/drivers/usb/host/ehci-spear.c
+++ b/drivers/usb/host/ehci-spear.c
@@ -1,5 +1,5 @@
 /*
-* Driver for EHCI HCD on SPEAR SOC
+* Driver for EHCI HCD on SPEAr SOC
 *
 * Copyright (C) 2010 ST Micro Electronics,
 * Deepak Sikri 
@@ -12,29 +12,41 @@
 */
 
 #include 
+#include 
+#include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
+#include 
+#include 
 
-struct spear_ehci {
+#include "ehci.h"
+
+#define DRIVER_DESC "EHCI SPEAr driver"
+
+static const char hcd_name[] = "ehci-SPEAr";
+
+struct SPEAr_ehci {
struct ehci_hcd ehci;
struct clk *clk;
 };
 
-#define to_spear_ehci(hcd) (struct spear_ehci *)hcd_to_ehci(hcd)
+#define to_SPEAr_ehci(hcd) (struct SPEAr_ehci *)hcd_to_ehci(hcd)
 
-static void spear_start_ehci(struct spear_ehci *ehci)
+static void SPEAr_start_ehci(struct SPEAr_ehci *ehci)
 {
clk_prepare_enable(ehci->clk);
 }
 
-static void spear_stop_ehci(struct spear_ehci *ehci)
+static void SPEAr_stop_ehci(struct SPEAr_ehci *ehci)
 {
clk_disable_unprepare(ehci->clk);
 }
 
-static int ehci_spear_setup(struct usb_hcd *hcd)
+static int ehci_SPEAr_setup(struct usb_hcd *hcd)
 {
struct ehci_hcd *ehci = hcd_to_ehci(hcd);
 
@@ -43,43 +55,10 @@ static int ehci_spear_setup(struct usb_hcd *hcd)
 
return ehci_setup(hcd);
 }
-
-static const struct hc_driver ehci_spear_hc_driver = {
-   .description= hcd_name,
-   .product_desc   = "SPEAr EHCI",
-   .hcd_priv_size  = sizeof(struct spear_ehci),
-
-   /* generic hardware linkage */
-   .irq= ehci_irq,
-   .flags  = HCD_MEMORY | HCD_USB2,
-
-   /* basic lifecycle operations */
-   .reset  = ehci_spear_setup,
-   .start  = ehci_run,
-   .stop   = ehci_stop,
-   .shutdow

[PATCH 2/8] USB: EHCI: make ehci-atmel a separate driver

2013-02-10 Thread manjunath . goudar
From: Manjunath Goudar 

Separate the Atmel host controller driver from ehci-hcd host code
into its own driver module.

Signed-off-by: Manjunath Goudar 
Cc: Alan Stern 
Cc: Greg KH 
Cc: Grant Likely 
Cc: Rob Herring 
Cc: Andrew Victor 
Cc: Nicolas Ferre 
Cc: Jean-Christophe Plagniol-Villard 
Cc: linux-usb@vger.kernel.org
Cc: linux-ker...@vger.kernel.org
---
 drivers/usb/host/Kconfig  |8 +
 drivers/usb/host/Makefile |1 +
 drivers/usb/host/ehci-atmel.c |   77 ++---
 drivers/usb/host/ehci-hcd.c   |   10 ++
 drivers/usb/host/ehci.h   |2 +-
 5 files changed, 54 insertions(+), 44 deletions(-)

diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 15e8032..1ef37d7 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -170,6 +170,14 @@ config USB_EHCI_HCD_SPEAR
   Enables support for the on-chip EHCI controller on
   ST SPEAr chips.
 
+config USB_EHCI_HCD_AT91
+tristate  "Support for Atmel on-chip EHCI USB controller"
+depends on USB_EHCI_HCD && ARCH_AT91
+default y
+---help---
+  Enables support for the on-chip EHCI controller on
+  Atmel chips.
+
 config USB_EHCI_MSM
bool "Support for MSM on-chip EHCI USB controller"
depends on USB_EHCI_HCD && ARCH_MSM
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
index c8fcde9..b301243 100644
--- a/drivers/usb/host/Makefile
+++ b/drivers/usb/host/Makefile
@@ -29,6 +29,7 @@ obj-$(CONFIG_USB_EHCI_HCD_PLATFORM)   += ehci-platform.o
 obj-$(CONFIG_USB_EHCI_MXC) += ehci-mxc.o
 obj-$(CONFIG_USB_EHCI_HCD_SPEAR)+= ehci-spear.o
 obj-$(CONFIG_USB_OXU210HP_HCD) += oxu210hp-hcd.o
+obj-$(CONFIG_USB_EHCI_HCD_AT91) += ehci-atmel.o
 obj-$(CONFIG_USB_ISP116X_HCD)  += isp116x-hcd.o
 obj-$(CONFIG_USB_ISP1362_HCD)  += isp1362-hcd.o
 obj-$(CONFIG_USB_OHCI_HCD) += ohci-hcd.o
diff --git a/drivers/usb/host/ehci-atmel.c b/drivers/usb/host/ehci-atmel.c
index 27639487..e6a50f0 100644
--- a/drivers/usb/host/ehci-atmel.c
+++ b/drivers/usb/host/ehci-atmel.c
@@ -15,6 +15,19 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "ehci.h"
+
+#define DRIVER_DESC "EHCI atmel driver"
+
+static const char hcd_name[] = "ehci-atmel";
+static struct hc_driver __read_mostly ehci_atmel_hc_driver;
 
 /* interface and function clocks */
 static struct clk *iclk, *fclk;
@@ -60,41 +73,6 @@ static int ehci_atmel_setup(struct usb_hcd *hcd)
return ehci_setup(hcd);
 }
 
-static const struct hc_driver ehci_atmel_hc_driver = {
-   .description= hcd_name,
-   .product_desc   = "Atmel EHCI UHP HS",
-   .hcd_priv_size  = sizeof(struct ehci_hcd),
-
-   /* generic hardware linkage */
-   .irq= ehci_irq,
-   .flags  = HCD_MEMORY | HCD_USB2,
-
-   /* basic lifecycle operations */
-   .reset  = ehci_atmel_setup,
-   .start  = ehci_run,
-   .stop   = ehci_stop,
-   .shutdown   = ehci_shutdown,
-
-   /* managing i/o requests and associated device resources */
-   .urb_enqueue= ehci_urb_enqueue,
-   .urb_dequeue= ehci_urb_dequeue,
-   .endpoint_disable   = ehci_endpoint_disable,
-   .endpoint_reset = ehci_endpoint_reset,
-
-   /* scheduling support */
-   .get_frame_number   = ehci_get_frame,
-
-   /* root hub support */
-   .hub_status_data= ehci_hub_status_data,
-   .hub_control= ehci_hub_control,
-   .bus_suspend= ehci_bus_suspend,
-   .bus_resume = ehci_bus_resume,
-   .relinquish_port= ehci_relinquish_port,
-   .port_handed_over   = ehci_port_handed_over,
-
-   .clear_tt_buffer_complete   = ehci_clear_tt_buffer_complete,
-};
-
 static u64 at91_ehci_dma_mask = DMA_BIT_MASK(32);
 
 static int ehci_atmel_drv_probe(struct platform_device *pdev)
@@ -210,7 +188,34 @@ static struct platform_driver ehci_atmel_driver = {
.remove = ehci_atmel_drv_remove,
.shutdown   = usb_hcd_platform_shutdown,
.driver = {
-   .name   = "atmel-ehci",
+   .name   = hcd_name,
.of_match_table = of_match_ptr(atmel_ehci_dt_ids),
},
 };
+
+static const struct ehci_driver_overrides atmel_overrides __initdata = {
+   .reset = ehci_atmel_setup,
+};
+
+static int __init ehci_atmel_init(void)
+{
+   if (usb_disabled())
+   return -ENODEV;
+
+   pr_info("%s: " DRIVER_DESC "\n", hcd_name);
+   ehci_init_driver(&ehci_atmel_hc_driver, &atmel_overrides);
+   return platform_driver_register(&ehci_atmel_driver);
+}
+module_init(ehci_atmel_init);
+
+static void __exit ehci_atmel_cleanup(void)
+{
+   platform_driver_unregister(&ehci_atmel_driver);
+}
+module_ex

[PATCH 3/8] USB: EHCI: make ehci-s5p a separate driver

2013-02-10 Thread manjunath . goudar
From: Manjunath Goudar 

Separate the s5p host controller driver from ehci-hcd host code
into its own driver module.

Signed-off-by: Manjunath Goudar 
Cc: Greg KH 
Cc: Alan Stern 
Cc: Kukjin Kim 
Cc: Kyungmin Park 
Cc: Grant Likely 
Cc: Rob Herring 
Cc: linux-usb@vger.kernel.org
---
 drivers/usb/host/Kconfig|2 +-
 drivers/usb/host/Makefile   |1 +
 drivers/usb/host/ehci-hcd.c |6 +---
 drivers/usb/host/ehci-s5p.c |   69 ---
 4 files changed, 41 insertions(+), 37 deletions(-)

diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 1ef37d7..8ffbafa 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -215,7 +215,7 @@ config USB_EHCI_SH
  If you use the PCI EHCI controller, this option is not necessary.
 
 config USB_EHCI_S5P
-   boolean "S5P EHCI support"
+   tristate "S5P EHCI support"
depends on USB_EHCI_HCD && PLAT_S5P
help
 Enable support for the S5P SOC's on-chip EHCI controller.
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
index b301243..77e0331 100644
--- a/drivers/usb/host/Makefile
+++ b/drivers/usb/host/Makefile
@@ -30,6 +30,7 @@ obj-$(CONFIG_USB_EHCI_MXC)+= ehci-mxc.o
 obj-$(CONFIG_USB_EHCI_HCD_SPEAR)+= ehci-spear.o
 obj-$(CONFIG_USB_OXU210HP_HCD) += oxu210hp-hcd.o
 obj-$(CONFIG_USB_EHCI_HCD_AT91) += ehci-atmel.o
+obj-$(CONFIG_USB_EHCI_S5P)  += ehci-s5p.o
 obj-$(CONFIG_USB_ISP116X_HCD)  += isp116x-hcd.o
 obj-$(CONFIG_USB_ISP1362_HCD)  += isp1362-hcd.o
 obj-$(CONFIG_USB_OHCI_HCD) += ohci-hcd.o
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 08e9fdf..22c50fb 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -1307,11 +1307,6 @@ MODULE_LICENSE ("GPL");
 #definePLATFORM_DRIVER ehci_hcd_msp_driver
 #endif
 
-#ifdef CONFIG_USB_EHCI_TEGRA
-#include "ehci-tegra.c"
-#define PLATFORM_DRIVERtegra_ehci_driver
-#endif
-
 #ifdef CONFIG_USB_EHCI_S5P
 #include "ehci-s5p.c"
 #define PLATFORM_DRIVERs5p_ehci_driver
@@ -1339,6 +1334,7 @@ MODULE_LICENSE ("GPL");
!defined(PLATFORM_DRIVER) && \
!IS_ENABLED(CONFIG_PLAT_SPEAR) && \
!IS_ENABLED(CONFIG_ARCH_AT91) && \
+   !IS_ENABLED(CONFIG_USB_EHCI_S5P) && \
!defined(PS3_SYSTEM_BUS_DRIVER) && \
!defined(OF_PLATFORM_DRIVER) && \
!defined(XILINX_OF_PLATFORM_DRIVER)
diff --git a/drivers/usb/host/ehci-s5p.c b/drivers/usb/host/ehci-s5p.c
index 20ebf6a..6ddf526 100644
--- a/drivers/usb/host/ehci-s5p.c
+++ b/drivers/usb/host/ehci-s5p.c
@@ -20,6 +20,17 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "ehci.h"
+
+#define DRIVER_DESC "EHCI s5p driver"
 
 #define EHCI_INSNREG00(base)   (base + 0x90)
 #define EHCI_INSNREG00_ENA_INCR16  (0x1 << 25)
@@ -30,6 +41,10 @@
(EHCI_INSNREG00_ENA_INCR16 | EHCI_INSNREG00_ENA_INCR8 | \
 EHCI_INSNREG00_ENA_INCR4 | EHCI_INSNREG00_ENA_INCRX_ALIGN)
 
+static const char hcd_name[] = "ehci-s5p";
+static struct hc_driver __read_mostly s5p_ehci_hc_driver;
+
+
 struct s5p_ehci_hcd {
struct device *dev;
struct usb_hcd *hcd;
@@ -39,36 +54,6 @@ struct s5p_ehci_hcd {
struct s5p_ehci_platdata *pdata;
 };
 
-static const struct hc_driver s5p_ehci_hc_driver = {
-   .description= hcd_name,
-   .product_desc   = "S5P EHCI Host Controller",
-   .hcd_priv_size  = sizeof(struct ehci_hcd),
-
-   .irq= ehci_irq,
-   .flags  = HCD_MEMORY | HCD_USB2,
-
-   .reset  = ehci_setup,
-   .start  = ehci_run,
-   .stop   = ehci_stop,
-   .shutdown   = ehci_shutdown,
-
-   .get_frame_number   = ehci_get_frame,
-
-   .urb_enqueue= ehci_urb_enqueue,
-   .urb_dequeue= ehci_urb_dequeue,
-   .endpoint_disable   = ehci_endpoint_disable,
-   .endpoint_reset = ehci_endpoint_reset,
-
-   .hub_status_data= ehci_hub_status_data,
-   .hub_control= ehci_hub_control,
-   .bus_suspend= ehci_bus_suspend,
-   .bus_resume = ehci_bus_resume,
-
-   .relinquish_port= ehci_relinquish_port,
-   .port_handed_over   = ehci_port_handed_over,
-
-   .clear_tt_buffer_complete   = ehci_clear_tt_buffer_complete,
-};
 
 static void s5p_ehci_phy_enable(struct s5p_ehci_hcd *s5p_ehci)
 {
@@ -322,5 +307,27 @@ static struct platform_driver s5p_ehci_driver = {
.of_match_table = of_match_ptr(exynos_ehci_match),
}
 };
+static const struct ehci_driver_overrides s5p_overrides __initdata = {
+   .reset = ehci_setup,
+};
+
+static int __init ehci_s5p_init(void)
+{
+   if (usb_disabled())
+   return -ENODEV;
+
+   pr_info(

[PATCH 6/8] USB: EHCI: make ehci-msm a separate driver

2013-02-10 Thread manjunath . goudar
From: Manjunath Goudar 

Separate the Qualcomm On-Chip host controller driver from ehci-hcd host code
into its own driver module.

Signed-off-by: Manjunath Goudar 
Cc: Greg KH 
Cc: Alan Stern 
Cc: David Brown 
Cc: Daniel Walker 
Cc: Bryan Huntsman 
Cc: Brian Swetland 
Cc: linux-usb@vger.kernel.org
Cc: linux-ker...@vger.kernel.org
---
 drivers/usb/host/Kconfig|4 +-
 drivers/usb/host/Makefile   |1 +
 drivers/usb/host/ehci-hcd.c |7 +---
 drivers/usb/host/ehci-msm.c |   85 +++
 4 files changed, 42 insertions(+), 55 deletions(-)

diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 4e15b87..751290d 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -187,7 +187,7 @@ config USB_EHCI_HCD_AT91
   Atmel chips.
 
 config USB_EHCI_MSM
-   bool "Support for MSM on-chip EHCI USB controller"
+   tristate "Support for MSM on-chip EHCI USB controller"
depends on USB_EHCI_HCD && ARCH_MSM
select USB_EHCI_ROOT_HUB_TT
select USB_MSM_OTG
@@ -203,7 +203,7 @@ config USB_EHCI_TEGRA
boolean "NVIDIA Tegra HCD support"
depends on USB_EHCI_HCD && ARCH_TEGRA
select USB_EHCI_ROOT_HUB_TT
-   help
+  --- help---
  This driver enables support for the internal USB Host Controllers
  found in NVIDIA Tegra SoCs. The controllers are EHCI compliant.
 
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
index 1fe0579..75d98b9 100644
--- a/drivers/usb/host/Makefile
+++ b/drivers/usb/host/Makefile
@@ -33,6 +33,7 @@ obj-$(CONFIG_USB_EHCI_HCD_AT91) += ehci-atmel.o
 obj-$(CONFIG_USB_EHCI_S5P)  += ehci-s5p.o
 obj-$(CONFIG_USB_EHCI_MV)   += ehci-mv.o
 obj-$(CONFIG_USB_EHCI_HCD_VT8500)+= ehci-vt8500.o
+obj-$(CONFIG_USB_EHCI_MSM)  += ehci-msm.o
 obj-$(CONFIG_USB_ISP116X_HCD)  += isp116x-hcd.o
 obj-$(CONFIG_USB_ISP1362_HCD)  += isp1362-hcd.o
 obj-$(CONFIG_USB_OHCI_HCD) += ohci-hcd.o
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 3dacac0..db5f0ce 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -1287,11 +1287,6 @@ MODULE_LICENSE ("GPL");
 #define PLATFORM_DRIVERehci_octeon_driver
 #endif
 
-#ifdef CONFIG_USB_EHCI_MSM
-#include "ehci-msm.c"
-#define PLATFORM_DRIVERehci_msm_driver
-#endif
-
 #ifdef CONFIG_TILE_USB
 #include "ehci-tilegx.c"
 #definePLATFORM_DRIVER ehci_hcd_tilegx_driver
@@ -1326,6 +1321,8 @@ MODULE_LICENSE ("GPL");
!IS_ENABLED(CONFIG_ARCH_AT91) && \
!IS_ENABLED(CONFIG_USB_EHCI_S5P) && \
!IS_ENABLED(CONFIG_USB_EHCI_MV) && \
+   !IS_ENABLED(CONFIG_ARCH_VT8500) && \
+   !IS_ENABLED(CONFIG_USB_EHCI_MSM) && \
!defined(PS3_SYSTEM_BUS_DRIVER) && \
!defined(OF_PLATFORM_DRIVER) && \
!defined(XILINX_OF_PLATFORM_DRIVER)
diff --git a/drivers/usb/host/ehci-msm.c b/drivers/usb/host/ehci-msm.c
index 88a49c8..a9a0357 100644
--- a/drivers/usb/host/ehci-msm.c
+++ b/drivers/usb/host/ehci-msm.c
@@ -26,12 +26,22 @@
 #include 
 #include 
 #include 
-
 #include 
 #include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "ehci.h"
 
 #define MSM_USB_BASE (hcd->regs)
 
+#define DRIVER_DESC "Qualcomm On-Chip EHCI Host Controller"
+
+static const char hcd_name[] = "msm_hsusb_host";
+static struct hc_driver __read_mostly msm_hc_driver;
 static struct usb_phy *phy;
 
 static int ehci_msm_reset(struct usb_hcd *hcd)
@@ -56,52 +66,6 @@ static int ehci_msm_reset(struct usb_hcd *hcd)
return 0;
 }
 
-static struct hc_driver msm_hc_driver = {
-   .description= hcd_name,
-   .product_desc   = "Qualcomm On-Chip EHCI Host Controller",
-   .hcd_priv_size  = sizeof(struct ehci_hcd),
-
-   /*
-* generic hardware linkage
-*/
-   .irq= ehci_irq,
-   .flags  = HCD_USB2 | HCD_MEMORY,
-
-   .reset  = ehci_msm_reset,
-   .start  = ehci_run,
-
-   .stop   = ehci_stop,
-   .shutdown   = ehci_shutdown,
-
-   /*
-* managing i/o requests and associated device resources
-*/
-   .urb_enqueue= ehci_urb_enqueue,
-   .urb_dequeue= ehci_urb_dequeue,
-   .endpoint_disable   = ehci_endpoint_disable,
-   .endpoint_reset = ehci_endpoint_reset,
-   .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete,
-
-   /*
-* scheduling support
-*/
-   .get_frame_number   = ehci_get_frame,
-
-   /*
-* root hub support
-*/
-   .hub_status_data= ehci_hub_status_data,
-   .hub_control= ehci_hub_control,
-   .relinquish_port= ehci_relinquish_port,
-   .port_handed_over   = ehci_port_handed_over,
-
-   /*
-* PM support
-*/
-   .bus_suspend= e

[PATCH 7/8] USB: EHCI: make ehci-w90X900 a separate driver

2013-02-10 Thread manjunath . goudar
From: Manjunath Goudar 

Separate the Nuvoton On-Chip host controller driver from ehci-hcd host code
into its own driver module.

Signed-off-by: Manjunath Goudar 
Cc: Greg KH 
Cc: Alan Stern 
Cc: Wan ZongShun 
Cc: linux-usb@vger.kernel.org
Cc: linux-ker...@vger.kernel.org
---
 drivers/usb/host/Kconfig|2 +-
 drivers/usb/host/Makefile   |1 +
 drivers/usb/host/ehci-hcd.c |   16 +++
 drivers/usb/host/ehci-w90x900.c |   90 +--
 4 files changed, 48 insertions(+), 61 deletions(-)

diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 751290d..d1d1b09 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -238,7 +238,7 @@ config USB_EHCI_MV
  only be EHCI host. OTG is controller that can switch to host mode.
 
 config USB_W90X900_EHCI
-   bool "W90X900(W90P910) EHCI support"
+tristate "W90X900(W90P910) EHCI support"
depends on USB_EHCI_HCD && ARCH_W90X900
---help---
Enables support for the W90X900 USB controller
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
index 75d98b9..e169ba1 100644
--- a/drivers/usb/host/Makefile
+++ b/drivers/usb/host/Makefile
@@ -34,6 +34,7 @@ obj-$(CONFIG_USB_EHCI_S5P)  += ehci-s5p.o
 obj-$(CONFIG_USB_EHCI_MV)   += ehci-mv.o
 obj-$(CONFIG_USB_EHCI_HCD_VT8500)+= ehci-vt8500.o
 obj-$(CONFIG_USB_EHCI_MSM)  += ehci-msm.o
+obj-$(CONFIG_USB_W90X900_EHCI)  += ehci-w90x900.o
 obj-$(CONFIG_USB_ISP116X_HCD)  += isp116x-hcd.o
 obj-$(CONFIG_USB_ISP1362_HCD)  += isp1362-hcd.o
 obj-$(CONFIG_USB_OHCI_HCD) += ohci-hcd.o
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index db5f0ce..5fab5fa 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -1272,16 +1272,6 @@ MODULE_LICENSE ("GPL");
 #define XILINX_OF_PLATFORM_DRIVER  ehci_hcd_xilinx_of_driver
 #endif
 
-#ifdef CONFIG_PLAT_ORION
-#include "ehci-orion.c"
-#definePLATFORM_DRIVER ehci_orion_driver
-#endif
-
-#ifdef CONFIG_USB_W90X900_EHCI
-#include "ehci-w90x900.c"
-#definePLATFORM_DRIVER ehci_hcd_w90x900_driver
-#endif
-
 #ifdef CONFIG_USB_OCTEON_EHCI
 #include "ehci-octeon.c"
 #define PLATFORM_DRIVERehci_octeon_driver
@@ -1292,6 +1282,11 @@ MODULE_LICENSE ("GPL");
 #definePLATFORM_DRIVER ehci_hcd_tilegx_driver
 #endif
 
+#ifdef CONFIG_PLAT_ORION
+#include "ehci-orion.c"
+#define  PLATFORM_DRIVER ehci_orion_driver
+#endif
+
 #ifdef CONFIG_USB_EHCI_HCD_PMC_MSP
 #include "ehci-pmcmsp.c"
 #definePLATFORM_DRIVER ehci_hcd_msp_driver
@@ -1323,6 +1318,7 @@ MODULE_LICENSE ("GPL");
!IS_ENABLED(CONFIG_USB_EHCI_MV) && \
!IS_ENABLED(CONFIG_ARCH_VT8500) && \
!IS_ENABLED(CONFIG_USB_EHCI_MSM) && \
+   !IS_ENABLED(CONFIG_USB_W90X900_EHCI) && \
!defined(PS3_SYSTEM_BUS_DRIVER) && \
!defined(OF_PLATFORM_DRIVER) && \
!defined(XILINX_OF_PLATFORM_DRIVER)
diff --git a/drivers/usb/host/ehci-w90x900.c b/drivers/usb/host/ehci-w90x900.c
index 59e0e24..0b677ec 100644
--- a/drivers/usb/host/ehci-w90x900.c
+++ b/drivers/usb/host/ehci-w90x900.c
@@ -13,11 +13,31 @@
 
 #include 
 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include "ehci.h"
+
 /* enable phy0 and phy1 for w90p910 */
 #defineENPHY   (0x01<<8)
 #define PHY0_CTR   (0xA4)
 #define PHY1_CTR   (0xA8)
 
+#define DRIVER_DESC "Nuvoton w90x900 On-Chip EHCI Host driver"
+
+static const char hcd_name[] = "ehci-w90x900";
+
+static struct hc_driver __read_mostly ehci_w90x900_hc_driver;
+
+static const struct ehci_driver_overrides ehci_w90X900_overrides __initdata = {
+   .reset = ehci_setup,
+};
+
 static int usb_w90x900_probe(const struct hc_driver *driver,
  struct platform_device *pdev)
 {
@@ -99,54 +119,6 @@ void usb_w90x900_remove(struct usb_hcd *hcd, struct 
platform_device *pdev)
usb_put_hcd(hcd);
 }
 
-static const struct hc_driver ehci_w90x900_hc_driver = {
-   .description = hcd_name,
-   .product_desc = "Nuvoton w90x900 EHCI Host Controller",
-   .hcd_priv_size = sizeof(struct ehci_hcd),
-
-   /*
-* generic hardware linkage
-*/
-   .irq = ehci_irq,
-   .flags = HCD_USB2|HCD_MEMORY,
-
-   /*
-* basic lifecycle operations
-*/
-   .reset = ehci_setup,
-   .start = ehci_run,
-
-   .stop = ehci_stop,
-   .shutdown = ehci_shutdown,
-
-   /*
-* managing i/o requests and associated device resources
-*/
-   .urb_enqueue = ehci_urb_enqueue,
-   .urb_dequeue = ehci_urb_dequeue,
-   .endpoint_disable = ehci_endpoint_disable,
-   .endpoint_reset = ehci_endpoint_reset,
-
-   /*
-* scheduling support
-*/
-   .get_frame_number = ehci_get_frame,
-
-   /*
-* root hub support
-*/
-   .hub_status_data = ehci_hub_sta

[PATCH 8/8] USB: EHCI: make ehci-orion a separate driver

2013-02-10 Thread manjunath . goudar
From: Manjunath Goudar 

Separate the Marvell Orion host controller driver from ehci-hcd host code
into its own driver module.

Signed-off-by: Manjunath Goudar 
Cc: Greg KH 
Cc: Alan Stern 
Cc: Jason Cooper 
Cc: Andrew Lunn 
Cc: Russell King 
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-ker...@vger.kernel.org
---
 drivers/usb/host/Kconfig  |8 
 drivers/usb/host/Makefile |1 +
 drivers/usb/host/ehci-hcd.c   |6 +--
 drivers/usb/host/ehci-orion.c |   91 +++--
 4 files changed, 53 insertions(+), 53 deletions(-)

diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index d1d1b09..18bfbfa 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -162,6 +162,14 @@ config USB_EHCI_HCD_OMAP
  Enables support for the on-chip EHCI controller on
  OMAP3 and later chips.
 
+config USB_EHCI_HCD_ORION
+tristate  "Support for Marvell Orion on-chip EHCI USB controller"
+depends on USB_EHCI_HCD && PLAT_ORION
+default y
+---help---
+  Enables support for the on-chip EHCI controller on
+  Morvell Orion chips.
+
 config USB_EHCI_HCD_VT8500
 tristate "Support for VT8500 on-chip EHCI USB controller"
 depends on USB_EHCI_HCD && ARCH_VT8500
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
index e169ba1..fe20e98 100644
--- a/drivers/usb/host/Makefile
+++ b/drivers/usb/host/Makefile
@@ -35,6 +35,7 @@ obj-$(CONFIG_USB_EHCI_MV)   += ehci-mv.o
 obj-$(CONFIG_USB_EHCI_HCD_VT8500)+= ehci-vt8500.o
 obj-$(CONFIG_USB_EHCI_MSM)  += ehci-msm.o
 obj-$(CONFIG_USB_W90X900_EHCI)  += ehci-w90x900.o
+obj-$(CONFIG_USB_EHCI_HCD_ORION)+= ehci-orion.o
 obj-$(CONFIG_USB_ISP116X_HCD)  += isp116x-hcd.o
 obj-$(CONFIG_USB_ISP1362_HCD)  += isp1362-hcd.o
 obj-$(CONFIG_USB_OHCI_HCD) += ohci-hcd.o
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 5fab5fa..4c2a795 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -1282,11 +1282,6 @@ MODULE_LICENSE ("GPL");
 #definePLATFORM_DRIVER ehci_hcd_tilegx_driver
 #endif
 
-#ifdef CONFIG_PLAT_ORION
-#include "ehci-orion.c"
-#define  PLATFORM_DRIVER ehci_orion_driver
-#endif
-
 #ifdef CONFIG_USB_EHCI_HCD_PMC_MSP
 #include "ehci-pmcmsp.c"
 #definePLATFORM_DRIVER ehci_hcd_msp_driver
@@ -1319,6 +1314,7 @@ MODULE_LICENSE ("GPL");
!IS_ENABLED(CONFIG_ARCH_VT8500) && \
!IS_ENABLED(CONFIG_USB_EHCI_MSM) && \
!IS_ENABLED(CONFIG_USB_W90X900_EHCI) && \
+   !IS_ENABLED(CONFIG_PLAT_ORION) && \
!defined(PS3_SYSTEM_BUS_DRIVER) && \
!defined(OF_PLATFORM_DRIVER) && \
!defined(XILINX_OF_PLATFORM_DRIVER)
diff --git a/drivers/usb/host/ehci-orion.c b/drivers/usb/host/ehci-orion.c
index 914a3ec..06f143b 100644
--- a/drivers/usb/host/ehci-orion.c
+++ b/drivers/usb/host/ehci-orion.c
@@ -17,6 +17,13 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
+#include 
+
+#include "ehci.h"
+
 
 #define rdl(off)   __raw_readl(hcd->regs + (off))
 #define wrl(off, val)  __raw_writel((val), hcd->regs + (off))
@@ -34,6 +41,17 @@
 #define USB_PHY_IVREF_CTRL 0x440
 #define USB_PHY_TST_GRP_CTRL   0x450
 
+#define DRIVER_DESC "EHCI orion driver"
+
+static const char hcd_name[] = "ehci-orion";
+
+static struct hc_driver __read_mostly ehci_orion_hc_driver;
+
+static const struct ehci_driver_overrides orion_overrides __initdata = {
+   .reset = ehci_setup,
+};
+
+
 /*
  * Implement Orion USB controller specification guidelines
  */
@@ -104,51 +122,6 @@ static void orion_usb_phy_v1_setup(struct usb_hcd *hcd)
wrl(USB_MODE, 0x13);
 }
 
-static const struct hc_driver ehci_orion_hc_driver = {
-   .description = hcd_name,
-   .product_desc = "Marvell Orion EHCI",
-   .hcd_priv_size = sizeof(struct ehci_hcd),
-
-   /*
-* generic hardware linkage
-*/
-   .irq = ehci_irq,
-   .flags = HCD_MEMORY | HCD_USB2,
-
-   /*
-* basic lifecycle operations
-*/
-   .reset = ehci_setup,
-   .start = ehci_run,
-   .stop = ehci_stop,
-   .shutdown = ehci_shutdown,
-
-   /*
-* managing i/o requests and associated device resources
-*/
-   .urb_enqueue = ehci_urb_enqueue,
-   .urb_dequeue = ehci_urb_dequeue,
-   .endpoint_disable = ehci_endpoint_disable,
-   .endpoint_reset = ehci_endpoint_reset,
-
-   /*
-* scheduling support
-*/
-   .get_frame_number = ehci_get_frame,
-
-   /*
-* root hub support
-*/
-   .hub_status_data = ehci_hub_status_data,
-   .hub_control = ehci_hub_control,
-   .bus_suspend = ehci_bus_suspend,
-   .bus_resume = ehci_bus_resume,
-   .relinquish_port = ehci_relinquish_port,
-   .port_handed_over = ehci_port_handed_over,
-
-   .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete,
-};
-
 static void
 ehci_orion_

[PATCH 4/8] USB: EHCI: make ehci-mv a separate driver

2013-02-10 Thread manjunath . goudar
From: Manjunath Goudar 

Separate the mv(marvell) host controller driver from ehci-hcd host code
into its own driver module.

Signed-off-by: Manjunath Goudar 
Cc: Greg KH 
Cc: Alan Stern 
Cc: Jason Cooper 
Cc: Andrew Lunn 
Cc: linux-usb@vger.kernel.org
Cc: linux-ker...@vger.kernel.org
---
 drivers/usb/host/Kconfig|2 +-
 drivers/usb/host/Makefile   |1 +
 drivers/usb/host/ehci-hcd.c |6 +---
 drivers/usb/host/ehci-mv.c  |   80 ---
 4 files changed, 40 insertions(+), 49 deletions(-)

diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 8ffbafa..2aa4ece 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -221,7 +221,7 @@ config USB_EHCI_S5P
 Enable support for the S5P SOC's on-chip EHCI controller.
 
 config USB_EHCI_MV
-   bool "EHCI support for Marvell on-chip controller"
+   tristate "EHCI support for Marvell on-chip controller"
depends on USB_EHCI_HCD && (ARCH_PXA || ARCH_MMP)
select USB_EHCI_ROOT_HUB_TT
---help---
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
index 77e0331..d593017 100644
--- a/drivers/usb/host/Makefile
+++ b/drivers/usb/host/Makefile
@@ -31,6 +31,7 @@ obj-$(CONFIG_USB_EHCI_HCD_SPEAR)+= ehci-spear.o
 obj-$(CONFIG_USB_OXU210HP_HCD) += oxu210hp-hcd.o
 obj-$(CONFIG_USB_EHCI_HCD_AT91) += ehci-atmel.o
 obj-$(CONFIG_USB_EHCI_S5P)  += ehci-s5p.o
+obj-$(CONFIG_USB_EHCI_MV)   += ehci-mv.o
 obj-$(CONFIG_USB_ISP116X_HCD)  += isp116x-hcd.o
 obj-$(CONFIG_USB_ISP1362_HCD)  += isp1362-hcd.o
 obj-$(CONFIG_USB_OHCI_HCD) += ohci-hcd.o
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 22c50fb..d133f6d 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -1317,11 +1317,6 @@ MODULE_LICENSE ("GPL");
 #define PLATFORM_DRIVERehci_grlib_driver
 #endif
 
-#ifdef CONFIG_USB_EHCI_MV
-#include "ehci-mv.c"
-#definePLATFORM_DRIVER ehci_mv_driver
-#endif
-
 #ifdef CONFIG_MIPS_SEAD3
 #include "ehci-sead3.c"
 #definePLATFORM_DRIVER ehci_hcd_sead3_driver
@@ -1335,6 +1330,7 @@ MODULE_LICENSE ("GPL");
!IS_ENABLED(CONFIG_PLAT_SPEAR) && \
!IS_ENABLED(CONFIG_ARCH_AT91) && \
!IS_ENABLED(CONFIG_USB_EHCI_S5P) && \
+   !IS_ENABLED(CONFIG_USB_EHCI_MV) && \
!defined(PS3_SYSTEM_BUS_DRIVER) && \
!defined(OF_PLATFORM_DRIVER) && \
!defined(XILINX_OF_PLATFORM_DRIVER)
diff --git a/drivers/usb/host/ehci-mv.c b/drivers/usb/host/ehci-mv.c
index 3065809..67de419 100644
--- a/drivers/usb/host/ehci-mv.c
+++ b/drivers/usb/host/ehci-mv.c
@@ -17,7 +17,18 @@
 #include 
 #include 
 
+#include 
+#include 
+#include 
+#include 
+
+#include "ehci.h"
+
+#define DRIVER_DESC "EHCI mv driver"
+
 #define CAPLENGTH_MASK (0xff)
+static const char hcd_name[] = "ehci-mv";
+static struct hc_driver __read_mostly mv_ehci_hc_driver;
 
 struct ehci_hcd_mv {
struct usb_hcd *hcd;
@@ -95,48 +106,6 @@ static int mv_ehci_reset(struct usb_hcd *hcd)
return retval;
 }
 
-static const struct hc_driver mv_ehci_hc_driver = {
-   .description = hcd_name,
-   .product_desc = "Marvell EHCI",
-   .hcd_priv_size = sizeof(struct ehci_hcd),
-
-   /*
-* generic hardware linkage
-*/
-   .irq = ehci_irq,
-   .flags = HCD_MEMORY | HCD_USB2,
-
-   /*
-* basic lifecycle operations
-*/
-   .reset = mv_ehci_reset,
-   .start = ehci_run,
-   .stop = ehci_stop,
-   .shutdown = ehci_shutdown,
-
-   /*
-* managing i/o requests and associated device resources
-*/
-   .urb_enqueue = ehci_urb_enqueue,
-   .urb_dequeue = ehci_urb_dequeue,
-   .endpoint_disable = ehci_endpoint_disable,
-   .endpoint_reset = ehci_endpoint_reset,
-   .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete,
-
-   /*
-* scheduling support
-*/
-   .get_frame_number = ehci_get_frame,
-
-   /*
-* root hub support
-*/
-   .hub_status_data = ehci_hub_status_data,
-   .hub_control = ehci_hub_control,
-   .bus_suspend = ehci_bus_suspend,
-   .bus_resume = ehci_bus_resume,
-};
-
 static int mv_ehci_probe(struct platform_device *pdev)
 {
struct mv_usb_platform_data *pdata = pdev->dev.platform_data;
@@ -350,8 +319,33 @@ static struct platform_driver ehci_mv_driver = {
.remove = mv_ehci_remove,
.shutdown = mv_ehci_shutdown,
.driver = {
-  .name = "mv-ehci",
+  .name = hcd_name,
   .bus = &platform_bus_type,
   },
.id_table = ehci_id_table,
 };
+static const struct ehci_driver_overrides mv_overrides __initdata = {
+   .reset = mv_ehci_reset,
+};
+
+static int __init ehci_mv_init(void)
+{
+   if (usb_disabled())
+   return -ENODEV;
+
+   pr_info("%s: " DRIVER_DESC "\n", hcd_name);
+   ehci_init_

[PATCH 5/8] USB: EHCI: make ehci-vt8500 a separate driver

2013-02-10 Thread manjunath . goudar
From: Manjunath Goudar 

Separate the vt8500 host controller driver from ehci-hcd host code
into its own driver module.

Signed-off-by: Manjunath Goudar 
Cc: Greg KH 
Cc: Alan Stern 
Cc: Tony Prisk 
Cc: Alexey Charkov 
Cc: linux-usb@vger.kernel.org
Cc: linux-ker...@vger.kernel.org
---
 drivers/usb/host/Kconfig   |8 +
 drivers/usb/host/Makefile  |1 +
 drivers/usb/host/ehci-hcd.c|5 ---
 drivers/usb/host/ehci-vt8500.c |   73 ++--
 4 files changed, 42 insertions(+), 45 deletions(-)

diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 2aa4ece..4e15b87 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -162,6 +162,14 @@ config USB_EHCI_HCD_OMAP
  Enables support for the on-chip EHCI controller on
  OMAP3 and later chips.
 
+config USB_EHCI_HCD_VT8500
+tristate "Support for VT8500 on-chip EHCI USB controller"
+depends on USB_EHCI_HCD && ARCH_VT8500
+default y
+---help---
+  Enables support for the on-chip EHCI controller on
+  VT8500 chips.
+
 config USB_EHCI_HCD_SPEAR
 tristate "Support for ST SPEAr on-chip EHCI USB controller"
 depends on USB_EHCI_HCD && PLAT_SPEAR
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
index d593017..1fe0579 100644
--- a/drivers/usb/host/Makefile
+++ b/drivers/usb/host/Makefile
@@ -32,6 +32,7 @@ obj-$(CONFIG_USB_OXU210HP_HCD)+= oxu210hp-hcd.o
 obj-$(CONFIG_USB_EHCI_HCD_AT91) += ehci-atmel.o
 obj-$(CONFIG_USB_EHCI_S5P)  += ehci-s5p.o
 obj-$(CONFIG_USB_EHCI_MV)   += ehci-mv.o
+obj-$(CONFIG_USB_EHCI_HCD_VT8500)+= ehci-vt8500.o
 obj-$(CONFIG_USB_ISP116X_HCD)  += isp116x-hcd.o
 obj-$(CONFIG_USB_ISP1362_HCD)  += isp1362-hcd.o
 obj-$(CONFIG_USB_OHCI_HCD) += ohci-hcd.o
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index d133f6d..3dacac0 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -1287,11 +1287,6 @@ MODULE_LICENSE ("GPL");
 #define PLATFORM_DRIVERehci_octeon_driver
 #endif
 
-#ifdef CONFIG_ARCH_VT8500
-#include "ehci-vt8500.c"
-#definePLATFORM_DRIVER vt8500_ehci_driver
-#endif
-
 #ifdef CONFIG_USB_EHCI_MSM
 #include "ehci-msm.c"
 #define PLATFORM_DRIVERehci_msm_driver
diff --git a/drivers/usb/host/ehci-vt8500.c b/drivers/usb/host/ehci-vt8500.c
index 11695d5..98d65bd 100644
--- a/drivers/usb/host/ehci-vt8500.c
+++ b/drivers/usb/host/ehci-vt8500.c
@@ -16,52 +16,25 @@
  *
  */
 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
 #include 
 #include 
 
-static const struct hc_driver vt8500_ehci_hc_driver = {
-   .description= hcd_name,
-   .product_desc   = "VT8500 EHCI",
-   .hcd_priv_size  = sizeof(struct ehci_hcd),
+#include "ehci.h"
 
-   /*
-* generic hardware linkage
-*/
-   .irq= ehci_irq,
-   .flags  = HCD_MEMORY | HCD_USB2,
-
-   /*
-* basic lifecycle operations
-*/
-   .reset  = ehci_setup,
-   .start  = ehci_run,
-   .stop   = ehci_stop,
-   .shutdown   = ehci_shutdown,
+#define DRIVER_DESC "vt8500 On-Chip EHCI Host driver"
 
-   /*
-* managing i/o requests and associated device resources
-*/
-   .urb_enqueue= ehci_urb_enqueue,
-   .urb_dequeue= ehci_urb_dequeue,
-   .endpoint_disable   = ehci_endpoint_disable,
-   .endpoint_reset = ehci_endpoint_reset,
+static const char hcd_name[] = "ehci-vt8500";
 
-   /*
-* scheduling support
-*/
-   .get_frame_number   = ehci_get_frame,
+static struct hc_driver __read_mostly vt8500_ehci_hc_driver;
 
-   /*
-* root hub support
-*/
-   .hub_status_data= ehci_hub_status_data,
-   .hub_control= ehci_hub_control,
-   .bus_suspend= ehci_bus_suspend,
-   .bus_resume = ehci_bus_resume,
-   .relinquish_port= ehci_relinquish_port,
-   .port_handed_over   = ehci_port_handed_over,
-
-   .clear_tt_buffer_complete   = ehci_clear_tt_buffer_complete,
+static const struct ehci_driver_overrides ehci_vt8500_overrides __initdata = {
+   .reset = ehci_setup,
 };
 
 static u64 vt8500_ehci_dma_mask = DMA_BIT_MASK(32);
@@ -140,11 +113,31 @@ static struct platform_driver vt8500_ehci_driver = {
.remove = vt8500_ehci_drv_remove,
.shutdown   = usb_hcd_platform_shutdown,
.driver = {
-   .name   = "vt8500-ehci",
+   .name   = hcd_name,
.owner  = THIS_MODULE,
.of_match_table = of_match_ptr(vt8500_ehci_ids),
}
 };
 
+static int __init ehci_vt8500_init(void)
+{
+   if (usb_disabled())
+   return -ENODEV;
+
+   pr_info(

Re: Disconnecting an USB3 device from xhci-port isn't detected properly

2013-02-10 Thread Lutz Vieweg

On 02/08/2013 08:36 PM, Matthias Schniedermeyer wrote:

It appears that there are either not that many people that disconnect
USB3 devices and/or people that reguarly update to bleeding edge
(stable) kernels. ;-)


Well, I do, but I'm experiencing kind of the opposite problem,
my USB 3 harddisk keeps getting disconnected after S3 resumes,
where one would want it to keep connected. I reported this issue in
https://bugzilla.kernel.org/show_bug.cgi?id=53211

Regards,

Lutz Vieweg

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


Re: [Bisected] [-next-20130204] usb/hcd: irq 18: nobody cared

2013-02-10 Thread Yinghai Lu
On Sun, Feb 10, 2013 at 6:23 AM, Peter Hurley  wrote:
> On Sat, 2013-02-09 at 22:14 -0500, Peter Hurley wrote:
>> On Tue, 2013-02-05 at 15:26 -0500, Alan Stern wrote:
>> > On Tue, 5 Feb 2013, Peter Hurley wrote:
>> >
>> > > With -next-20130204:
>> > >
>> > > [   33.855570] irq 18: nobody cared (try booting with the "irqpoll" 
>> > > option)
>> > > [   33.855580] Pid: 0, comm: swapper/4 Not tainted 
>> > > 3.8.0-next-20130204-xeon #20130204
>> > > [   33.855582] Call Trace:
>> > > [   33.855585][] __report_bad_irq+0x36/0xe0
>> > > [   33.855600]  [] note_interrupt+0x1aa/0x200
>> > > [   33.855606]  [] ? mwait_idle+0x82/0x1b0
>> > > [   33.855610]  [] handle_irq_event_percpu+0xc9/0x260
>> > > [   33.855614]  [] handle_irq_event+0x48/0x70
>> > > [   33.855618]  [] handle_fasteoi_irq+0x5a/0x100
>> > > [   33.855624]  [] handle_irq+0x22/0x40
>> > > [   33.855630]  [] do_IRQ+0x5a/0xd0
>> > > [   33.855636]  [] common_interrupt+0x6d/0x6d
>> > > [   33.855638][] ? 
>> > > rcu_eqs_enter_common+0x4a/0x320
>> > > [   33.855646]  [] ? mwait_idle+0x82/0x1b0
>> > > [   33.855649]  [] ? mwait_idle+0x29/0x1b0
>> > > [   33.855653]  [] cpu_idle+0x116/0x130
>> > > [   33.855658]  [] start_secondary+0x251/0x258
>> > > [   33.855660] handlers:
>> > > [   33.855664] [] usb_hcd_irq
>> > > [   33.855667] Disabling IRQ #18
>> > >
>> > > From earlier in the boot log:
>> > > [1.297020] uhci_hcd :00:1d.2: setting latency timer to 64
>> > > [1.297032] uhci_hcd :00:1d.2: UHCI Host Controller
>> > > [1.297040] uhci_hcd :00:1d.2: new USB bus registered, assigned 
>> > > bus number 4
>> > > [1.297076] uhci_hcd :00:1d.2: irq 18, io base 0xff40
>> > > [1.297213] hub 4-0:1.0: USB hub found
>> > > [1.297221] hub 4-0:1.0: 2 ports detected
>> > >
>> > > lsusb:
>> > > ...
>> > > Bus 004 Device 002: ID 0764:0501 Cyber Power System, Inc. CP1500 AVR UPS
>> > > Bus 004 Device 003: ID 046d:c52b Logitech, Inc. Unifying Receiver
>>
>> [...]
>>
>> > If the suggestion above doesn't work out, bisection may be the best way
>> > to find the answer.
>>
>> This bad irq bisected to:
>>
>> 4f535093cf8f6da8cfda7c36c2c1ecd2e9586ee4 is the first bad commit
>> commit 4f535093cf8f6da8cfda7c36c2c1ecd2e9586ee4
>> Author: Yinghai Lu 
>> Date:   Mon Jan 21 13:20:52 2013 -0800
>>
>> PCI: Put pci_dev in device tree as early as possible
>>
>> We want to put pci_dev structs in the device tree as soon as possible so
>> for_each_pci_dev() iteration will not miss them, but driver attachment
>> needs to be delayed until after pci_assign_unassigned_resources() to make
>> sure all devices have resources assigned first.
>>
>> This patch moves device registering from pci_bus_add_devices() to
>> pci_device_add(), which happens earlier, leaving driver attachment in
>> pci_bus_add_devices().
>>
>> It also removes unattached child bus handling in pci_bus_add_devices().
>> That's not needed because child bus via pci_add_new_bus() is already
>> in parent bus children list.
>>
>> [bhelgaas: changelog]
>> Signed-off-by: Yinghai Lu 
>> Signed-off-by: Bjorn Helgaas 
>> Acked-by: Rafael J. Wysocki 
>>
>> :04 04 0540c98d04d00de24b4e12fa750f6cd26c5addd2 
>> 2e24946cb7165a4028b7efb0a622271cc3990005 Mdrivers
>>
>> All is fine if I revert these 2 commits:
>>
>> 40064ac PCI: Remove unused "rc" in virtfn_add_bus()
>> 4f53509 (HEAD, refs/bisect/bad) PCI: Put pci_dev in device tree as early as 
>> possible
>>
>> Any ideas how these are causing the USB HCD core / hid-logitech-dj
>> driver to drop interrupts?
>
> https://bugzilla.kernel.org/show_bug.cgi?id=53561
>
> Maybe this is some interaction with all the new ACPI code and fixes
> written in those 8 days.

interrupt routing seems get changed:
next:
   5:  0  0  0  0  0
0  0  0   IO-APIC-fasteoi   snd_ctxfi
  18:  99970 13 16 20  99940
13 13 16   IO-APIC-fasteoi   uhci_hcd:usb4
v3.8-rc7:
  18:424 15 11112420
16 18105   IO-APIC-fasteoi   uhci_hcd:usb4, snd_ctxfi

These messages in the bad dmesg log are interesting since PCI INT A is routed
on
irq 18 with the kernels that work.
[8.983246] pci :00:1e.0: can't derive routing for PCI INT A
[8.983600] snd_ctxfi :09:02.0: PCI INT A: no GSI - using ISA IRQ 5
...

acpi_pci_irq_add_prt() add wrong bus for that bridge, because that
that bridge is not scanned.

Will check if I can produce one patch for it.

Thanks

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


Re: [PATCH 0/8] usb: ehci: more bus glues as separate modules

2013-02-10 Thread Jason Cooper
Manjunath,

I think this is the second version of this series.  Please indicate so
in the subject "[PATCH V2 X/Y]" and provide a changelog with each patch
so that we can easily confirm suggested changes from one version to the
next.

thx,

Jason.

On Mon, Feb 11, 2013 at 12:28:09AM +0530, manjunath.gou...@linaro.org wrote:
> From: Manjunath Goudar 
> 
> Separate the SOC On-Chip host controller driver from ehci-hcd 
> host code into its own driver module
> 
> Manjunath Goudar (8):
>   USB: EHCI: make ehci-spear a separate driver
>   USB: EHCI: make ehci-atmel a separate driver
>   USB: EHCI: make ehci-s5p a separate driver
>   USB: EHCI: make ehci-mv a separate driver
>   USB: EHCI: make ehci-vt8500 a separate driver
>   USB: EHCI: make ehci-msm a separate driver
>   USB: EHCI: make ehci-w90X900 a separate driver
>   USB: EHCI: make ehci-orion a separate driver
> 
>  drivers/usb/host/Kconfig|   42 +++--
>  drivers/usb/host/Makefile   |9 ++-
>  drivers/usb/host/ehci-atmel.c   |   77 ---
>  drivers/usb/host/ehci-hcd.c |   52 +++-
>  drivers/usb/host/ehci-msm.c |   85 +++--
>  drivers/usb/host/ehci-mv.c  |   80 +++-
>  drivers/usb/host/ehci-orion.c   |   91 +--
>  drivers/usb/host/ehci-s5p.c |   69 -
>  drivers/usb/host/ehci-spear.c   |  131 
> ---
>  drivers/usb/host/ehci-vt8500.c  |   73 ++
>  drivers/usb/host/ehci-w90x900.c |   90 ---
>  drivers/usb/host/ehci.h |2 +-
>  12 files changed, 392 insertions(+), 409 deletions(-)
> 
> -- 
> 1.7.9.5
> 
> 
> ___
> linux-arm-kernel mailing list
> linux-arm-ker...@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Super-Speed device that is only recognized as High-Speed, replugging to another device isn't always recognized

2013-02-10 Thread Matthias Schniedermeyer
Hi


Lately, like since about half year or so (I'm using USB3 since before it 
worked reliably (or at all) nearly 3 years ago), it happens more and 
more often that a SS-device is "only" recognised as a High-Speed device, 
AFAICR it happens more often when i disconnect one HDD and plug in 
another immediatly (a few seconds appart, they are lying one ontop the 
other so switching the cable doesn't take long).

And sometimes after i switch a HDD with another it isn't recognized at 
all as "new device plugged in". I haven't tried how "old" the system 
thinks the device is, the wrong udev-symlinks are enough to stop me in 
my tracks. Re-Plugging has always worked in this case.
(Unplug, wait 5 seconds, re-plug and eh voila the right udev-symlinks 
are there)

So my first question is:
Is there a way to force a renegotiation, without powering down the 
device? I tried physical re-plugging a few times, but that didn't work.
Some goes for the case when the device isn't recognizes as new, can i 
force a rediscovery, so to speak?

Second question:
What can i do to try debug this?

Today i copied files to 3 pairs of HDDs.
All 3 pairs were connected by the same 2 cables connected to the 2 
ports of an Intel xHCI (Z77 Chipset Mainboard)

- The first pair got recognised as both SS.
- The second pair got recognised as one SS and one HS. 
(Here i switched cables. Re-plugging after i saw that one was HS didn't 
work.)
- The third pair got recognised as both SS.
(Here i had switched off the other HDDs and there were a few minutes 
inbetween switching the old pair of and swiching the new pair on)

The second problem didn't show up today.



-- 

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


RE: [PATCH V3 1/5] usb: gadget/uvc: Fix VS_INPUT_HEADER.bEndpointAddress and Video Streaming.bEndpointAddress values

2013-02-10 Thread Bhupesh SHARMA
Hi,

> > Hi Bhupesh,
> >
> > Thanks for the patch.
> >
> > On Thursday 17 January 2013 16:23:49 Bhupesh Sharma wrote:
> > > This patch corrects the VS_INPUT_HEADER.bEndpointAddress and Video
> > > Streaming.bEndpointAddress values which were incorrectly set to 0 in
> > > UVC function driver.
> > >
> > > As 'usb_ep_autoconfig' function returns an un-claimed usb_ep, and
> > > modifies the endpoint descriptor's bEndpointAddress, so there is no
> > > need to again set the bEndpointAddress for Video Streaming and
> > > VS_INPUT_HEADER decriptors (for all speeds: SS/HS/FS) to the
> > > bEndpointAddress obtained for Full Speed case from
> 'usb_ep_autoconfig'
> > function call.
> > >
> > > Signed-off-by: Bhupesh Sharma 
> > > ---
> > >  drivers/usb/gadget/f_uvc.c |   30 --
> > >  1 files changed, 20 insertions(+), 10 deletions(-)
> > >
> > > diff --git a/drivers/usb/gadget/f_uvc.c b/drivers/usb/gadget/f_uvc.c
> > > index b34349f..1769f3e 100644
> > > --- a/drivers/usb/gadget/f_uvc.c
> > > +++ b/drivers/usb/gadget/f_uvc.c
> > > @@ -550,8 +550,24 @@ uvc_copy_descriptors(struct uvc_device *uvc,
> > enum
> > > usb_device_speed speed) UVC_COPY_DESCRIPTORS(mem, dst,
> > >   (const struct usb_descriptor_header**)uvc_streaming_cls);
> > >   uvc_streaming_header->wTotalLength =
> > cpu_to_le16(streaming_size);
> > > - uvc_streaming_header->bEndpointAddress =
> > > - uvc_fs_streaming_ep.bEndpointAddress;
> > > +
> > > + switch (speed) {
> > > + case USB_SPEED_SUPER:
> > > + uvc_streaming_header->bEndpointAddress =
> > > + uvc_ss_streaming_ep.bEndpointAddress;
> > > + break;
> > > +
> > > + case USB_SPEED_HIGH:
> > > + uvc_streaming_header->bEndpointAddress =
> > > + uvc_hs_streaming_ep.bEndpointAddress;
> > > + break;
> > > +
> > > + case USB_SPEED_FULL:
> > > + default:
> > > + uvc_streaming_header->bEndpointAddress =
> > > + uvc_fs_streaming_ep.bEndpointAddress;
> > > + break;
> > > + }
> >
> > I don't think this will work. A superspeed device will see
> > uvc_copy_descriptor called 3 times, once for each speed. As only
> > uvc_ss_streaming_ep.bEndpointAddress is set in that case, high-speed
> > and full-speed descriptors will have a zero endpoint value.
> 
> Not exactly. The uvc_copy_descriptor is called only once for a superspeed
> device (at-least on my DWC3 UDC controller) depending on the highest
> speed exported by the UDC controller driver.
> 
> I have tested this patch with DWC3 controller driver and it works fine and I
> can confirm that my original patch works fine.
> Maybe someone else can test the same with his UDC controller driver.
> 
> @Michael: Have you tested my original patch with your UDC controller and
> does it work fine at your end?
> 

Sorry. Ignore the noise :)
I had some local modifications to the code.
I will test again only with patches in Laurent's branch.

Sorry again,
Bhupesh

> 
> > I propose the following patch:
> >
> > diff --git a/drivers/usb/gadget/f_uvc.c b/drivers/usb/gadget/f_uvc.c
> > index
> > 02266c5..c8abe79 100644
> > --- a/drivers/usb/gadget/f_uvc.c
> > +++ b/drivers/usb/gadget/f_uvc.c
> > @@ -548,8 +548,7 @@ uvc_copy_descriptors(struct uvc_device *uvc,
> enum
> > usb_device_speed speed)
> > UVC_COPY_DESCRIPTORS(mem, dst,
> > (const struct usb_descriptor_header**)uvc_streaming_cls);
> > uvc_streaming_header->wTotalLength =
> cpu_to_le16(streaming_size);
> > -   uvc_streaming_header->bEndpointAddress =
> > -   uvc_fs_streaming_ep.bEndpointAddress;
> > +   uvc_streaming_header->bEndpointAddress = uvc->video.ep-
> > >address;
> >
> > UVC_COPY_DESCRIPTORS(mem, dst, uvc_streaming_std);
> >
> > @@ -636,7 +635,14 @@ uvc_function_bind(struct usb_configuration *c,
> > struct usb_function *f)
> > uvc->control_ep = ep;
> > ep->driver_data = uvc;
> >
> > -   ep = usb_ep_autoconfig(cdev->gadget, &uvc_fs_streaming_ep);
> > +   if (gadget_is_superspeed(c->cdev->gadget))
> > +   ep = usb_ep_autoconfig_ss(cdev->gadget,
> > &uvc_ss_streaming_ep,
> > + &uvc_ss_streaming_comp);
> > +   else if (gadget_is_dualspeed(cdev->gadget))
> > +   ep = usb_ep_autoconfig(cdev->gadget,
> > &uvc_hs_streaming_ep);
> > +   else
> > +   ep = usb_ep_autoconfig(cdev->gadget,
> > &uvc_fs_streaming_ep);
> > +
> > if (!ep) {
> > INFO(cdev, "Unable to allocate streaming EP\n");
> > goto error;
> > @@ -644,10 +650,9 @@ uvc_function_bind(struct usb_configuration *c,
> > struct usb_function *f)
> > uvc->video.ep = ep;
> > ep->driver_data = uvc;
> >
> > -   uvc_hs_streaming_ep.bEndpointAddress =
> > -   uvc_fs_streaming_ep.bEndpointAddress;
> > -   uvc_ss_streaming_ep.bEndpointAddress =
> > -   uvc_fs_streaming_ep.bEndpointAddress;
> > +   uvc_fs_streaming_ep.bEndpointAddress = uvc->video.ep->address;
> > +   uvc_hs_streaming_ep.bEndpoint

Re: [PATCH 1/8] USB: EHCI: make ehci-spear a separate driver

2013-02-10 Thread Viresh Kumar
On Mon, Feb 11, 2013 at 12:28 AM,   wrote:
> From: Manjunath Goudar 
>
> Separate the Spear host controller driver from ehci-hcd host code

SPEAr

> into its own driver module.
>
> Signed-off-by: Manjunath Goudar 
> Signed-off-by: Deepak Saxena 
> Cc: Greg KH 
> Cc: Alan Stern 
> Cc: Viresh Kumar 
> Cc: Shiraz Hashim 
> Cc: linux-usb@vger.kernel.org
> Cc: spear-de...@list.st.com
> ---
>  drivers/usb/host/Kconfig  |8 +++
>  drivers/usb/host/Makefile |2 +-
>  drivers/usb/host/ehci-hcd.c   |8 +--
>  drivers/usb/host/ehci-spear.c |  131 
> +
>  4 files changed, 78 insertions(+), 71 deletions(-)
>
> diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
> index 3a21c5d..15e8032 100644
> --- a/drivers/usb/host/Kconfig
> +++ b/drivers/usb/host/Kconfig
> @@ -162,6 +162,14 @@ config USB_EHCI_HCD_OMAP
>   Enables support for the on-chip EHCI controller on
>   OMAP3 and later chips.
>
> +config USB_EHCI_HCD_SPEAR
> +tristate "Support for ST SPEAr on-chip EHCI USB controller"
> +depends on USB_EHCI_HCD && PLAT_SPEAR
> +default y
> +---help---
> +  Enables support for the on-chip EHCI controller on
> +  ST SPEAr chips.
> +
>  config USB_EHCI_MSM
> bool "Support for MSM on-chip EHCI USB controller"
> depends on USB_EHCI_HCD && ARCH_MSM
> diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
> index 001fbff..c8fcde9 100644
> --- a/drivers/usb/host/Makefile
> +++ b/drivers/usb/host/Makefile
> @@ -27,7 +27,7 @@ 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
>  obj-$(CONFIG_USB_EHCI_MXC) += ehci-mxc.o
> -
> +obj-$(CONFIG_USB_EHCI_HCD_SPEAR)+= ehci-spear.o
>  obj-$(CONFIG_USB_OXU210HP_HCD) += oxu210hp-hcd.o
>  obj-$(CONFIG_USB_ISP116X_HCD)  += isp116x-hcd.o
>  obj-$(CONFIG_USB_ISP1362_HCD)  += isp1362-hcd.o
> diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
> index b416a3f..be7247b 100644
> --- a/drivers/usb/host/ehci-hcd.c
> +++ b/drivers/usb/host/ehci-hcd.c
> @@ -1274,7 +1274,7 @@ MODULE_LICENSE ("GPL");
>
>  #ifdef CONFIG_PLAT_ORION
>  #include "ehci-orion.c"
> -#definePLATFORM_DRIVER ehci_orion_driver
> +#definePLATFORM_DRIVER ehci_orion_driver
>  #endif

Looks to be unrelated change.

>
>  #ifdef CONFIG_USB_W90X900_EHCI
> @@ -1297,11 +1297,6 @@ MODULE_LICENSE ("GPL");
>  #definePLATFORM_DRIVER vt8500_ehci_driver
>  #endif
>
> -#ifdef CONFIG_PLAT_SPEAR
> -#include "ehci-spear.c"
> -#define PLATFORM_DRIVERspear_ehci_hcd_driver
> -#endif
> -
>  #ifdef CONFIG_USB_EHCI_MSM
>  #include "ehci-msm.c"
>  #define PLATFORM_DRIVERehci_msm_driver
> @@ -1347,6 +1342,7 @@ MODULE_LICENSE ("GPL");
> !IS_ENABLED(CONFIG_USB_CHIPIDEA_HOST) && \
> !IS_ENABLED(CONFIG_USB_EHCI_MXC) && \
> !defined(PLATFORM_DRIVER) && \
> +   !IS_ENABLED(CONFIG_PLAT_SPEAR) && \
> !defined(PS3_SYSTEM_BUS_DRIVER) && \
> !defined(OF_PLATFORM_DRIVER) && \
> !defined(XILINX_OF_PLATFORM_DRIVER)
> diff --git a/drivers/usb/host/ehci-spear.c b/drivers/usb/host/ehci-spear.c
> index 466c1bb..0d9ed11 100644
> --- a/drivers/usb/host/ehci-spear.c
> +++ b/drivers/usb/host/ehci-spear.c
> @@ -1,5 +1,5 @@
>  /*
> -* Driver for EHCI HCD on SPEAR SOC
> +* Driver for EHCI HCD on SPEAr SOC
>  *
>  * Copyright (C) 2010 ST Micro Electronics,
>  * Deepak Sikri 
> @@ -12,29 +12,41 @@
>  */
>
>  #include 
> +#include 
> +#include 
>  #include 
> +#include 
> +#include 
>  #include 
>  #include 
>  #include 
> +#include 
> +#include 
>
> -struct spear_ehci {
> +#include "ehci.h"
> +
> +#define DRIVER_DESC "EHCI SPEAr driver"
> +
> +static const char hcd_name[] = "ehci-SPEAr";
> +
> +struct SPEAr_ehci {

That's what i wrote in my comment on first patch:

"Please write spear as SPEAr everywhere, leaving
functions/variables/config options."

And so i haven't expected SPEAr into structure/function names :)

> struct ehci_hcd ehci;
> struct clk *clk;
>  };
>
> -#define to_spear_ehci(hcd) (struct spear_ehci *)hcd_to_ehci(hcd)
> +#define to_SPEAr_ehci(hcd) (struct SPEAr_ehci *)hcd_to_ehci(hcd)

ditto

>
> -static void spear_start_ehci(struct spear_ehci *ehci)
> +static void SPEAr_start_ehci(struct SPEAr_ehci *ehci)

ditto

>  {
> clk_prepare_enable(ehci->clk);
>  }
>
> -static void spear_stop_ehci(struct spear_ehci *ehci)
> +static void SPEAr_stop_ehci(struct SPEAr_ehci *ehci)

ditto

>  {
> clk_disable_unprepare(ehci->clk);
>  }
>
> -static int ehci_spear_setup(struct usb_hcd *hcd)
> +static int ehci_SPEAr_setup(struct usb_hcd *hcd)

ditto

>  {
> struct ehci_hcd *ehci = hcd_to_ehci(hcd);
>
> @@ -43,43 +55,10 @@ static int ehci_spear_setup(struct usb_hcd *hcd)
>
> return ehci_setup(hcd);
>  }
> -
> -static const struct 

Re: [Bisected] [-next-20130204] usb/hcd: irq 18: nobody cared

2013-02-10 Thread Yinghai Lu
On Sun, Feb 10, 2013 at 12:33 PM, Yinghai Lu  wrote:
> On Sun, Feb 10, 2013 at 6:23 AM, Peter Hurley  
> wrote:
>> On Sat, 2013-02-09 at 22:14 -0500, Peter Hurley wrote:
>>> On Tue, 2013-02-05 at 15:26 -0500, Alan Stern wrote:
>>> > On Tue, 5 Feb 2013, Peter Hurley wrote:
>>> >
>>> > > With -next-20130204:
>>> > >
>>> > > [   33.855570] irq 18: nobody cared (try booting with the "irqpoll" 
>>> > > option)
>>> > > [   33.855580] Pid: 0, comm: swapper/4 Not tainted 
>>> > > 3.8.0-next-20130204-xeon #20130204
>>> > > [   33.855582] Call Trace:
>>> > > [   33.855585][] __report_bad_irq+0x36/0xe0
>>> > > [   33.855600]  [] note_interrupt+0x1aa/0x200
>>> > > [   33.855606]  [] ? mwait_idle+0x82/0x1b0
>>> > > [   33.855610]  [] handle_irq_event_percpu+0xc9/0x260
>>> > > [   33.855614]  [] handle_irq_event+0x48/0x70
>>> > > [   33.855618]  [] handle_fasteoi_irq+0x5a/0x100
>>> > > [   33.855624]  [] handle_irq+0x22/0x40
>>> > > [   33.855630]  [] do_IRQ+0x5a/0xd0
>>> > > [   33.855636]  [] common_interrupt+0x6d/0x6d
>>> > > [   33.855638][] ? 
>>> > > rcu_eqs_enter_common+0x4a/0x320
>>> > > [   33.855646]  [] ? mwait_idle+0x82/0x1b0
>>> > > [   33.855649]  [] ? mwait_idle+0x29/0x1b0
>>> > > [   33.855653]  [] cpu_idle+0x116/0x130
>>> > > [   33.855658]  [] start_secondary+0x251/0x258
>>> > > [   33.855660] handlers:
>>> > > [   33.855664] [] usb_hcd_irq
>>> > > [   33.855667] Disabling IRQ #18
>>> > >
>> https://bugzilla.kernel.org/show_bug.cgi?id=53561
>>
>> Maybe this is some interaction with all the new ACPI code and fixes
>> written in those 8 days.
>
> interrupt routing seems get changed:
> next:
>5:  0  0  0  0  0
> 0  0  0   IO-APIC-fasteoi   snd_ctxfi
>   18:  99970 13 16 20  99940
> 13 13 16   IO-APIC-fasteoi   uhci_hcd:usb4
> v3.8-rc7:
>   18:424 15 11112420
> 16 18105   IO-APIC-fasteoi   uhci_hcd:usb4, snd_ctxfi
>
> These messages in the bad dmesg log are interesting since PCI INT A is routed
> on
> irq 18 with the kernels that work.
> [8.983246] pci :00:1e.0: can't derive routing for PCI INT A
> [8.983600] snd_ctxfi :09:02.0: PCI INT A: no GSI - using ISA IRQ 5
> ...
>
> acpi_pci_irq_add_prt() add wrong bus for that bridge, because that
> that bridge is not scanned.
>
> Will check if I can produce one patch for it.

Hi Peter,

Can you try attached debug patch?

Thanks

Yinghai


move_add_irq_prt_down.patch
Description: Binary data


Re: [PATCH v7 01/22] mfd: omap-usb-host: Consolidate OMAP USB-HS platform data

2013-02-10 Thread Olof Johansson
On Thu, Jan 17, 2013 at 8:59 AM, Tony Lindgren  wrote:
> * Alan Stern  [130117 07:19]:
>> On Thu, 17 Jan 2013, Roger Quadros wrote:
>>
>> > Let's have a single platform data structure for the OMAP's High-Speed
>> > USB host subsystem instead of having 3 separate ones i.e. one for
>> > board data, one for USB Host (UHH) module and one for USB-TLL module.
>> >
>> > This makes the code much simpler and avoids creating multiple copies of
>> > platform data.
>> >
>> > CC: Alan Stern 
>> >
>> > Signed-off-by: Roger Quadros 
>>
>> For the ehci-omap.c part:
>>
>> Acked-by: Alan Stern 
>
> If Samuel acks this patch, I can apply just this patch alone on v3.8-rc3
> into an immutable branch omap-for-v3.9/board-usb so we all merge it in
> as needed.

So, that didn't happen; Samuel applied it from the mailing list and
sfr just hit merge conflicts due to it.

Sigh.

This patch (touching arch/arm/mach-omap2) didn't have acks from Tony either.

Samuel, Tony, can you sort this out with a stable short topic branch
as Tony suggested? It'd be nice to avoid the merge conflict by a
little coordination here. :(


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


Re: [PATCH v7 01/22] mfd: omap-usb-host: Consolidate OMAP USB-HS platform data

2013-02-10 Thread Roger Quadros
On 02/11/2013 08:46 AM, Olof Johansson wrote:
> On Thu, Jan 17, 2013 at 8:59 AM, Tony Lindgren  wrote:
>> * Alan Stern  [130117 07:19]:
>>> On Thu, 17 Jan 2013, Roger Quadros wrote:
>>>
 Let's have a single platform data structure for the OMAP's High-Speed
 USB host subsystem instead of having 3 separate ones i.e. one for
 board data, one for USB Host (UHH) module and one for USB-TLL module.

 This makes the code much simpler and avoids creating multiple copies of
 platform data.

 CC: Alan Stern 

 Signed-off-by: Roger Quadros 
>>>
>>> For the ehci-omap.c part:
>>>
>>> Acked-by: Alan Stern 
>>
>> If Samuel acks this patch, I can apply just this patch alone on v3.8-rc3
>> into an immutable branch omap-for-v3.9/board-usb so we all merge it in
>> as needed.
> 
> So, that didn't happen; Samuel applied it from the mailing list and
> sfr just hit merge conflicts due to it.
> 
> Sigh.
> 
> This patch (touching arch/arm/mach-omap2) didn't have acks from Tony either.

Oops, this is my bad :(. Should have flagged Samuel about it. Will be more 
careful
next time.

> 
> Samuel, Tony, can you sort this out with a stable short topic branch
> as Tony suggested? It'd be nice to avoid the merge conflict by a
> little coordination here. :(
> 
>

cheers,
-roger

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