[PATCH 0/3] [Q/master] [SRU] fix usb on omap3

Stefan Bader stefan.bader at canonical.com
Tue Oct 9 12:32:34 UTC 2012


On 09.10.2012 12:31, Paolo Pisati wrote:
> This bug is actually a twofold problem:
> 
> 1) config for our omap kernel had a problem
> 
> enabling USB_[EHCI|OHCI]_HCD_PLATFORM we actually overwrote the OMAP EHCI/OHCI bits:
> 
> /home/ppisati/ubuntu-quantal/drivers/usb/host/ehci-hcd.c:1394:0: warning: "PLATFORM_DRIVER" redefined [enabled by default]
> /home/ppisati/ubuntu-quantal/drivers/usb/host/ehci-hcd.c:1289:0: note: this is the location of the previous definition
> 
> drivers/usb/host/ehci-hcd.c:
> 
> 1289:
> #ifdef CONFIG_USB_EHCI_HCD_OMAP
> #include "ehci-omap.c"
> #define PLATFORM_DRIVER ehci_hcd_omap_driver
> #endif
> 
> 1394:
> #ifdef CONFIG_USB_EHCI_HCD_PLATFORM
> #include "ehci-platform.c"
> #define PLATFORM_DRIVER ehci_platform_driver
> #endif
> 
> and later in ehci_init():
> 
> #ifdef PLATFORM_DRIVER
>     retval = platform_driver_register(&PLATFORM_DRIVER);
>     if (retval < 0)
>         goto clean0;
> #endif
> 
> While here add an enforce rule so we won't enable them ever again.
> 
> 2) upstream broke ehci implementation since 3.5 (and it's still broken ATM)
> 
> Since the 3.5 tree, usb ehci for omap3 has been plagued with problems up to the point that it was disabled upstream:
> 
> [flag at newluxor linux-2.6]$ git show 06b4ba5
> commit 06b4ba529528fbf9c24ce37b7618f4b0264750e2
> Author: Kevin Hilman <khilman at ti.com>
> Date: Fri Jul 6 11:20:28 2012 -0700
> 
>     ARM: OMAP2+: omap2plus_defconfig: EHCI driver is not stable, disable it
> 
>     The EHCI driver is not stable enough to be enabled by default. In v3.5,
>     it has at least the following problems:
> 
>     - warning dump during bootup
>     - hang during suspend
>     - prevents CORE powerdomain from entering retention during idle (even
>       when no USB devices connected.)
> 
>     This demonstrates that this driver has not been thoroughly tested and
>     therfore should not be enabled in the default defconfig.
> 
>     In addition, the problems above cause new PM regressions which need be
>     addressed before this driver should be enabled in the default
>     defconfig.
> 
>     Signed-off-by: Kevin Hilman <khilman at ti.com>
>     Signed-off-by: Tony Lindgren <tony at atomide.com>
> 
> and lately this situation has spiraled down to the point where enabling it at boot triggers an oops and a subsequent dead usb hub:
> 
> vanilla 3.5 omap2plus_defconfig + ehci:
> 
> ...
> [ 4.200103] omap_wdt: OMAP Watchdog Timer Rev 0x31: initial timeout 60 sec
> [ 4.208526] twl4030_wdt twl4030_wdt: Failed to register misc device
> [ 4.215240] twl4030_wdt: probe of twl4030_wdt failed with error -16
> [ 4.225860] omap_hsmmc omap_hsmmc.0: Failed to get debounce clk
> [ 4.262084] hub 1-0:1.0: state 7 ports 3 chg 0004 evt 0000
> [ 4.267913] hub 1-0:1.0: port 2, status 0501, change 0000, 480 Mb/s
> [ 4.332305] platform ehci-omap.0: port 2 reset complete, port enabled
> [ 4.339050] platform ehci-omap.0: GetStatus port:2 status 001005 0 ACK POWER sig=se0 PE CONNECT
> [ 4.410400] Unable to handle kernel NULL pointer dereference at virtual address 00000000
> [ 4.418884] pgd = c0004000
> [ 4.421722] [00000000] *pgd=00000000
> [ 4.425476] Internal error: Oops: 5 [#1] SMP ARM
> [ 4.430297] Modules linked in:
> [ 4.433471] CPU: 0 Not tainted (3.5.0 #16)
> [ 4.438110] PC is at hub_port_init+0x28c/0x968
> [ 4.442749] LR is at hub_port_init+0xc4/0x968
> [ 4.447296] pc : [<c030b2bc>] lr : [<c030b0f4>] psr: 60000013
> [ 4.447296] sp : df905eb8 ip : c05a9eb4 fp : 00000000
> [ 4.459259] r10: 00000000 r9 : df306400 r8 : 00000032
> [ 4.464691] r7 : df30ac00 r6 : 00000002 r5 : 00000000 r4 : df2a7400
> [ 4.471496] r3 : 00000000 r2 : c059e324 r1 : c059e348 r0 : df2a7468
> [ 4.478302] Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment kernel
> [ 4.485900] Control: 10c5387d Table: 80004019 DAC: 00000017
> [ 4.491912] Process khubd (pid: 236, stack limit = 0xdf9042f8)
> [ 4.497985] Stack: (0xdf905eb8 to 0xdf906000)
> [ 4.502532] 5ea0: 00000002 df306400
> [ 4.511047] 5ec0: 00000002 00000000 00000004 c008a078 00000001 00000002 00000003 df300400
> [ 4.519561] 5ee0: 00000000 c044acb0 00000001 df2a7400 df30ac00 df300400 df300418 df306400
> [ 4.528106] 5f00: 00000002 00000000 00000002 c030eb30 00000501 00000000 c059f090 c0656600
> [ 4.536621] 5f20: 107e9dd6 00000000 df306408 df30a820 df30ac9c df30a800 00000004 df306401
> [ 4.545135] 5f40: df306470 df30ac00 df306468 df30ac00 df30a820 df300400 00000009 c0065144
> [ 4.553680] 5f60: 00000000 df904000 00000000 df88c100 c005cff4 df905f74 df905f74 00000000
> [ 4.562194] 5f80: 00000501 c008a078 df82ff20 df82fef8 00000000 c030e4c0 00000013 00000000
> [ 4.570709] 5fa0: 00000000 00000000 00000000 c005c8f8 00000000 00000000 00000000 00000000
> [ 4.579254] 5fc0: 00000000 dead4ead ffffffff ffffffff c0700330 00000000 00000000 c0561550
> [ 4.587768] 5fe0: df905fe0 df905fe0 df82fef8 c005c874 c0014154 c0014154 00000000 00000000
> [ 4.596313] [<c030b2bc>] (hub_port_init+0x28c/0x968) from [<c030eb30>] (hub_thread+0x670/0x13d8)
> [ 4.605468] [<c030eb30>] (hub_thread+0x670/0x13d8) from [<c005c8f8>] (kthread+0x84/0x90)
> [ 4.613922] [<c005c8f8>] (kthread+0x84/0x90) from [<c0014154>] (kernel_thread_exit+0x0/0x8)
> [ 4.622619] Code: e59f2690 e5933080 e2840068 e59f1688 (e593e000)
> [ 4.629089] ---[ end trace 6fcdeaed28ce1f31 ]---
> [ 4.790161] usbcore: registered new interface driver usbhid
> ...
> 
> ATM there's no activity upstream to resolve this bug in a sound way but a patch was posted to linux-omap that resolves it:
> 
> http://www.mail-archive.com/linux-omap@vger.kernel.org/msg73115.html
> 
> While it's not upstream, the patch touches only omap3 clock code so it's safe for all the other flavours and it's the only
> option we have right now.
> 
> The aforementioned patch coupled with disabling the generic ehci/ohci driver implementation fix the usb bus on omap3.
> 
> BugLink: http://bugs.launchpad.net/bugs/1061599
> 

Not strictly opposed, just a few questions/remarks:

> Paolo Pisati (3):

>   UBUNTU: SAUCE: omap3 clocks .dev_id = NULL

Would it be possible to be a bit more verbose about what this one fixes and if
possible how. Just to have that documented in the change itself.

>   UBUNTU: [Config] disable USB_[EHCI|OHCI]_HCD_PLATFORM

>   UBUNTU: [Config] enforce USB_[EHCI|OHCI]_HCD_PLATFORM=n on arm[el|hf]

Would we need (or maybe we already have) something to enforce it being y on
other architectures?

-Stefan


> 
>  arch/arm/mach-omap2/clock3xxx_data.c               |   20 ++++++++++----------
>  debian.master/config/amd64/config.common.amd64     |    4 ++++
>  debian.master/config/armel/config.common.armel     |    4 ++++
>  debian.master/config/armhf/config.common.armhf     |    2 ++
>  debian.master/config/armhf/config.flavour.highbank |    2 ++
>  debian.master/config/armhf/config.flavour.omap     |    2 ++
>  debian.master/config/config.common.ubuntu          |    4 ----
>  debian.master/config/enforce                       |    3 +++
>  debian.master/config/i386/config.common.i386       |    4 ++++
>  debian.master/config/powerpc/config.common.powerpc |    4 ++++
>  debian.master/config/ppc64/config.common.ppc64     |    4 ++++
>  11 files changed, 39 insertions(+), 14 deletions(-)
> 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 897 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20121009/a89f9523/attachment.sig>


More information about the kernel-team mailing list