Skip to contentSkip to conversation

BUG: usb: obex in g_nokia.ko causing kernel panic

PATCH In review Pali Rohár 7 participants 22 messages Nov 19, 2013 – Apr 15, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Hi!

For a long time (since 3.5 or 3.8? - I do not remember) obex subdriver in g_nokia usb gadget module causing kernel panic after module is loaded on Nokia N900. I do not know where is problem and due to immediatelly kernel crash when loading driver I was not able to see any dmesg output. Now I was able to store something into mtd log and here is crash backtrace:

Log Entry 437 (at position 52)

<4>[   18.606414] [<c037eac0>] (__schedule+0x5c/0x50c) from [<c037d3bc>] (schedule_timeout+0x1f4/0x25c)
<4>[   18.623809] [<c037d3bc>] (schedule_timeout+0x1f4/0x25c) from [<c037f12c>] (wait_for_common+0xc8/0x1ac)
<4>[   18.649291] [<c037f12c>] (wait_for_common+0xc8/0x1ac) from [<c028c1c0>] (omap_i2c_xfer+0x338/0x488)
<4>[   18.674499] [<c028c1c0>] (omap_i2c_xfer+0x338/0x488) from [<c0288144>] (__i2c_transfer+0x40/0x74)
<4>[   18.692047] [<c0288144>] (__i2c_transfer+0x40/0x74) from [<c0288a2c>] (i2c_transfer+0x6c/0x90)
<4>[   18.709320] [<c0288a2c>] (i2c_transfer+0x6c/0x90) from [<c02351c8>] (regmap_i2c_read+0x48/0x68)
<4>[   18.726715] [<c02351c8>] (regmap_i2c_read+0x48/0x68) from [<c023161c>] (_regmap_raw_read+0x128/0x220)
<4>[   18.752685] [<c023161c>] (_regmap_raw_read+0x128/0x220) from [<c02317b4>] (regmap_raw_read+0xa0/0x130)
<4>[   18.779052] [<c02317b4>] (regmap_raw_read+0xa0/0x130) from [<c023193c>] (regmap_bulk_read+0xf8/0x16c)
<4>[   18.805694] [<c023193c>] (regmap_bulk_read+0xf8/0x16c) from [<c0238ea8>] (twl_i2c_read+0xa4/0xe0)
<4>[   18.823730] [<c0238ea8>] (twl_i2c_read+0xa4/0xe0) from [<c0274d34>] (__twl4030_phy_power.isra.12+0x1c/0x58)
<4>[   18.850921] [<c0274d34>] (__twl4030_phy_power.isra.12+0x1c/0x58) from [<c0274df0>] 
(twl4030_phy_power.part.14+0x80/0xc8)
<4>[   18.879699] [<c0274df0>] (twl4030_phy_power.part.14+0x80/0xc8) from [<c0274f9c>] 
(twl4030_set_suspend+0x54/0x1e8)
<4>[   18.908325] [<c0274f9c>] (twl4030_set_suspend+0x54/0x1e8) from [<c027c8c4>] 
(omap2430_runtime_resume+0x5c/0x64)
<4>[   18.937042] [<c027c8c4>] (omap2430_runtime_resume+0x5c/0x64) from [<c0225dd0>] 
(pm_generic_runtime_resume+0x2c/0x38)
<4>[   18.966461] [<c0225dd0>] (pm_generic_runtime_resume+0x2c/0x38) from [<c0229fe0>] (__rpm_callback+0x54/0x80)
<4>[   18.995117] [<c0229fe0>] (__rpm_callback+0x54/0x80) from [<c022a04c>] (rpm_callback+0x40/0x74)
<4>[   19.013610] [<c022a04c>] (rpm_callback+0x40/0x74) from [<c022b3c8>] (rpm_resume+0x448/0x63c)
<4>[   19.031921] [<c022b3c8>] (rpm_resume+0x448/0x63c) from [<c022b2e4>] (rpm_resume+0x364/0x63c)
<4>[   19.050140] [<c022b2e4>] (rpm_resume+0x364/0x63c) from [<c022b874>] (__pm_runtime_resume+0x48/0x74)
<4>[   19.077728] [<c022b874>] (__pm_runtime_resume+0x48/0x74) from [<c027b4fc>] (musb_gadget_pullup+0x1c/0xb4)
<4>[   19.105895] [<c027b4fc>] (musb_gadget_pullup+0x1c/0xb4) from [<bf025c14>] (usb_function_deactivate+0x54/0xa4 
[libcomposite])
<4>[   19.135955] [<bf025c14>] (usb_function_deactivate+0x54/0xa4 [libcomposite]) from [<bf05b3b8>] 
(obex_bind+0x124/0x1d8 [usb_f_obex])
<4>[   19.166870] [<bf05b3b8>] (obex_bind+0x124/0x1d8 [usb_f_obex]) from [<bf025794>] (usb_add_function+0x58/0xf4 
[libcomposite])
<4>[   19.197143] [<bf025794>] (usb_add_function+0x58/0xf4 [libcomposite]) from [<bf037420>] 
(nokia_bind_config+0x204/0x250 [g_nokia])
<4>[   19.227905] [<bf037420>] (nokia_bind_config+0x204/0x250 [g_nokia]) from [<bf0263fc>] (usb_add_config+0x28/0xc0 
[libcomposite])
<4>[   19.258483] [<bf0263fc>] (usb_add_config+0x28/0xc0 [libcomposite]) from [<bf03709c>] (nokia_bind+0x9c/0x21c 
[g_nokia])
<4>[   19.288421] [<bf03709c>] (nokia_bind+0x9c/0x21c [g_nokia]) from [<bf0275bc>] (composite_bind+0x74/0x180 
[libcomposite])
<4>[   19.318420] [<bf0275bc>] (composite_bind+0x74/0x180 [libcomposite]) from [<c027d658>] 
(udc_bind_to_driver+0x2c/0xc4)
<4>[   19.348114] [<c027d658>] (udc_bind_to_driver+0x2c/0xc4) from [<c027d764>] (usb_gadget_probe_driver+0x74/0x94)
<4>[   19.377166] [<c027d764>] (usb_gadget_probe_driver+0x74/0x94) from [<c00086f8>] (do_one_initcall+0x94/0x138)
<4>[   19.406005] [<c00086f8>] (do_one_initcall+0x94/0x138) from [<c007a460>] (load_module+0x113c/0x13c4)
<4>[   19.434051] [<c007a460>] (load_module+0x113c/0x13c4) from [<c007a7b4>] (SyS_init_module+0xcc/0xec)
<4>[   19.462127] [<c007a7b4>] (SyS_init_module+0xcc/0xec) from [<c000dd40>] (ret_fast_syscall+0x0/0x30)
<0>[   19.490753] Code: 0a00002e e1a00004 eb001438 e598300c (e5d3202c) 
<4>[   19.506805] ---[ end trace 060b62ec0d68a78b ]---
<0>[   19.523132] Kernel panic - not syncing: Fatal exception in interrupt

(above dump is from 3.12-rc5 kernel)

When I disable obex code in drivers/usb/gadget/nokia.c then gadget driver working fine without any crash, error or warning.

Here is patch which disabling obex code which I using (for 3.12):

drivers/usb/gadget/nokia.c +30 -30
index ba47977..869cbfa 100644
@@ -110,10 +110,10 @@ static struct usb_function *f_acm_cfg1;
 static struct usb_function *f_acm_cfg2;
 static struct usb_function *f_ecm_cfg1;
 static struct usb_function *f_ecm_cfg2;
-static struct usb_function *f_obex1_cfg1;
+/*static struct usb_function *f_obex1_cfg1;
 static struct usb_function *f_obex2_cfg1;
 static struct usb_function *f_obex1_cfg2;
-static struct usb_function *f_obex2_cfg2;
+static struct usb_function *f_obex2_cfg2;*/
 static struct usb_function *f_phonet_cfg1;
 static struct usb_function *f_phonet_cfg2;
 
@@ -136,20 +136,20 @@ static struct usb_configuration nokia_config_100ma_driver = {
 
 static struct usb_function_instance *fi_acm;
 static struct usb_function_instance *fi_ecm;
-static struct usb_function_instance *fi_obex1;
-static struct usb_function_instance *fi_obex2;
+/*static struct usb_function_instance *fi_obex1;
+static struct usb_function_instance *fi_obex2;*/
 static struct usb_function_instance *fi_phonet;
 
 static int __init nokia_bind_config(struct usb_configuration *c)
 {
 	struct usb_function *f_acm;
 	struct usb_function *f_phonet = NULL;
-	struct usb_function *f_obex1 = NULL;
+/*	struct usb_function *f_obex1 = NULL; */
 	struct usb_function *f_ecm;
-	struct usb_function *f_obex2 = NULL;
+/*	struct usb_function *f_obex2 = NULL; */
 	int status = 0;
-	int obex1_stat = 0;
-	int obex2_stat = 0;
+/*	int obex1_stat = 0;
+	int obex2_stat = 0;*/
 	int phonet_stat = 0;
 
 	if (!IS_ERR(fi_phonet)) {
@@ -158,7 +158,7 @@ static int __init nokia_bind_config(struct usb_configuration *c)
 			pr_debug("could not get phonet function\n");
 	}
 
-	if (!IS_ERR(fi_obex1)) {
+/*	if (!IS_ERR(fi_obex1)) {
 		f_obex1 = usb_get_function(fi_obex1);
 		if (IS_ERR(f_obex1))
 			pr_debug("could not get obex function 0\n");
@@ -168,7 +168,7 @@ static int __init nokia_bind_config(struct usb_configuration *c)
 		f_obex2 = usb_get_function(fi_obex2);
 		if (IS_ERR(f_obex2))
 			pr_debug("could not get obex function 1\n");
-	}
+	}*/
 
 	f_acm = usb_get_function(fi_acm);
 	if (IS_ERR(f_acm)) {
@@ -188,7 +188,7 @@ static int __init nokia_bind_config(struct usb_configuration *c)
 			pr_debug("could not add phonet function\n");
 	}
 
-	if (!IS_ERR_OR_NULL(f_obex1)) {
+/*	if (!IS_ERR_OR_NULL(f_obex1)) {
 		obex1_stat = usb_add_function(c, f_obex1);
 		if (obex1_stat)
 			pr_debug("could not add obex function 0\n");
@@ -198,7 +198,7 @@ static int __init nokia_bind_config(struct usb_configuration *c)
 		obex2_stat = usb_add_function(c, f_obex2);
 		if (obex2_stat)
 			pr_debug("could not add obex function 1\n");
-	}
+	}*/
 
 	status = usb_add_function(c, f_acm);
 	if (status)
@@ -213,14 +213,14 @@ static int __init nokia_bind_config(struct usb_configuration *c)
 		f_acm_cfg1 = f_acm;
 		f_ecm_cfg1 = f_ecm;
 		f_phonet_cfg1 = f_phonet;
-		f_obex1_cfg1 = f_obex1;
-		f_obex2_cfg1 = f_obex2;
+/*		f_obex1_cfg1 = f_obex1;
+		f_obex2_cfg1 = f_obex2;*/
 	} else {
 		f_acm_cfg2 = f_acm;
 		f_ecm_cfg2 = f_ecm;
 		f_phonet_cfg2 = f_phonet;
-		f_obex1_cfg2 = f_obex1;
-		f_obex2_cfg2 = f_obex2;
+/*		f_obex1_cfg2 = f_obex1;
+		f_obex2_cfg2 = f_obex2;*/
 	}
 
 	status = fsg_bind_config(c->cdev, c, &fsg_common);
@@ -232,20 +232,20 @@ static int __init nokia_bind_config(struct usb_configuration *c)
 err_ecm:
 	usb_remove_function(c, f_acm);
 err_conf:
-	if (!obex2_stat)
+/*	if (!obex2_stat)
 		usb_remove_function(c, f_obex2);
 	if (!obex1_stat)
-		usb_remove_function(c, f_obex1);
+		usb_remove_function(c, f_obex1);*/
 	if (!phonet_stat)
 		usb_remove_function(c, f_phonet);
 	usb_put_function(f_ecm);
 err_get_ecm:
 	usb_put_function(f_acm);
 err_get_acm:
-	if (!IS_ERR_OR_NULL(f_obex2))
+/*	if (!IS_ERR_OR_NULL(f_obex2))
 		usb_put_function(f_obex2);
 	if (!IS_ERR_OR_NULL(f_obex1))
-		usb_put_function(f_obex1);
+		usb_put_function(f_obex1);*/
 	if (!IS_ERR_OR_NULL(f_phonet))
 		usb_put_function(f_phonet);
 	return status;
@@ -285,13 +285,13 @@ static int __init nokia_bind(struct usb_composite_dev *cdev)
 	if (IS_ERR(fi_phonet))
 		pr_debug("could not find phonet function\n");
 
-	fi_obex1 = usb_get_function_instance("obex");
+/*	fi_obex1 = usb_get_function_instance("obex");
 	if (IS_ERR(fi_obex1))
 		pr_debug("could not find obex function 1\n");
 
 	fi_obex2 = usb_get_function_instance("obex");
 	if (IS_ERR(fi_obex2))
-		pr_debug("could not find obex function 2\n");
+		pr_debug("could not find obex function 2\n");*/
 
 	fi_acm = usb_get_function_instance("acm");
 	if (IS_ERR(fi_acm)) {
@@ -323,10 +323,10 @@ static int __init nokia_bind(struct usb_composite_dev *cdev)
 
 err_put_cfg1:
 	usb_put_function(f_acm_cfg1);
-	if (!IS_ERR_OR_NULL(f_obex1_cfg1))
+/*	if (!IS_ERR_OR_NULL(f_obex1_cfg1))
 		usb_put_function(f_obex1_cfg1);
 	if (!IS_ERR_OR_NULL(f_obex2_cfg1))
-		usb_put_function(f_obex2_cfg1);
+		usb_put_function(f_obex2_cfg1);*/
 	if (!IS_ERR_OR_NULL(f_phonet_cfg1))
 		usb_put_function(f_phonet_cfg1);
 	usb_put_function(f_ecm_cfg1);
@@ -335,10 +335,10 @@ err_ecm_inst:
 err_acm_inst:
 	usb_put_function_instance(fi_acm);
 err_obex2_inst:
-	if (!IS_ERR(fi_obex2))
+/*	if (!IS_ERR(fi_obex2))
 		usb_put_function_instance(fi_obex2);
 	if (!IS_ERR(fi_obex1))
-		usb_put_function_instance(fi_obex1);
+		usb_put_function_instance(fi_obex1);*/
 	if (!IS_ERR(fi_phonet))
 		usb_put_function_instance(fi_phonet);
 err_usb:
@@ -349,14 +349,14 @@ err_fsg:
 
 static int __exit nokia_unbind(struct usb_composite_dev *cdev)
 {
-	if (!IS_ERR_OR_NULL(f_obex1_cfg2))
+/*	if (!IS_ERR_OR_NULL(f_obex1_cfg2))
 		usb_put_function(f_obex1_cfg2);
 	if (!IS_ERR_OR_NULL(f_obex2_cfg2))
 		usb_put_function(f_obex2_cfg2);
 	if (!IS_ERR_OR_NULL(f_obex1_cfg1))
 		usb_put_function(f_obex1_cfg1);
 	if (!IS_ERR_OR_NULL(f_obex2_cfg1))
-		usb_put_function(f_obex2_cfg1);
+		usb_put_function(f_obex2_cfg1);*/
 	if (!IS_ERR_OR_NULL(f_phonet_cfg1))
 		usb_put_function(f_phonet_cfg1);
 	if (!IS_ERR_OR_NULL(f_phonet_cfg2))
@@ -367,10 +367,10 @@ static int __exit nokia_unbind(struct usb_composite_dev *cdev)
 	usb_put_function(f_ecm_cfg2);
 
 	usb_put_function_instance(fi_ecm);
-	if (!IS_ERR(fi_obex2))
+/*	if (!IS_ERR(fi_obex2))
 		usb_put_function_instance(fi_obex2);
 	if (!IS_ERR(fi_obex1))
-		usb_put_function_instance(fi_obex1);
+		usb_put_function_instance(fi_obex1);*/
 	if (!IS_ERR(fi_phonet))
 		usb_put_function_instance(fi_phonet);
 	usb_put_function_instance(fi_acm);

Please can you look where can be problem and why gadget causing immediatelly kernel panic?

Note that g_nokia.ko usb gadget is for nokia n900 device. And because it crashing (without above patch) I suggesting to remove or comment obex code, because really driver is unusable on that device...

Signature · 2 lines
Pali Rohár
[email protected]
#1 lore raw
Quoted 305 lines · On Tuesday 19 November 2013 11:51:12 Pali Rohár wrote:

Hi!

For a long time (since 3.5 or 3.8? - I do not remember) obex subdriver in g_nokia usb gadget module causing kernel panic after module is loaded on Nokia N900. I do not know where is problem and due to immediatelly kernel crash when loading driver I was not able to see any dmesg output. Now I was able to store something into mtd log and here is crash backtrace:

Log Entry 437 (at position 52)

<4>[   18.606414] [<c037eac0>] (__schedule+0x5c/0x50c) from

[<c037d3bc>] (schedule_timeout+0x1f4/0x25c) <4>[ 18.623809]
[<c037d3bc>] (schedule_timeout+0x1f4/0x25c) from [<c037f12c>]
(wait_for_common+0xc8/0x1ac) <4>[ 18.649291] [<c037f12c>]
(wait_for_common+0xc8/0x1ac) from [<c028c1c0>]
(omap_i2c_xfer+0x338/0x488) <4>[ 18.674499] [<c028c1c0>]
(omap_i2c_xfer+0x338/0x488) from [<c0288144>]
(__i2c_transfer+0x40/0x74) <4>[ 18.692047] [<c0288144>]
(__i2c_transfer+0x40/0x74) from [<c0288a2c>]
(i2c_transfer+0x6c/0x90) <4>[ 18.709320] [<c0288a2c>]
(i2c_transfer+0x6c/0x90) from [<c02351c8>]
(regmap_i2c_read+0x48/0x68) <4>[ 18.726715] [<c02351c8>]
(regmap_i2c_read+0x48/0x68) from [<c023161c>]
(_regmap_raw_read+0x128/0x220) <4>[ 18.752685] [<c023161c>]
(_regmap_raw_read+0x128/0x220) from [<c02317b4>]
(regmap_raw_read+0xa0/0x130) <4>[ 18.779052] [<c02317b4>]
(regmap_raw_read+0xa0/0x130) from [<c023193c>]
(regmap_bulk_read+0xf8/0x16c) <4>[ 18.805694] [<c023193c>]
(regmap_bulk_read+0xf8/0x16c) from [<c0238ea8>]
(twl_i2c_read+0xa4/0xe0) <4>[ 18.823730] [<c0238ea8>]
(twl_i2c_read+0xa4/0xe0) from [<c0274d34>]
(__twl4030_phy_power.isra.12+0x1c/0x58) <4>[ 18.850921]
[<c0274d34>] (__twl4030_phy_power.isra.12+0x1c/0x58) from [<c0274df0>] (twl4030_phy_power.part.14+0x80/0xc8)

<4>[   18.879699] [<c0274df0>]
(twl4030_phy_power.part.14+0x80/0xc8) from [<c0274f9c>]
(twl4030_set_suspend+0x54/0x1e8)
<4>[   18.908325] [<c0274f9c>]
(twl4030_set_suspend+0x54/0x1e8) from [<c027c8c4>]
(omap2430_runtime_resume+0x5c/0x64)
<4>[   18.937042] [<c027c8c4>]
(omap2430_runtime_resume+0x5c/0x64) from [<c0225dd0>]
(pm_generic_runtime_resume+0x2c/0x38)
<4>[   18.966461] [<c0225dd0>]

(pm_generic_runtime_resume+0x2c/0x38) from [<c0229fe0>]
(__rpm_callback+0x54/0x80) <4>[ 18.995117] [<c0229fe0>]
(__rpm_callback+0x54/0x80) from [<c022a04c>]
(rpm_callback+0x40/0x74) <4>[ 19.013610] [<c022a04c>]
(rpm_callback+0x40/0x74) from [<c022b3c8>]
(rpm_resume+0x448/0x63c) <4>[ 19.031921] [<c022b3c8>]
(rpm_resume+0x448/0x63c) from [<c022b2e4>]
(rpm_resume+0x364/0x63c) <4>[ 19.050140] [<c022b2e4>]
(rpm_resume+0x364/0x63c) from [<c022b874>]
(__pm_runtime_resume+0x48/0x74) <4>[ 19.077728]
[<c022b874>] (__pm_runtime_resume+0x48/0x74) from
[<c027b4fc>] (musb_gadget_pullup+0x1c/0xb4) <4>[ 19.105895]
[<c027b4fc>] (musb_gadget_pullup+0x1c/0xb4) from [<bf025c14>] (usb_function_deactivate+0x54/0xa4 [libcomposite])

<4>[   19.135955] [<bf025c14>]
(usb_function_deactivate+0x54/0xa4 [libcomposite]) from
[<bf05b3b8>] (obex_bind+0x124/0x1d8 [usb_f_obex])
<4>[   19.166870] [<bf05b3b8>] (obex_bind+0x124/0x1d8
[usb_f_obex]) from [<bf025794>] (usb_add_function+0x58/0xf4
[libcomposite])
<4>[   19.197143] [<bf025794>] (usb_add_function+0x58/0xf4
[libcomposite]) from [<bf037420>]
(nokia_bind_config+0x204/0x250 [g_nokia])
<4>[   19.227905] [<bf037420>] (nokia_bind_config+0x204/0x250
[g_nokia]) from [<bf0263fc>] (usb_add_config+0x28/0xc0
[libcomposite])
<4>[   19.258483] [<bf0263fc>] (usb_add_config+0x28/0xc0
[libcomposite]) from [<bf03709c>] (nokia_bind+0x9c/0x21c
[g_nokia])
<4>[   19.288421] [<bf03709c>] (nokia_bind+0x9c/0x21c
[g_nokia]) from [<bf0275bc>] (composite_bind+0x74/0x180
[libcomposite])
<4>[   19.318420] [<bf0275bc>] (composite_bind+0x74/0x180
[libcomposite]) from [<c027d658>]
(udc_bind_to_driver+0x2c/0xc4)
<4>[   19.348114] [<c027d658>] (udc_bind_to_driver+0x2c/0xc4)

from [<c027d764>] (usb_gadget_probe_driver+0x74/0x94) <4>[ 19.377166] [<c027d764>] (usb_gadget_probe_driver+0x74/0x94) from [<c00086f8>] (do_one_initcall+0x94/0x138) <4>[ 19.406005] [<c00086f8>] (do_one_initcall+0x94/0x138) from
[<c007a460>] (load_module+0x113c/0x13c4) <4>[ 19.434051]
[<c007a460>] (load_module+0x113c/0x13c4) from [<c007a7b4>]
(SyS_init_module+0xcc/0xec) <4>[ 19.462127] [<c007a7b4>]
(SyS_init_module+0xcc/0xec) from [<c000dd40>]
(ret_fast_syscall+0x0/0x30) <0>[ 19.490753] Code: 0a00002e
e1a00004 eb001438 e598300c (e5d3202c) <4>[ 19.506805] ---[
end trace 060b62ec0d68a78b ]--- <0>[ 19.523132] Kernel
panic - not syncing: Fatal exception in interrupt

(above dump is from 3.12-rc5 kernel)

When I disable obex code in drivers/usb/gadget/nokia.c then gadget driver working fine without any crash, error or warning.

Here is patch which disabling obex code which I using (for 3.12):

(quoted diff) +0 -0

b/drivers/usb/gadget/nokia.c index ba47977..869cbfa 100644

drivers/usb/gadget/nokia.c +8 -8
@@ -110,10 +110,10 @@ static struct usb_function *f_acm_cfg1;
 static struct usb_function *f_acm_cfg2;
 static struct usb_function *f_ecm_cfg1;
 static struct usb_function *f_ecm_cfg2;
-static struct usb_function *f_obex1_cfg1;
+/*static struct usb_function *f_obex1_cfg1;
 static struct usb_function *f_obex2_cfg1;
 static struct usb_function *f_obex1_cfg2;
-static struct usb_function *f_obex2_cfg2;
+static struct usb_function *f_obex2_cfg2;*/
 static struct usb_function *f_phonet_cfg1;
 static struct usb_function *f_phonet_cfg2;
 
@@ -136,20 +136,20 @@ static struct usb_configuration
 nokia_config_100ma_driver = {
 
 static struct usb_function_instance *fi_acm;
 static struct usb_function_instance *fi_ecm;
-static struct usb_function_instance *fi_obex1;
-static struct usb_function_instance *fi_obex2;
+/*static struct usb_function_instance *fi_obex1;
+static struct usb_function_instance *fi_obex2;*/
 static struct usb_function_instance *fi_phonet;
 
 static int __init nokia_bind_config(struct usb_configuration
 *c) {
 	struct usb_function *f_acm;
 	struct usb_function *f_phonet = NULL;
-	struct usb_function *f_obex1 = NULL;
+/*	struct usb_function *f_obex1 = NULL; */
 	struct usb_function *f_ecm;
-	struct usb_function *f_obex2 = NULL;
+/*	struct usb_function *f_obex2 = NULL; */
 	int status = 0;
-	int obex1_stat = 0;
-	int obex2_stat = 0;
+/*	int obex1_stat = 0;
+	int obex2_stat = 0;*/
 	int phonet_stat = 0;
 
drivers/usb/gadget/nokia.c +0 -0
 	if (!IS_ERR(fi_phonet)) {
@@ -158,7 +158,7 @@ static int __init nokia_bind_config(struct

usb_configuration *c) pr_debug("could not get phonet function\n");

drivers/usb/gadget/nokia.c +2 -2
 	}
 
-	if (!IS_ERR(fi_obex1)) {
+/*	if (!IS_ERR(fi_obex1)) {
 		f_obex1 = usb_get_function(fi_obex1);
 		if (IS_ERR(f_obex1))
 			pr_debug("could not get obex function 0\n");
@@ -168,7 +168,7 @@ static int __init nokia_bind_config(struct
 usb_configuration *c) f_obex2 = usb_get_function(fi_obex2);
 		if (IS_ERR(f_obex2))
 			pr_debug("could not get obex function 1\n");
-	}
+	}*/
 
 	f_acm = usb_get_function(fi_acm);
 	if (IS_ERR(f_acm)) {
@@ -188,7 +188,7 @@ static int __init nokia_bind_config(struct

usb_configuration *c) pr_debug("could not add phonet function\n");

drivers/usb/gadget/nokia.c +2 -2
 	}
 
-	if (!IS_ERR_OR_NULL(f_obex1)) {
+/*	if (!IS_ERR_OR_NULL(f_obex1)) {
 		obex1_stat = usb_add_function(c, f_obex1);
 		if (obex1_stat)
 			pr_debug("could not add obex function 0\n");
@@ -198,7 +198,7 @@ static int __init nokia_bind_config(struct
 usb_configuration *c) obex2_stat = usb_add_function(c,
 f_obex2);
 		if (obex2_stat)
 			pr_debug("could not add obex function 1\n");
-	}
+	}*/
 
 	status = usb_add_function(c, f_acm);
drivers/usb/gadget/nokia.c +0 -0
 	if (status)
@@ -213,14 +213,14 @@ static int __init

nokia_bind_config(struct usb_configuration *c) f_acm_cfg1 = f_acm;

drivers/usb/gadget/nokia.c +4 -4
 		f_ecm_cfg1 = f_ecm;
 		f_phonet_cfg1 = f_phonet;
-		f_obex1_cfg1 = f_obex1;
-		f_obex2_cfg1 = f_obex2;
+/*		f_obex1_cfg1 = f_obex1;
+		f_obex2_cfg1 = f_obex2;*/
 	} else {
 		f_acm_cfg2 = f_acm;
 		f_ecm_cfg2 = f_ecm;
 		f_phonet_cfg2 = f_phonet;
-		f_obex1_cfg2 = f_obex1;
-		f_obex2_cfg2 = f_obex2;
+/*		f_obex1_cfg2 = f_obex1;
+		f_obex2_cfg2 = f_obex2;*/
 	}
 
 	status = fsg_bind_config(c->cdev, c, &fsg_common);
@@ -232,20 +232,20 @@ static int __init

nokia_bind_config(struct usb_configuration *c) err_ecm:

drivers/usb/gadget/nokia.c +8 -8
 	usb_remove_function(c, f_acm);
 err_conf:
-	if (!obex2_stat)
+/*	if (!obex2_stat)
 		usb_remove_function(c, f_obex2);
 	if (!obex1_stat)
-		usb_remove_function(c, f_obex1);
+		usb_remove_function(c, f_obex1);*/
 	if (!phonet_stat)
 		usb_remove_function(c, f_phonet);
 	usb_put_function(f_ecm);
 err_get_ecm:
 	usb_put_function(f_acm);
 err_get_acm:
-	if (!IS_ERR_OR_NULL(f_obex2))
+/*	if (!IS_ERR_OR_NULL(f_obex2))
 		usb_put_function(f_obex2);
 	if (!IS_ERR_OR_NULL(f_obex1))
-		usb_put_function(f_obex1);
+		usb_put_function(f_obex1);*/
 	if (!IS_ERR_OR_NULL(f_phonet))
 		usb_put_function(f_phonet);
 	return status;
@@ -285,13 +285,13 @@ static int __init nokia_bind(struct
 usb_composite_dev *cdev) if (IS_ERR(fi_phonet))
 		pr_debug("could not find phonet function\n");
 
-	fi_obex1 = usb_get_function_instance("obex");
+/*	fi_obex1 = usb_get_function_instance("obex");
 	if (IS_ERR(fi_obex1))
 		pr_debug("could not find obex function 1\n");
 
 	fi_obex2 = usb_get_function_instance("obex");
 	if (IS_ERR(fi_obex2))
-		pr_debug("could not find obex function 2\n");
+		pr_debug("could not find obex function 2\n");*/
 
 	fi_acm = usb_get_function_instance("acm");
 	if (IS_ERR(fi_acm)) {
@@ -323,10 +323,10 @@ static int __init nokia_bind(struct
 usb_composite_dev *cdev)
 
 err_put_cfg1:
 	usb_put_function(f_acm_cfg1);
-	if (!IS_ERR_OR_NULL(f_obex1_cfg1))
+/*	if (!IS_ERR_OR_NULL(f_obex1_cfg1))
 		usb_put_function(f_obex1_cfg1);
 	if (!IS_ERR_OR_NULL(f_obex2_cfg1))
-		usb_put_function(f_obex2_cfg1);
+		usb_put_function(f_obex2_cfg1);*/
 	if (!IS_ERR_OR_NULL(f_phonet_cfg1))
 		usb_put_function(f_phonet_cfg1);
drivers/usb/gadget/nokia.c +6 -6
 	usb_put_function(f_ecm_cfg1);
@@ -335,10 +335,10 @@ err_ecm_inst:
 err_acm_inst:
 	usb_put_function_instance(fi_acm);
 err_obex2_inst:
-	if (!IS_ERR(fi_obex2))
+/*	if (!IS_ERR(fi_obex2))
 		usb_put_function_instance(fi_obex2);
 	if (!IS_ERR(fi_obex1))
-		usb_put_function_instance(fi_obex1);
+		usb_put_function_instance(fi_obex1);*/
 	if (!IS_ERR(fi_phonet))
 		usb_put_function_instance(fi_phonet);
 err_usb:
@@ -349,14 +349,14 @@ err_fsg:
 
 static int __exit nokia_unbind(struct usb_composite_dev
 *cdev) {
-	if (!IS_ERR_OR_NULL(f_obex1_cfg2))
+/*	if (!IS_ERR_OR_NULL(f_obex1_cfg2))
 		usb_put_function(f_obex1_cfg2);
 	if (!IS_ERR_OR_NULL(f_obex2_cfg2))
 		usb_put_function(f_obex2_cfg2);
 	if (!IS_ERR_OR_NULL(f_obex1_cfg1))
 		usb_put_function(f_obex1_cfg1);
 	if (!IS_ERR_OR_NULL(f_obex2_cfg1))
-		usb_put_function(f_obex2_cfg1);
+		usb_put_function(f_obex2_cfg1);*/
 	if (!IS_ERR_OR_NULL(f_phonet_cfg1))
 		usb_put_function(f_phonet_cfg1);
 	if (!IS_ERR_OR_NULL(f_phonet_cfg2))
@@ -367,10 +367,10 @@ static int __exit nokia_unbind(struct
 usb_composite_dev *cdev) usb_put_function(f_ecm_cfg2);
 
 	usb_put_function_instance(fi_ecm);
-	if (!IS_ERR(fi_obex2))
+/*	if (!IS_ERR(fi_obex2))
 		usb_put_function_instance(fi_obex2);
 	if (!IS_ERR(fi_obex1))
-		usb_put_function_instance(fi_obex1);
+		usb_put_function_instance(fi_obex1);*/
 	if (!IS_ERR(fi_phonet))
 		usb_put_function_instance(fi_phonet);
 	usb_put_function_instance(fi_acm);
Quoted 7 lines

Please can you look where can be problem and why gadget causing immediatelly kernel panic?

Note that g_nokia.ko usb gadget is for nokia n900 device. And because it crashing (without above patch) I suggesting to remove or comment obex code, because really driver is unusable on that device...

Hi! can you look at this problem?

Signature · 2 lines
Pali Rohár
[email protected]
#2 lore raw
Quoted 10 lines · Pali Rohár
Quoted 7 lines · On Tuesday 19 November 2013 11:51:12 Pali Rohár wrote:

For a long time (since 3.5 or 3.8? - I do not remember) obex subdriver in g_nokia usb gadget module causing kernel panic after module is loaded on Nokia N900. I do not know where is problem and due to immediatelly kernel crash when loading driver I was not able to see any dmesg output. Now I was able to store something into mtd log and here is crash backtrace:
[...]

Hi! can you look at this problem?

So it worked at some time?
Have you tried to git bisect the problem?

-- Sebastian

#3 lore raw
Quoted 10 lines · On Tuesday 26 November 2013 18:17:49 Sebastian Reichel wrote:
Quoted 9 lines · Pali Rohár
Quoted 7 lines · On Tuesday 19 November 2013 11:51:12 Pali Rohár wrote:

For a long time (since 3.5 or 3.8? - I do not remember) obex subdriver in g_nokia usb gadget module causing kernel panic after module is loaded on Nokia N900. I do not know where is problem and due to immediatelly kernel crash when loading driver I was not able to see any dmesg output. Now I was able to store something into mtd log and here is crash backtrace: [...]

Quoted 6 lines
Quoted 1 line

Hi! can you look at this problem?

So it worked at some time?
Have you tried to git bisect the problem?

-- Sebastian

Yes, if I remember it worked with some older 3.x kernel. I do not know if I still have old tree. But there is problem with bisecting, because booting older kernel is hard on n900... At lest on 2.6.28 kernel g_nokia.ko working fine.

Signature · 2 lines
Pali Rohár
[email protected]
#4 lore raw
In reply to Sebastian Reichel
Quoted 10 lines · Sebastian Reichel
Quoted 9 lines · Pali Rohár
Quoted 7 lines · On Tuesday 19 November 2013 11:51:12 Pali Rohár wrote:

For a long time (since 3.5 or 3.8? - I do not remember) obex subdriver in g_nokia usb gadget module causing kernel panic after module is loaded on Nokia N900. I do not know where is problem and due to immediatelly kernel crash when loading driver I was not able to see any dmesg output. Now I was able to store something into mtd log and here is crash backtrace:
[...]

Quoted 4 lines
Quoted 1 line

Hi! can you look at this problem?

So it worked at some time?
Have you tried to git bisect the problem?

You are a cruel person :-). N900 historically boots about half of the time, trying to do git bisect there is a nice weekend project... for about next century or so.

Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#5 lore raw

Hi,

Quoted 8 lines · Pavel Machek
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines

For a long time (since 3.5 or 3.8? - I do not remember) obex subdriver in g_nokia usb gadget module causing kernel panic after module is loaded on Nokia N900. I do not know where is problem and due to immediatelly kernel crash when loading driver I was not able to see any dmesg output. Now I was able to store something into mtd log and here is crash backtrace:
[...]

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

Hi! can you look at this problem?

So it worked at some time?
Have you tried to git bisect the problem?

You are a cruel person :-). N900 historically boots about half of the time, trying to do git bisect there is a nice weekend project... for about next century or so.

heh, I'll agree to that :-)

Signature · 1 line
balbi
#6 lore raw
In reply to Pali Rohár

Hi,

Quoted 60 lines · Pali Rohár

Hi!

For a long time (since 3.5 or 3.8? - I do not remember) obex subdriver in g_nokia usb gadget module causing kernel panic after module is loaded on Nokia N900. I do not know where is problem and due to immediatelly kernel crash when loading driver I was not able to see any dmesg output. Now I was able to store something into mtd log and here is crash backtrace:

Log Entry 437 (at position 52)

<4>[   18.606414] [<c037eac0>] (__schedule+0x5c/0x50c) from [<c037d3bc>] (schedule_timeout+0x1f4/0x25c)
<4>[   18.623809] [<c037d3bc>] (schedule_timeout+0x1f4/0x25c) from [<c037f12c>] (wait_for_common+0xc8/0x1ac)
<4>[   18.649291] [<c037f12c>] (wait_for_common+0xc8/0x1ac) from [<c028c1c0>] (omap_i2c_xfer+0x338/0x488)
<4>[   18.674499] [<c028c1c0>] (omap_i2c_xfer+0x338/0x488) from [<c0288144>] (__i2c_transfer+0x40/0x74)
<4>[   18.692047] [<c0288144>] (__i2c_transfer+0x40/0x74) from [<c0288a2c>] (i2c_transfer+0x6c/0x90)
<4>[   18.709320] [<c0288a2c>] (i2c_transfer+0x6c/0x90) from [<c02351c8>] (regmap_i2c_read+0x48/0x68)
<4>[   18.726715] [<c02351c8>] (regmap_i2c_read+0x48/0x68) from [<c023161c>] (_regmap_raw_read+0x128/0x220)
<4>[   18.752685] [<c023161c>] (_regmap_raw_read+0x128/0x220) from [<c02317b4>] (regmap_raw_read+0xa0/0x130)
<4>[   18.779052] [<c02317b4>] (regmap_raw_read+0xa0/0x130) from [<c023193c>] (regmap_bulk_read+0xf8/0x16c)
<4>[   18.805694] [<c023193c>] (regmap_bulk_read+0xf8/0x16c) from [<c0238ea8>] (twl_i2c_read+0xa4/0xe0)
<4>[   18.823730] [<c0238ea8>] (twl_i2c_read+0xa4/0xe0) from [<c0274d34>] (__twl4030_phy_power.isra.12+0x1c/0x58)
<4>[   18.850921] [<c0274d34>] (__twl4030_phy_power.isra.12+0x1c/0x58) from [<c0274df0>] 
(twl4030_phy_power.part.14+0x80/0xc8)
<4>[   18.879699] [<c0274df0>] (twl4030_phy_power.part.14+0x80/0xc8) from [<c0274f9c>] 
(twl4030_set_suspend+0x54/0x1e8)
<4>[   18.908325] [<c0274f9c>] (twl4030_set_suspend+0x54/0x1e8) from [<c027c8c4>] 
(omap2430_runtime_resume+0x5c/0x64)
<4>[   18.937042] [<c027c8c4>] (omap2430_runtime_resume+0x5c/0x64) from [<c0225dd0>] 
(pm_generic_runtime_resume+0x2c/0x38)
<4>[   18.966461] [<c0225dd0>] (pm_generic_runtime_resume+0x2c/0x38) from [<c0229fe0>] (__rpm_callback+0x54/0x80)
<4>[   18.995117] [<c0229fe0>] (__rpm_callback+0x54/0x80) from [<c022a04c>] (rpm_callback+0x40/0x74)
<4>[   19.013610] [<c022a04c>] (rpm_callback+0x40/0x74) from [<c022b3c8>] (rpm_resume+0x448/0x63c)
<4>[   19.031921] [<c022b3c8>] (rpm_resume+0x448/0x63c) from [<c022b2e4>] (rpm_resume+0x364/0x63c)
<4>[   19.050140] [<c022b2e4>] (rpm_resume+0x364/0x63c) from [<c022b874>] (__pm_runtime_resume+0x48/0x74)
<4>[   19.077728] [<c022b874>] (__pm_runtime_resume+0x48/0x74) from [<c027b4fc>] (musb_gadget_pullup+0x1c/0xb4)
<4>[   19.105895] [<c027b4fc>] (musb_gadget_pullup+0x1c/0xb4) from [<bf025c14>] (usb_function_deactivate+0x54/0xa4 
[libcomposite])
<4>[   19.135955] [<bf025c14>] (usb_function_deactivate+0x54/0xa4 [libcomposite]) from [<bf05b3b8>] 
(obex_bind+0x124/0x1d8 [usb_f_obex])
<4>[   19.166870] [<bf05b3b8>] (obex_bind+0x124/0x1d8 [usb_f_obex]) from [<bf025794>] (usb_add_function+0x58/0xf4 
[libcomposite])
<4>[   19.197143] [<bf025794>] (usb_add_function+0x58/0xf4 [libcomposite]) from [<bf037420>] 
(nokia_bind_config+0x204/0x250 [g_nokia])
<4>[   19.227905] [<bf037420>] (nokia_bind_config+0x204/0x250 [g_nokia]) from [<bf0263fc>] (usb_add_config+0x28/0xc0 
[libcomposite])
<4>[   19.258483] [<bf0263fc>] (usb_add_config+0x28/0xc0 [libcomposite]) from [<bf03709c>] (nokia_bind+0x9c/0x21c 
[g_nokia])
<4>[   19.288421] [<bf03709c>] (nokia_bind+0x9c/0x21c [g_nokia]) from [<bf0275bc>] (composite_bind+0x74/0x180 
[libcomposite])
<4>[   19.318420] [<bf0275bc>] (composite_bind+0x74/0x180 [libcomposite]) from [<c027d658>] 
(udc_bind_to_driver+0x2c/0xc4)
<4>[   19.348114] [<c027d658>] (udc_bind_to_driver+0x2c/0xc4) from [<c027d764>] (usb_gadget_probe_driver+0x74/0x94)
<4>[   19.377166] [<c027d764>] (usb_gadget_probe_driver+0x74/0x94) from [<c00086f8>] (do_one_initcall+0x94/0x138)
<4>[   19.406005] [<c00086f8>] (do_one_initcall+0x94/0x138) from [<c007a460>] (load_module+0x113c/0x13c4)
<4>[   19.434051] [<c007a460>] (load_module+0x113c/0x13c4) from [<c007a7b4>] (SyS_init_module+0xcc/0xec)
<4>[   19.462127] [<c007a7b4>] (SyS_init_module+0xcc/0xec) from [<c000dd40>] (ret_fast_syscall+0x0/0x30)
<0>[   19.490753] Code: 0a00002e e1a00004 eb001438 e598300c (e5d3202c) 
<4>[   19.506805] ---[ end trace 060b62ec0d68a78b ]---
<0>[   19.523132] Kernel panic - not syncing: Fatal exception in interrupt
Quoted 1 line

(above dump is from 3.12-rc5 kernel)

looks like it's trying to do i2c transfers from atomic. But why only when obex is enabled ? Makes no sense. What do you have on userland ? Is there anything trying to access the obex interface ? Was the USB cable attached at that time ?

Signature · 1 line
balbi
#7 lore raw
Quoted 100 lines · On Tuesday 26 November 2013 18:16:06 Felipe Balbi wrote:

Hi,

Quoted 97 lines · Pali Rohár

Hi!

For a long time (since 3.5 or 3.8? - I do not remember) obex subdriver in g_nokia usb gadget module causing kernel panic after module is loaded on Nokia N900. I do not know where is problem and due to immediatelly kernel crash when loading driver I was not able to see any dmesg output. Now I was able to store something into mtd log and here is crash backtrace:

Log Entry 437 (at position 52)

<4>[   18.606414] [<c037eac0>] (__schedule+0x5c/0x50c) from

[<c037d3bc>] (schedule_timeout+0x1f4/0x25c) <4>[ 18.623809] [<c037d3bc>] (schedule_timeout+0x1f4/0x25c) from
[<c037f12c>] (wait_for_common+0xc8/0x1ac) <4>[ 18.649291]
[<c037f12c>] (wait_for_common+0xc8/0x1ac) from [<c028c1c0>]
(omap_i2c_xfer+0x338/0x488) <4>[ 18.674499] [<c028c1c0>]
(omap_i2c_xfer+0x338/0x488) from [<c0288144>]
(__i2c_transfer+0x40/0x74) <4>[ 18.692047] [<c0288144>]
(__i2c_transfer+0x40/0x74) from [<c0288a2c>]
(i2c_transfer+0x6c/0x90) <4>[ 18.709320] [<c0288a2c>]
(i2c_transfer+0x6c/0x90) from [<c02351c8>]
(regmap_i2c_read+0x48/0x68) <4>[ 18.726715] [<c02351c8>]
(regmap_i2c_read+0x48/0x68) from [<c023161c>]
(_regmap_raw_read+0x128/0x220) <4>[ 18.752685]
[<c023161c>] (_regmap_raw_read+0x128/0x220) from
[<c02317b4>] (regmap_raw_read+0xa0/0x130) <4>[ 18.779052]
[<c02317b4>] (regmap_raw_read+0xa0/0x130) from [<c023193c>]
(regmap_bulk_read+0xf8/0x16c) <4>[ 18.805694]
[<c023193c>] (regmap_bulk_read+0xf8/0x16c) from
[<c0238ea8>] (twl_i2c_read+0xa4/0xe0) <4>[ 18.823730]
[<c0238ea8>] (twl_i2c_read+0xa4/0xe0) from [<c0274d34>]
(__twl4030_phy_power.isra.12+0x1c/0x58) <4>[ 18.850921]
[<c0274d34>] (__twl4030_phy_power.isra.12+0x1c/0x58) from [<c0274df0>] (twl4030_phy_power.part.14+0x80/0xc8)

<4>[   18.879699] [<c0274df0>]
(twl4030_phy_power.part.14+0x80/0xc8) from [<c0274f9c>]
(twl4030_set_suspend+0x54/0x1e8)
<4>[   18.908325] [<c0274f9c>]
(twl4030_set_suspend+0x54/0x1e8) from [<c027c8c4>]
(omap2430_runtime_resume+0x5c/0x64)
<4>[   18.937042] [<c027c8c4>]
(omap2430_runtime_resume+0x5c/0x64) from [<c0225dd0>]
(pm_generic_runtime_resume+0x2c/0x38)
<4>[   18.966461] [<c0225dd0>]

(pm_generic_runtime_resume+0x2c/0x38) from [<c0229fe0>]
(__rpm_callback+0x54/0x80) <4>[ 18.995117] [<c0229fe0>]
(__rpm_callback+0x54/0x80) from [<c022a04c>]
(rpm_callback+0x40/0x74) <4>[ 19.013610] [<c022a04c>]
(rpm_callback+0x40/0x74) from [<c022b3c8>]
(rpm_resume+0x448/0x63c) <4>[ 19.031921] [<c022b3c8>]
(rpm_resume+0x448/0x63c) from [<c022b2e4>]
(rpm_resume+0x364/0x63c) <4>[ 19.050140] [<c022b2e4>]
(rpm_resume+0x364/0x63c) from [<c022b874>]
(__pm_runtime_resume+0x48/0x74) <4>[ 19.077728]
[<c022b874>] (__pm_runtime_resume+0x48/0x74) from [<c027b4fc>] (musb_gadget_pullup+0x1c/0xb4) <4>[ 19.105895] [<c027b4fc>] (musb_gadget_pullup+0x1c/0xb4) from [<bf025c14>] (usb_function_deactivate+0x54/0xa4 [libcomposite])

<4>[   19.135955] [<bf025c14>]
(usb_function_deactivate+0x54/0xa4 [libcomposite]) from
[<bf05b3b8>] (obex_bind+0x124/0x1d8 [usb_f_obex])
<4>[   19.166870] [<bf05b3b8>] (obex_bind+0x124/0x1d8
[usb_f_obex]) from [<bf025794>] (usb_add_function+0x58/0xf4
[libcomposite])
<4>[   19.197143] [<bf025794>] (usb_add_function+0x58/0xf4
[libcomposite]) from [<bf037420>]
(nokia_bind_config+0x204/0x250 [g_nokia])
<4>[   19.227905] [<bf037420>]
(nokia_bind_config+0x204/0x250 [g_nokia]) from [<bf0263fc>]
(usb_add_config+0x28/0xc0 [libcomposite])
<4>[   19.258483] [<bf0263fc>] (usb_add_config+0x28/0xc0
[libcomposite]) from [<bf03709c>] (nokia_bind+0x9c/0x21c
[g_nokia])
<4>[   19.288421] [<bf03709c>] (nokia_bind+0x9c/0x21c
[g_nokia]) from [<bf0275bc>] (composite_bind+0x74/0x180
[libcomposite])
<4>[   19.318420] [<bf0275bc>] (composite_bind+0x74/0x180
[libcomposite]) from [<c027d658>]
(udc_bind_to_driver+0x2c/0xc4)
<4>[   19.348114] [<c027d658>]

(udc_bind_to_driver+0x2c/0xc4) from [<c027d764>]
(usb_gadget_probe_driver+0x74/0x94) <4>[ 19.377166]
[<c027d764>] (usb_gadget_probe_driver+0x74/0x94) from
[<c00086f8>] (do_one_initcall+0x94/0x138) <4>[ 19.406005]
[<c00086f8>] (do_one_initcall+0x94/0x138) from [<c007a460>]
(load_module+0x113c/0x13c4) <4>[ 19.434051] [<c007a460>]
(load_module+0x113c/0x13c4) from [<c007a7b4>]
(SyS_init_module+0xcc/0xec) <4>[ 19.462127] [<c007a7b4>]
(SyS_init_module+0xcc/0xec) from [<c000dd40>]
(ret_fast_syscall+0x0/0x30) <0>[ 19.490753] Code:
0a00002e e1a00004 eb001438 e598300c (e5d3202c) <4>[ 19.506805] ---[ end trace 060b62ec0d68a78b ]--- <0>[ 19.523132] Kernel panic - not syncing: Fatal exception in interrupt

Quoted 6 lines
Quoted 1 line

(above dump is from 3.12-rc5 kernel)

looks like it's trying to do i2c transfers from atomic. But why only when obex is enabled ? Makes no sense. What do you have on userland ? Is there anything trying to access the obex interface ? Was the USB cable attached at that time ?

Yes, only when initliaizing obex. Other is ok. Problem is there with Maemo userland and also with clean userland (rescueOS) where is only busybox and some simple init scripts. On Maemo maybe something is trying to access obex, but on rescueOS for sure nothing. Problem happends when cable is attached and also when not = always.

Signature · 2 lines
Pali Rohár
[email protected]
#8 lore raw

Hi,

On Tue, Nov 26, 2013 at 06:28:05PM +0100, Pali Rohár wrote:

[ snip ]

Quoted 7 lines
Quoted 6 lines
Quoted 1 line

(above dump is from 3.12-rc5 kernel)

looks like it's trying to do i2c transfers from atomic. But why only when obex is enabled ? Makes no sense. What do you have on userland ? Is there anything trying to access the obex interface ? Was the USB cable attached at that time ?

Quoted 6 lines

Yes, only when initliaizing obex. Other is ok. Problem is there with Maemo userland and also with clean userland (rescueOS) where is only busybox and some simple init scripts. On Maemo maybe something is trying to access obex, but on rescueOS for sure nothing. Problem happends when cable is attached and also when not = always.

As a debug effort, can you apply hack below and see if it "helps" ?

drivers/usb/gadget/f_obex.c +6 -0
index ad39f1d..4af2f06 100644
@@ -267,10 +267,12 @@ static void obex_connect(struct gserial *g)
 	if (!obex->can_activate)
 		return;
 
+#if 0
 	status = usb_function_activate(&g->func);
 	if (status)
 		DBG(cdev, "obex ttyGS%d function activate --> %d\n",
 			obex->port_num, status);
+#endif
 }
 
 static void obex_disconnect(struct gserial *g)
@@ -282,10 +284,12 @@ static void obex_disconnect(struct gserial *g)
 	if (!obex->can_activate)
 		return;
 
+#if 0
 	status = usb_function_deactivate(&g->func);
 	if (status)
 		DBG(cdev, "obex ttyGS%d function deactivate --> %d\n",
 			obex->port_num, status);
+#endif
 }
 
 /*-------------------------------------------------------------------------*/
@@ -372,6 +376,7 @@ static int obex_bind(struct usb_configuration *c, struct usb_function *f)
 	if (status)
 		goto fail;
 
+#if 0
 	/* Avoid letting this gadget enumerate until the userspace
 	 * OBEX server is active.
 	 */
@@ -381,6 +386,7 @@ static int obex_bind(struct usb_configuration *c, struct usb_function *f)
 			obex->port_num, status);
 	else
 		obex->can_activate = true;
+#endif
 
 
 	DBG(cdev, "obex ttyGS%d: %s speed IN/%s OUT/%s\n",
Signature · 1 line
balbi
#9 lore raw
Quoted 71 lines · On Tuesday 26 November 2013 18:39:54 Felipe Balbi wrote:

Hi,

On Tue, Nov 26, 2013 at 06:28:05PM +0100, Pali Rohár wrote:

[ snip ]

Quoted 8 lines
Quoted 7 lines
Quoted 1 line

(above dump is from 3.12-rc5 kernel)

looks like it's trying to do i2c transfers from atomic. But why only when obex is enabled ? Makes no sense. What do you have on userland ? Is there anything trying to access the obex interface ? Was the USB cable attached at that time ?

Quoted 6 lines

Yes, only when initliaizing obex. Other is ok. Problem is there with Maemo userland and also with clean userland (rescueOS) where is only busybox and some simple init scripts. On Maemo maybe something is trying to access obex, but on rescueOS for sure nothing. Problem happends when cable is attached and also when not = always.

As a debug effort, can you apply hack below and see if it "helps" ?

(quoted diff) +0 -0

b/drivers/usb/gadget/f_obex.c index ad39f1d..4af2f06 100644

drivers/usb/gadget/f_obex.c +4 -1
@@ -267,10 +267,12 @@ static void obex_connect(struct gserial
 *g) if (!obex->can_activate)
 		return;
 
+#if 0
 	status = usb_function_activate(&g->func);
 	if (status)
 		DBG(cdev, "obex ttyGS%d function activate --> %d\n",
 			obex->port_num, status);
+#endif
 }
 
 static void obex_disconnect(struct gserial *g)
@@ -282,10 +284,12 @@ static void obex_disconnect(struct
 gserial *g) if (!obex->can_activate)
 		return;
 
+#if 0
 	status = usb_function_deactivate(&g->func);
 	if (status)
 		DBG(cdev, "obex ttyGS%d function deactivate --> %d\n",
 			obex->port_num, status);
+#endif
 }
 
 /*-----------------------------------------------------------
--------------*/ @@ -372,6 +376,7 @@ static int

obex_bind(struct usb_configuration *c, struct usb_function *f) if (status)

drivers/usb/gadget/f_obex.c +2 -0
 		goto fail;
 
+#if 0
 	/* Avoid letting this gadget enumerate until the userspace
 	 * OBEX server is active.
 	 */
@@ -381,6 +386,7 @@ static int obex_bind(struct
 usb_configuration *c, struct usb_function *f) obex->port_num,
 status);
 	else
 		obex->can_activate = true;
+#endif
 
 
Quoted 1 line

DBG(cdev, "obex ttyGS%d: %s speed IN/%s OUT/%s\n",

Hi, with above patch g_nokia.ko working and not crashing.

Signature · 2 lines
Pali Rohár
[email protected]
#10 lore raw

Hi,

Quoted 65 lines · Pali Rohár
Quoted 65 lines
Quoted 8 lines
Quoted 7 lines
Quoted 1 line

(above dump is from 3.12-rc5 kernel)

looks like it's trying to do i2c transfers from atomic. But why only when obex is enabled ? Makes no sense. What do you have on userland ? Is there anything trying to access the obex interface ? Was the USB cable attached at that time ?

Quoted 6 lines

Yes, only when initliaizing obex. Other is ok. Problem is there with Maemo userland and also with clean userland (rescueOS) where is only busybox and some simple init scripts. On Maemo maybe something is trying to access obex, but on rescueOS for sure nothing. Problem happends when cable is attached and also when not = always.

As a debug effort, can you apply hack below and see if it "helps" ?

(quoted diff) +0 -0

b/drivers/usb/gadget/f_obex.c index ad39f1d..4af2f06 100644

drivers/usb/gadget/f_obex.c +4 -1
@@ -267,10 +267,12 @@ static void obex_connect(struct gserial
 *g) if (!obex->can_activate)
 		return;
 
+#if 0
 	status = usb_function_activate(&g->func);
 	if (status)
 		DBG(cdev, "obex ttyGS%d function activate --> %d\n",
 			obex->port_num, status);
+#endif
 }
 
 static void obex_disconnect(struct gserial *g)
@@ -282,10 +284,12 @@ static void obex_disconnect(struct
 gserial *g) if (!obex->can_activate)
 		return;
 
+#if 0
 	status = usb_function_deactivate(&g->func);
 	if (status)
 		DBG(cdev, "obex ttyGS%d function deactivate --> %d\n",
 			obex->port_num, status);
+#endif
 }
 
 /*-----------------------------------------------------------
--------------*/ @@ -372,6 +376,7 @@ static int

obex_bind(struct usb_configuration *c, struct usb_function *f) if (status)

drivers/usb/gadget/f_obex.c +2 -0
 		goto fail;
 
+#if 0
 	/* Avoid letting this gadget enumerate until the userspace
 	 * OBEX server is active.
 	 */
@@ -381,6 +386,7 @@ static int obex_bind(struct
 usb_configuration *c, struct usb_function *f) obex->port_num,
 status);
 	else
 		obex->can_activate = true;
+#endif
 
 
Quoted 3 lines
Quoted 1 line

DBG(cdev, "obex ttyGS%d: %s speed IN/%s OUT/%s\n",

Hi, with above patch g_nokia.ko working and not crashing.

yeah, makes sense. We shouldn't call phy operations in atomic context. I'll see how easy it would be to fix that. Real patch coming soon(-ish).

Signature · 1 line
balbi
#11 lore raw

Hi,

Quoted 47 lines · Felipe Balbi
Quoted 47 lines
Quoted 47 lines
(quoted diff) +0 -0

b/drivers/usb/gadget/f_obex.c index ad39f1d..4af2f06 100644

drivers/usb/gadget/f_obex.c +4 -1
@@ -267,10 +267,12 @@ static void obex_connect(struct gserial
 *g) if (!obex->can_activate)
 		return;
 
+#if 0
 	status = usb_function_activate(&g->func);
 	if (status)
 		DBG(cdev, "obex ttyGS%d function activate --> %d\n",
 			obex->port_num, status);
+#endif
 }
 
 static void obex_disconnect(struct gserial *g)
@@ -282,10 +284,12 @@ static void obex_disconnect(struct
 gserial *g) if (!obex->can_activate)
 		return;
 
+#if 0
 	status = usb_function_deactivate(&g->func);
 	if (status)
 		DBG(cdev, "obex ttyGS%d function deactivate --> %d\n",
 			obex->port_num, status);
+#endif
 }
 
 /*-----------------------------------------------------------
--------------*/ @@ -372,6 +376,7 @@ static int

obex_bind(struct usb_configuration *c, struct usb_function *f) if (status)

drivers/usb/gadget/f_obex.c +2 -0
 		goto fail;
 
+#if 0
 	/* Avoid letting this gadget enumerate until the userspace
 	 * OBEX server is active.
 	 */
@@ -381,6 +386,7 @@ static int obex_bind(struct
 usb_configuration *c, struct usb_function *f) obex->port_num,
 status);
 	else
 		obex->can_activate = true;
+#endif
 
 
Quoted 6 lines
Quoted 3 lines
Quoted 1 line

DBG(cdev, "obex ttyGS%d: %s speed IN/%s OUT/%s\n",

Hi, with above patch g_nokia.ko working and not crashing.

yeah, makes sense. We shouldn't call phy operations in atomic context. I'll see how easy it would be to fix that. Real patch coming soon(-ish).

I think we could send diff below for the -rc cycle and figure out a better to handle this for the merge window. Can you check if it also works with patch below ?

drivers/usb/musb/omap2430.c +0 -2
index 2a408cd..8aa59a2 100644
@@ -659,7 +659,6 @@ static int omap2430_runtime_suspend(struct device *dev)
 				OTG_INTERFSEL);
 
 		omap2430_low_level_exit(musb);
-		phy_power_off(musb->phy);
 	}
 
 	return 0;
@@ -674,7 +673,6 @@ static int omap2430_runtime_resume(struct device *dev)
 		omap2430_low_level_init(musb);
 		musb_writel(musb->mregs, OTG_INTERFSEL,
 				musb->context.otg_interfsel);
-		phy_power_on(musb->phy);
 	}
 
 	return 0;
Signature · 1 line
balbi
#12 lore raw
Quoted 98 lines · On Tuesday 26 November 2013 20:03:11 Felipe Balbi wrote:

Hi,

Quoted 70 lines · Felipe Balbi
Quoted 70 lines
Quoted 70 lines
(quoted diff) +0 -0

b/drivers/usb/gadget/f_obex.c index ad39f1d..4af2f06 100644 --- a/drivers/usb/gadget/f_obex.c
+++ b/drivers/usb/gadget/f_obex.c

(quoted diff) +4 -1
@@ -267,10 +267,12 @@ static void obex_connect(struct
 gserial *g) if (!obex->can_activate)
 
 		return;
 
+#if 0
 
 	status = usb_function_activate(&g->func);
 	if (status)
 
 		DBG(cdev, "obex ttyGS%d function activate --> %d\n",
 
 			obex->port_num, status);
 
+#endif
 
 }
 
 static void obex_disconnect(struct gserial *g)
@@ -282,10 +284,12 @@ static void obex_disconnect(struct
 gserial *g) if (!obex->can_activate)
 
 		return;
 
+#if 0
 
 	status = usb_function_deactivate(&g->func);
 	if (status)
 
 		DBG(cdev, "obex ttyGS%d function deactivate -->
 		%d\n",
 
 			obex->port_num, status);
 
+#endif
 
 }
 
 /*-----------------------------------------------------
 ------
 
--------------*/ @@ -372,6 +376,7 @@ static int

obex_bind(struct usb_configuration *c, struct
usb_function *f) if (status)

(quoted diff) +2 -0
 		goto fail;
 
+#if 0
 
 	/* Avoid letting this gadget enumerate until the
 	userspace
 
 	 * OBEX server is active.
 	 */
@@ -381,6 +386,7 @@ static int obex_bind(struct
 usb_configuration *c, struct usb_function *f)
 obex->port_num, status);
 
 	else
 
 		obex->can_activate = true;
 
+#endif
Quoted 7 lines
Quoted 3 lines
Quoted 1 line

DBG(cdev, "obex ttyGS%d: %s speed IN/%s OUT/%s\n",

Hi, with above patch g_nokia.ko working and not crashing.

yeah, makes sense. We shouldn't call phy operations in atomic context. I'll see how easy it would be to fix that. Real patch coming soon(-ish).

I think we could send diff below for the -rc cycle and figure out a better to handle this for the merge window. Can you check if it also works with patch below ?

(quoted diff) +0 -0

b/drivers/usb/musb/omap2430.c index 2a408cd..8aa59a2 100644

drivers/usb/musb/omap2430.c +0 -1
@@ -659,7 +659,6 @@ static int omap2430_runtime_suspend(struct
 device *dev) OTG_INTERFSEL);
 
 		omap2430_low_level_exit(musb);
-		phy_power_off(musb->phy);
 	}
 
 	return 0;

drivers/usb/musb/omap2430.c static int omap2430_runtime_resume(struct · line 678

Quoted 7 lines
drivers/usb/musb/omap2430.c +0 -1
@@ -674,7 +673,6 @@ static int omap2430_runtime_resume(struct
 device *dev) omap2430_low_level_init(musb);
 		musb_writel(musb->mregs, OTG_INTERFSEL,
 				musb->context.otg_interfsel);
-		phy_power_on(musb->phy);
 	}
 
 	return 0;

Hi, I applied similar patch (commented usb_phy_set_suspend instead phy_power_on/off) on 3.12-rc5 and it working too, no crash. I do not have rebased n900 patches on top of 3.13 tree, so I cannot check it. But I think phy_power_on/off doing same as usb_phy_set_suspend in 3.12.

Signature · 2 lines
Pali Rohár
[email protected]
#13 lore raw

Hi,

Quoted 77 lines · Pali Rohár
Quoted 77 lines
Quoted 46 lines
Quoted 46 lines
Quoted 46 lines
(quoted diff) +2 -1
@@ -282,10 +284,12 @@ static void obex_disconnect(struct
 gserial *g) if (!obex->can_activate)
 
 		return;
 
+#if 0
 
 	status = usb_function_deactivate(&g->func);
 	if (status)
 
 		DBG(cdev, "obex ttyGS%d function deactivate -->
 		%d\n",
 
 			obex->port_num, status);
 
+#endif
 
 }
 
 /*-----------------------------------------------------
 ------
 
--------------*/ @@ -372,6 +376,7 @@ static int

obex_bind(struct usb_configuration *c, struct
usb_function *f) if (status)

(quoted diff) +2 -0
 		goto fail;
 
+#if 0
 
 	/* Avoid letting this gadget enumerate until the
 	userspace
 
 	 * OBEX server is active.
 	 */
@@ -381,6 +386,7 @@ static int obex_bind(struct
 usb_configuration *c, struct usb_function *f)
 obex->port_num, status);
 
 	else
 
 		obex->can_activate = true;
 
+#endif
Quoted 7 lines
Quoted 3 lines
Quoted 1 line

DBG(cdev, "obex ttyGS%d: %s speed IN/%s OUT/%s\n",

Hi, with above patch g_nokia.ko working and not crashing.

yeah, makes sense. We shouldn't call phy operations in atomic context. I'll see how easy it would be to fix that. Real patch coming soon(-ish).

I think we could send diff below for the -rc cycle and figure out a better to handle this for the merge window. Can you check if it also works with patch below ?

(quoted diff) +0 -0

b/drivers/usb/musb/omap2430.c index 2a408cd..8aa59a2 100644

drivers/usb/musb/omap2430.c +0 -2
@@ -659,7 +659,6 @@ static int omap2430_runtime_suspend(struct
 device *dev) OTG_INTERFSEL);
 
 		omap2430_low_level_exit(musb);
-		phy_power_off(musb->phy);
 	}
 
 	return 0;
@@ -674,7 +673,6 @@ static int omap2430_runtime_resume(struct
 device *dev) omap2430_low_level_init(musb);
 		musb_writel(musb->mregs, OTG_INTERFSEL,
 				musb->context.otg_interfsel);
-		phy_power_on(musb->phy);
 	}
 
Quoted 7 lines

drivers/usb/musb/omap2430.c static int omap2430_runtime_resume(struct · line 678

Quoted 1 line
drivers/usb/musb/omap2430.c +0 -0
 	return 0;

Hi, I applied similar patch (commented usb_phy_set_suspend instead phy_power_on/off) on 3.12-rc5 and it working too, no crash. I do not have rebased n900 patches on top of 3.13 tree, so I cannot check it. But I think phy_power_on/off doing same as usb_phy_set_suspend in 3.12.

cool, I'll send this during the -rc and Cc stable, then I'll manually backport it to stable later.

Signature · 1 line
balbi
#14 lore raw
Quoted 99 lines · On Wednesday 27 November 2013 18:39:04 Felipe Balbi wrote:

Hi,

Quoted 88 lines · Pali Rohár
Quoted 88 lines
Quoted 47 lines
Quoted 47 lines
Quoted 47 lines
(quoted diff) +0 -0
@@ -282,10 +284,12 @@ static void

obex_disconnect(struct gserial *g) if
(!obex->can_activate)

(quoted diff) +2 -1
 		return;
 
+#if 0
 
 	status = usb_function_deactivate(&g->func);
 	if (status)
 
 		DBG(cdev, "obex ttyGS%d function deactivate -->
 		%d\n",
 
 			obex->port_num, status);
 
+#endif
 
 }
 
 /*-------------------------------------------------
 ---- ------
 
--------------*/ @@ -372,6 +376,7 @@ static int

obex_bind(struct usb_configuration *c, struct
usb_function *f) if (status)

(quoted diff) +2 -0
 		goto fail;
 
+#if 0
 
 	/* Avoid letting this gadget enumerate until the
 	userspace
 
 	 * OBEX server is active.
 	 */
@@ -381,6 +386,7 @@ static int obex_bind(struct
 usb_configuration *c, struct usb_function *f)
 obex->port_num, status);
 
 	else
 
 		obex->can_activate = true;
 
+#endif
Quoted 8 lines
Quoted 4 lines
Quoted 1 line

DBG(cdev, "obex ttyGS%d: %s speed IN/%s OUT/%s\n",

Hi, with above patch g_nokia.ko working and not
crashing.

yeah, makes sense. We shouldn't call phy operations in atomic context. I'll see how easy it would be to fix that. Real patch coming soon(-ish).

I think we could send diff below for the -rc cycle and figure out a better to handle this for the merge window. Can you check if it also works with patch below ?

(quoted diff) +0 -0

b/drivers/usb/musb/omap2430.c index 2a408cd..8aa59a2 100644 --- a/drivers/usb/musb/omap2430.c
+++ b/drivers/usb/musb/omap2430.c

drivers/usb/musb/omap2430.c +0 -1
@@ -659,7 +659,6 @@ static int
 omap2430_runtime_suspend(struct device *dev)
 OTG_INTERFSEL);
 
 		omap2430_low_level_exit(musb);
 
-		phy_power_off(musb->phy);
 
drivers/usb/musb/omap2430.c +0 -1
 	}
 
 	return 0;
@@ -674,7 +673,6 @@ static int
 omap2430_runtime_resume(struct device *dev)
 omap2430_low_level_init(musb);
 
 		musb_writel(musb->mregs, OTG_INTERFSEL,
 
 				musb->context.otg_interfsel);
 
-		phy_power_on(musb->phy);
 
 	}
Quoted 7 lines
Quoted 1 line

return 0;

Hi, I applied similar patch (commented usb_phy_set_suspend instead phy_power_on/off) on 3.12-rc5 and it working too, no crash. I do not have rebased n900 patches on top of 3.13 tree, so I cannot check it. But I think phy_power_on/off doing same as usb_phy_set_suspend in 3.12.

Quoted 2 lines

cool, I'll send this during the -rc and Cc stable, then I'll manually backport it to stable later.

PING!

I still do not see this patch in linus tree. What happened?

Signature · 2 lines
Pali Rohár
[email protected]
#15 lore raw

2014-01-09 Pali Rohár <[email protected]>:

Quoted 103 lines · On Wednesday 27 November 2013 18:39:04 Felipe Balbi wrote:
Quoted 99 lines

Hi,

Quoted 88 lines · Pali Rohár
Quoted 88 lines
Quoted 47 lines
Quoted 47 lines
Quoted 47 lines
(quoted diff) +0 -0
@@ -282,10 +284,12 @@ static void

obex_disconnect(struct gserial *g) if
(!obex->can_activate)

            return;
(quoted diff) +2 -1
+#if 0
 
    status = usb_function_deactivate(&g->func);
    if (status)
 
            DBG(cdev, "obex ttyGS%d function deactivate -->
            %d\n",
 
                    obex->port_num, status);
 
+#endif
 
 }
 
 /*-------------------------------------------------
 ---- ------
 
--------------*/ @@ -372,6 +376,7 @@ static int

obex_bind(struct usb_configuration *c, struct
usb_function *f) if (status)

            goto fail;
(quoted diff) +2 -0
+#if 0
 
    /* Avoid letting this gadget enumerate until the
    userspace
 
     * OBEX server is active.
     */
@@ -381,6 +386,7 @@ static int obex_bind(struct
 usb_configuration *c, struct usb_function *f)
 obex->port_num, status);
 
    else
 
            obex->can_activate = true;
 
+#endif
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
    DBG(cdev, "obex ttyGS%d: %s speed IN/%s OUT/%s\n",

Hi, with above patch g_nokia.ko working and not
crashing.

yeah, makes sense. We shouldn't call phy operations in atomic context. I'll see how easy it would be to fix that. Real patch coming soon(-ish).

I think we could send diff below for the -rc cycle and figure out a better to handle this for the merge window. Can you check if it also works with patch below ?

(quoted diff) +0 -0

b/drivers/usb/musb/omap2430.c index 2a408cd..8aa59a2 100644 --- a/drivers/usb/musb/omap2430.c
+++ b/drivers/usb/musb/omap2430.c

drivers/usb/musb/omap2430.c +0 -1
@@ -659,7 +659,6 @@ static int
 omap2430_runtime_suspend(struct device *dev)
 OTG_INTERFSEL);
 
          omap2430_low_level_exit(musb);
 
-         phy_power_off(musb->phy);
 
  }

return 0;

drivers/usb/musb/omap2430.c +0 -1
@@ -674,7 +673,6 @@ static int
 omap2430_runtime_resume(struct device *dev)
 omap2430_low_level_init(musb);
 
          musb_writel(musb->mregs, OTG_INTERFSEL,
 
                          musb->context.otg_interfsel);
 
-         phy_power_on(musb->phy);
 
  }
Quoted 7 lines
Quoted 1 line

return 0;

Hi, I applied similar patch (commented usb_phy_set_suspend instead phy_power_on/off) on 3.12-rc5 and it working too, no crash. I do not have rebased n900 patches on top of 3.13 tree, so I cannot check it. But I think phy_power_on/off doing same as usb_phy_set_suspend in 3.12.

Quoted 2 lines

cool, I'll send this during the -rc and Cc stable, then I'll manually backport it to stable later.

Quoted 7 lines

PING!

I still do not see this patch in linus tree. What happened?

--
Pali Rohár
[email protected]

BUMP

Is there any problem with above patch?

Signature · 2 lines
Pali Rohár
[email protected]
#16 lore raw

Hi Felipe,

Quoted 8 lines
Quoted 8 lines
Quoted 3 lines

cool, I'll send this during the -rc and Cc stable, then I'll manually backport it to stable later.

PING!

I still do not see this patch in linus tree. What happened?

Quoted 8 lines
Quoted 3 lines

--
Pali Rohár
[email protected]

BUMP

Is there any problem with above patch?

If you are short on time or have some another reasons preventing you pushing that patch, I can send that patch for you, are you ok with that?

Ivo

#17 lore raw
Quoted 14 lines · Ivaylo Dimitrov

Hi Felipe,

Quoted 12 lines
Quoted 11 lines
Quoted 3 lines

cool, I'll send this during the -rc and Cc stable, then I'll manually backport it to stable later.

PING!

I still do not see this patch in linus tree. What happened?

--
Pali Rohár
[email protected]

Quoted 7 lines
Quoted 4 lines

BUMP

Is there any problem with above patch?

If you are short on time or have some another reasons preventing you pushing that patch, I can send that patch for you, are you ok with that?

Felipe is on vacation, care to resend the patch and cc: me?

thanks,

greg k-h

#18 lore raw

PATCH 1/1 usb: musb: Fix obex in g_nokia.ko causing kernel panic

From: Felipe Balbi <[email protected]>

[   18.606414] [<c037eac0>] (__schedule+0x5c/0x50c) from [<c037d3bc>] (schedule_timeout+0x1f4/0x25c)
[   18.623809] [<c037d3bc>] (schedule_timeout+0x1f4/0x25c) from [<c037f12c>] (wait_for_common+0xc8/0x1ac)
[   18.649291] [<c037f12c>] (wait_for_common+0xc8/0x1ac) from [<c028c1c0>] (omap_i2c_xfer+0x338/0x488)
[   18.674499] [<c028c1c0>] (omap_i2c_xfer+0x338/0x488) from [<c0288144>] (__i2c_transfer+0x40/0x74)
[   18.692047] [<c0288144>] (__i2c_transfer+0x40/0x74) from [<c0288a2c>] (i2c_transfer+0x6c/0x90)
[   18.709320] [<c0288a2c>] (i2c_transfer+0x6c/0x90) from [<c02351c8>] (regmap_i2c_read+0x48/0x68)
[   18.726715] [<c02351c8>] (regmap_i2c_read+0x48/0x68) from [<c023161c>] (_regmap_raw_read+0x128/0x220)
[   18.752685] [<c023161c>] (_regmap_raw_read+0x128/0x220) from [<c02317b4>] (regmap_raw_read+0xa0/0x130)
[   18.779052] [<c02317b4>] (regmap_raw_read+0xa0/0x130) from [<c023193c>] (regmap_bulk_read+0xf8/0x16c)
[   18.805694] [<c023193c>] (regmap_bulk_read+0xf8/0x16c) from [<c0238ea8>] (twl_i2c_read+0xa4/0xe0)
[   18.823730] [<c0238ea8>] (twl_i2c_read+0xa4/0xe0) from [<c0274d34>] (__twl4030_phy_power.isra.12+0x1c/0x58)
[   18.850921] [<c0274d34>] (__twl4030_phy_power.isra.12+0x1c/0x58) from [<c0274df0>]
(twl4030_phy_power.part.14+0x80/0xc8)
[   18.879699] [<c0274df0>] (twl4030_phy_power.part.14+0x80/0xc8) from [<c0274f9c>]
(twl4030_set_suspend+0x54/0x1e8)
[   18.908325] [<c0274f9c>] (twl4030_set_suspend+0x54/0x1e8) from [<c027c8c4>]
(omap2430_runtime_resume+0x5c/0x64)
[   18.937042] [<c027c8c4>] (omap2430_runtime_resume+0x5c/0x64) from [<c0225dd0>]
(pm_generic_runtime_resume+0x2c/0x38)
[   18.966461] [<c0225dd0>] (pm_generic_runtime_resume+0x2c/0x38) from [<c0229fe0>] (__rpm_callback+0x54/0x80)
[   18.995117] [<c0229fe0>] (__rpm_callback+0x54/0x80) from [<c022a04c>] (rpm_callback+0x40/0x74)
[   19.013610] [<c022a04c>] (rpm_callback+0x40/0x74) from [<c022b3c8>] (rpm_resume+0x448/0x63c)
[   19.031921] [<c022b3c8>] (rpm_resume+0x448/0x63c) from [<c022b2e4>] (rpm_resume+0x364/0x63c)
[   19.050140] [<c022b2e4>] (rpm_resume+0x364/0x63c) from [<c022b874>] (__pm_runtime_resume+0x48/0x74)
[   19.077728] [<c022b874>] (__pm_runtime_resume+0x48/0x74) from [<c027b4fc>] (musb_gadget_pullup+0x1c/0xb4)
[   19.105895] [<c027b4fc>] (musb_gadget_pullup+0x1c/0xb4) from [<bf025c14>] (usb_function_deactivate+0x54/0xa4
[libcomposite])
[   19.135955] [<bf025c14>] (usb_function_deactivate+0x54/0xa4 [libcomposite]) from [<bf05b3b8>]
(obex_bind+0x124/0x1d8 [usb_f_obex])
[   19.166870] [<bf05b3b8>] (obex_bind+0x124/0x1d8 [usb_f_obex]) from [<bf025794>] (usb_add_function+0x58/0xf4
[libcomposite])
[   19.197143] [<bf025794>] (usb_add_function+0x58/0xf4 [libcomposite]) from [<bf037420>]
(nokia_bind_config+0x204/0x250 [g_nokia])
[   19.227905] [<bf037420>] (nokia_bind_config+0x204/0x250 [g_nokia]) from [<bf0263fc>] (usb_add_config+0x28/0xc0
[libcomposite])
[   19.258483] [<bf0263fc>] (usb_add_config+0x28/0xc0 [libcomposite]) from [<bf03709c>] (nokia_bind+0x9c/0x21c
[g_nokia])
[   19.288421] [<bf03709c>] (nokia_bind+0x9c/0x21c [g_nokia]) from [<bf0275bc>] (composite_bind+0x74/0x180
[libcomposite])
[   19.318420] [<bf0275bc>] (composite_bind+0x74/0x180 [libcomposite]) from [<c027d658>]
(udc_bind_to_driver+0x2c/0xc4)
[   19.348114] [<c027d658>] (udc_bind_to_driver+0x2c/0xc4) from [<c027d764>] (usb_gadget_probe_driver+0x74/0x94)
[   19.377166] [<c027d764>] (usb_gadget_probe_driver+0x74/0x94) from [<c00086f8>] (do_one_initcall+0x94/0x138)
[   19.406005] [<c00086f8>] (do_one_initcall+0x94/0x138) from [<c007a460>] (load_module+0x113c/0x13c4)
[   19.434051] [<c007a460>] (load_module+0x113c/0x13c4) from [<c007a7b4>] (SyS_init_module+0xcc/0xec)
[   19.462127] [<c007a7b4>] (SyS_init_module+0xcc/0xec) from [<c000dd40>] (ret_fast_syscall+0x0/0x30)
[   19.490753] Code: 0a00002e e1a00004 eb001438 e598300c (e5d3202c)
[   19.506805] ---[ end trace 060b62ec0d68a78b ]---
[   19.523132] Kernel panic - not syncing: Fatal exception in interrupt

dump is from 3.12-rc5 kernel

---
 drivers/usb/musb/omap2430.c |    2 --
 1 file changed, 2 deletions(-)
drivers/usb/musb/omap2430.c +0 -2
index 2a408cd..8aa59a2 100644
@@ -659,7 +659,6 @@ static int omap2430_runtime_suspend(struct device *dev)
 				OTG_INTERFSEL);
 
 		omap2430_low_level_exit(musb);
-		phy_power_off(musb->phy);
 	}
 
 	return 0;
@@ -674,7 +673,6 @@ static int omap2430_runtime_resume(struct device *dev)
 		omap2430_low_level_init(musb);
 		musb_writel(musb->mregs, OTG_INTERFSEL,
 				musb->context.otg_interfsel);
-		phy_power_on(musb->phy);
 	}
 
 	return 0;
Signature · 1 line
1.7.9.5
maintainer
#19 lore raw

Re: [PATCH] usb: musb: Fix obex in g_nokia.ko causing kernel panic

Quoted 1 line · Ivaylo Dimitrov

From: Felipe Balbi <[email protected]>

I can't take a patch that the author doesn't sign off on, sorry.

Please wait a week or so so that Felipe can return from vacation.

thanks,

greg k-h

#20 lore raw

Re: [PATCH] usb: musb: Fix obex in g_nokia.ko causing kernel panic

In reply to Ivaylo Dimitrov

2014-02-06 20:25 GMT+01:00 Ivaylo Dimitrov <[email protected]>:

Quoted 1 line

From: Felipe Balbi <[email protected]>

This patch, which is present in 3.14-rc4 as 30a70b026 ("usb: musb: fix obex in g_nokia.ko causing kernel panic"), breaks USB gadget support on my Pandaboard. Bisecting points to this commit, reverting it makes USB gadget support work again. The problem is that this patch deletes the call which turns on the PHY.

Config is attached.

Quoted 20 lines
drivers/usb/musb/omap2430.c +0 -2
index 2a408cd..8aa59a2 100644
@@ -659,7 +659,6 @@ static int omap2430_runtime_suspend(struct device *dev)
                                OTG_INTERFSEL);
 
                omap2430_low_level_exit(musb);
-               phy_power_off(musb->phy);
        }
 
        return 0;
@@ -674,7 +673,6 @@ static int omap2430_runtime_resume(struct device *dev)
                omap2430_low_level_init(musb);
                musb_writel(musb->mregs, OTG_INTERFSEL,
                                musb->context.otg_interfsel);
-               phy_power_on(musb->phy);
        }
 
        return 0;
#21 lore raw

Re: [PATCH] usb: musb: Fix obex in g_nokia.ko causing kernel panic

Hi!

Quoted 9 lines
Quoted 1 line

From: Felipe Balbi <[email protected]>

This patch, which is present in 3.14-rc4 as 30a70b026 ("usb: musb: fix obex in g_nokia.ko causing kernel panic"), breaks USB gadget support on my Pandaboard. Bisecting points to this commit, reverting it makes USB gadget support work again. The problem is that this patch deletes the call which turns on the PHY.

Config is attached.

Can you try adding

static int omap2430_musb_init(struct musb *musb)
{
...

+	phy_power_on(musb->phy);
	return 0;

...
}

?
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html