Skip to contentSkip to conversation

Oops on boot for omap3xxx, EHCI fails.

PATCH New Russ Dill 3 participants 5 messages Jun 20, 2012 – Jun 21, 2012

Subsystems (7)
lore
Share & tools
lore

Russ Dill

author
#0 lore raw

[PATCH] Fix OMAP EHCI suspend/resume failure (i693) '354ab856' causes an oops on boot for all omap3xxx platforms that use usbhs_omap for EHCI. The actual oops seems to come from faulty ehci-omap cleanup, but the failure caused by the change is evidenced here:

[    3.655059] ehci-omap ehci-omap.0: utmi_p1_gfclk failed error:-2
[    3.661376] ehci-omap: probe of ehci-omap.0 failed with error -2

The problem is the call:

omap->utmi_p1_fck = clk_get(dev, "utmi_p1_gfclk");

Where dev here is ehci-omap. As shown below, clk_get will fail with dev_id "ehci-omap" and clk_id "utmi_p1_gfclk" (but succeed on omap44xx).

arch/arm/mach-omap2/clock3xxx_data.c: CLK("usbhs_omap", "utmi_p1_gfclk",
arch/arm/mach-omap2/clock44xx_data.c: CLK(NULL, "utmi_p1_gfclk",

The oops caused by bad cleanup is shown below:

[    3.951934] Unable to handle kernel NULL pointer dereference at
virtual address 00000000
[    3.960418] pgd = c0004000
[    3.963256] [00000000] *pgd=00000000
[    3.967010] Internal error: Oops: 5 [#1] SMP ARM
[    3.971801] Modules linked in:
[    3.975006] CPU: 0    Not tainted  (3.5.0-rc1-ktest-00040-g354ab85 #401)
[    3.981964] PC is at hub_port_init+0x28c/0x968
[    3.986602] LR is at hub_port_init+0xc4/0x968
[    3.991119] pc : [<c03304f8>]    lr : [<c0330330>]    psr: 60000013
[    3.991119] sp : de11deb8  ip : c05eae4c  fp : 00000000
[    4.003082] r10: 00000000  r9 : de38ac00  r8 : 00000032
[    4.008514] r7 : de388800  r6 : 00000002  r5 : 00000000  r4 : de391800
[    4.015289] r3 : 00000000  r2 : c05de444  r1 : c05de468  r0 : de391868
[    4.022094] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM
Segment kernel
[    4.029693] Control: 10c5387d  Table: 80004019  DAC: 00000017
[    4.035675] Process khubd (pid: 242, stack limit = 0xde11c2f8)
[    4.041748] Stack: (0xde11deb8 to 0xde11e000)
[    4.046264] dea0:
    00000002 de38ac00
[    4.054779] dec0: 00000002 00000000 00000004 c00891b0 00000001
00000002 00000003 de378000
[    4.063293] dee0: 00000000 c0479d28 00000001 de391800 de388800
de378000 de378018 de38ac00
[    4.071807] df00: 00000002 00000000 00000002 c0333d68 00000501
00000000 c05df1b0 c069d600
[    4.080322] df20: 10a5bb6a de38ac08 de388420 de38889c de388400
00000004 de38ac70 de38ac01
[    4.088806] df40: de388800 de38ac68 de388800 de388420 de378000
00000009 de11df8c c0064834
[    4.097320] df60: 00000000 de11c000 00000000 de11f440 c005c75c
de11df74 de11df74 00000000
[    4.105834] df80: 00000501 c00891b0 de02ff18 de02fef0 00000000
c03336fc 00000013 00000000
[    4.114349] dfa0: 00000000 00000000 00000000 c005c064 00000000
00000000 00000000 00000000
[    4.122863] dfc0: 00000000 dead4ead ffffffff ffffffff c0747830
00000000 00000000 c0597cd0
[    4.131378] dfe0: de11dfe0 de11dfe0 de02fef0 c005bfe0 c0014154
c0014154 00000200 00000000
[    4.139892] [<c03304f8>] (hub_port_init+0x28c/0x968) from
[<c0333d68>] (hub_thread+0x66c/0x13d8)
[    4.149047] [<c0333d68>] (hub_thread+0x66c/0x13d8) from
[<c005c064>] (kthread+0x84/0x90)
[    4.157501] [<c005c064>] (kthread+0x84/0x90) from [<c0014154>]
(kernel_thread_exit+0x0/0x8)
[    4.166168] Code: e59f2690 e5933080 e2840068 e59f1688 (e593e000)
[    4.172607] ---[ end trace f11541c260e8a205 ]---
author
#1 lore raw

PATCH 1/2 ARM: OMAP: USB: Fixup ehci_hcd_omap_probe error path

A recent commit, [PATCH] Fix OMAP EHCI suspend/resume failure (i693) '354ab856' causes ehci probe to fail on omap3xxx. This exposed bugs in the ehci_hcd_omap_probe error path causing an oops.

On the error path, call usb_remove_hcd if usb_add_hcd has been called, and call usb_put_hcd if usb_alloc_hcd has been called.

Tested on BB-xM.

Signed-off-by Russ.Dill at ti.com
---
 drivers/usb/host/ehci-omap.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/usb/host/ehci-omap.c +5 -1
index 17cfb8a..6e15fc8 100644
@@ -347,7 +347,7 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
 	ret = usb_add_hcd(hcd, irq, IRQF_SHARED);
 	if (ret) {
 		dev_err(dev, "failed to add hcd with err %d\n", ret);
-		goto err_add_hcd;
+		goto err_pm_runtime;
 	}
 
 	/* root ports should always stay powered */
@@ -424,8 +424,12 @@ err_utmi_p1_fck:
 	clk_put(utmi_p1_fck);
 
 err_add_hcd:
+	usb_remove_hcd(hcd);
+
+err_pm_runtime:
 	disable_put_regulator(pdata);
 	pm_runtime_put_sync(dev);
+	usb_put_hcd(hcd);
 
 err_io:
 	iounmap(regs);
Signature · 1 line
1.7.10.4
author
#2 lore raw

PATCH 2/2 ARM: OMAP: USB: Fix omap3xxx EHCI regression caused by i693 errata fix.

[PATCH] Fix OMAP EHCI suspend/resume failure (i693) '354ab856' causes an oops on boot for all omap3xxx platforms that use usbhs_omap for EHCI. The actual oops comes from faulty ehci-omap cleanup, but the failure caused by the change is evidenced here:

[    3.655059] ehci-omap ehci-omap.0: utmi_p1_gfclk failed error:-2
[    3.661376] ehci-omap: probe of ehci-omap.0 failed with error -2

utmi_p1_gfclk is a clock that exists on OMAP4, but not OMAP3. In the OMAP3 case, it is configured as a dummy clock. However, OMAP4 lists the dev_id as NULL, but OMAP3 lists it as "usbhs_omap".

Attempting to get that clock from ehci-omap then fails. The solution is to just change the clock3xxx_data.c for dummy clocks used in the errata fix to match the dev_id, NULL, used in clock44xx_data.c.

Tested on BB-xM.

---
 arch/arm/mach-omap2/clock3xxx_data.c |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
arch/arm/mach-omap2/clock3xxx_data.c +7 -7
index 4e1a3b0..59d5315 100644
@@ -3391,15 +3391,15 @@ static struct omap_clk omap3xxx_clks[] = {
 	CLK(NULL,	"usbhost_48m_fck", &usbhost_48m_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
 	CLK(NULL,	"usbhost_ick",	&usbhost_ick,	CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
 	CLK("usbhs_omap",	"usbhost_ick",	&usbhost_ick,	CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
-	CLK("usbhs_omap",	"utmi_p1_gfclk",	&dummy_ck,	CK_3XXX),
-	CLK("usbhs_omap",	"utmi_p2_gfclk",	&dummy_ck,	CK_3XXX),
-	CLK("usbhs_omap",	"xclk60mhsp1_ck",	&dummy_ck,	CK_3XXX),
-	CLK("usbhs_omap",	"xclk60mhsp2_ck",	&dummy_ck,	CK_3XXX),
-	CLK("usbhs_omap",	"usb_host_hs_utmi_p1_clk",	&dummy_ck,	CK_3XXX),
-	CLK("usbhs_omap",	"usb_host_hs_utmi_p2_clk",	&dummy_ck,	CK_3XXX),
+	CLK(NULL,	"utmi_p1_gfclk",	&dummy_ck,	CK_3XXX),
+	CLK(NULL,	"utmi_p2_gfclk",	&dummy_ck,	CK_3XXX),
+	CLK(NULL,	"xclk60mhsp1_ck",	&dummy_ck,	CK_3XXX),
+	CLK(NULL,	"xclk60mhsp2_ck",	&dummy_ck,	CK_3XXX),
+	CLK(NULL,	"usb_host_hs_utmi_p1_clk",	&dummy_ck,	CK_3XXX),
+	CLK(NULL,	"usb_host_hs_utmi_p2_clk",	&dummy_ck,	CK_3XXX),
 	CLK("usbhs_omap",	"usb_tll_hs_usb_ch0_clk",	&dummy_ck,	CK_3XXX),
 	CLK("usbhs_omap",	"usb_tll_hs_usb_ch1_clk",	&dummy_ck,	CK_3XXX),
-	CLK("usbhs_omap",	"init_60m_fclk",	&dummy_ck,	CK_3XXX),
+	CLK(NULL,	"init_60m_fclk",	&dummy_ck,	CK_3XXX),
 	CLK(NULL,	"usim_fck",	&usim_fck,	CK_3430ES2PLUS | CK_36XX),
 	CLK(NULL,	"gpt1_fck",	&gpt1_fck,	CK_3XXX),
 	CLK(NULL,	"wkup_32k_fck",	&wkup_32k_fck,	CK_3XXX),
Signature · 1 line
1.7.10.4
#3 lore raw

PATCH 1/2 ARM: OMAP: USB: Fixup ehci_hcd_omap_probe error path

In reply to Russ Dill

Hello.

Quoted 2 lines · Russ Dill

A recent commit, [PATCH] Fix OMAP EHCI suspend/resume failure (i693) '354ab856'

Usually commit ID follows the word "commit", and then the commit summary.

Quoted 10 lines

causes ehci probe to fail on omap3xxx. This exposed bugs in the ehci_hcd_omap_probe error path causing an oops.

On the error path, call usb_remove_hcd if usb_add_hcd has been called, and call usb_put_hcd if usb_alloc_hcd has been called.

Tested on BB-xM.

Signed-off-by Russ.Dill at ti.com

It should be:

WBR, Sergei

maintainer
#4 lore raw

PATCH 1/2 ARM: OMAP: USB: Fixup ehci_hcd_omap_probe error path

In reply to Russ Dill
Quoted 11 lines · Russ Dill

A recent commit, [PATCH] Fix OMAP EHCI suspend/resume failure (i693) '354ab856' causes ehci probe to fail on omap3xxx. This exposed bugs in the ehci_hcd_omap_probe error path causing an oops.

On the error path, call usb_remove_hcd if usb_add_hcd has been called, and call usb_put_hcd if usb_alloc_hcd has been called.

Tested on BB-xM.

Signed-off-by Russ.Dill at ti.com