All of lore.kernel.org
 help / color / mirror / Atom feed
* BUG: usb: obex in g_nokia.ko causing kernel panic
@ 2013-11-19 10:51 Pali Rohár
  2013-11-26 17:10 ` Pali Rohár
  2013-11-26 17:16 ` Felipe Balbi
  0 siblings, 2 replies; 22+ messages in thread
From: Pali Rohár @ 2013-11-19 10:51 UTC (permalink / raw)
  To: Felipe Balbi, Greg Kroah-Hartman
  Cc: linux-usb, linux-kernel, Pavel Machek, Aaro Koskinen,
	freemangordon, Sebastian Reichel

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):

diff --git a/drivers/usb/gadget/nokia.c b/drivers/usb/gadget/nokia.c
index ba47977..869cbfa 100644
--- a/drivers/usb/gadget/nokia.c
+++ b/drivers/usb/gadget/nokia.c
@@ -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...

-- 
Pali Rohár
pali.rohar@gmail.com

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

* Re: BUG: usb: obex in g_nokia.ko causing kernel panic
  2013-11-19 10:51 BUG: usb: obex in g_nokia.ko causing kernel panic Pali Rohár
@ 2013-11-26 17:10 ` Pali Rohár
  2013-11-26 17:17   ` Sebastian Reichel
  2013-11-26 17:16 ` Felipe Balbi
  1 sibling, 1 reply; 22+ messages in thread
From: Pali Rohár @ 2013-11-26 17:10 UTC (permalink / raw)
  To: Felipe Balbi, Greg Kroah-Hartman
  Cc: linux-usb, linux-kernel, Pavel Machek, Aaro Koskinen,
	freemangordon, Sebastian Reichel

[-- Attachment #1: Type: Text/Plain, Size: 12526 bytes --]

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):
> 
> diff --git a/drivers/usb/gadget/nokia.c
> b/drivers/usb/gadget/nokia.c index ba47977..869cbfa 100644
> --- a/drivers/usb/gadget/nokia.c
> +++ b/drivers/usb/gadget/nokia.c
> @@ -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...

Hi! can you look at this problem?

-- 
Pali Rohár
pali.rohar@gmail.com

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

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

* Re: BUG: usb: obex in g_nokia.ko causing kernel panic
  2013-11-19 10:51 BUG: usb: obex in g_nokia.ko causing kernel panic Pali Rohár
  2013-11-26 17:10 ` Pali Rohár
@ 2013-11-26 17:16 ` Felipe Balbi
  2013-11-26 17:28   ` Pali Rohár
  1 sibling, 1 reply; 22+ messages in thread
From: Felipe Balbi @ 2013-11-26 17:16 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Felipe Balbi, Greg Kroah-Hartman, linux-usb, linux-kernel,
	Pavel Machek, Aaro Koskinen, freemangordon, Sebastian Reichel

[-- Attachment #1: Type: text/plain, Size: 5034 bytes --]

Hi,

On Tue, Nov 19, 2013 at 11:51:12AM +0100, 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)

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 ?

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: BUG: usb: obex in g_nokia.ko causing kernel panic
  2013-11-26 17:10 ` Pali Rohár
@ 2013-11-26 17:17   ` Sebastian Reichel
  2013-11-26 17:30     ` Pali Rohár
  2013-11-26 18:06     ` Pavel Machek
  0 siblings, 2 replies; 22+ messages in thread
From: Sebastian Reichel @ 2013-11-26 17:17 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Felipe Balbi, Greg Kroah-Hartman, linux-usb, linux-kernel,
	Pavel Machek, Aaro Koskinen, freemangordon

[-- Attachment #1: Type: text/plain, Size: 653 bytes --]

On Tue, Nov 26, 2013 at 06:10:22PM +0100, Pali Rohár wrote:
> 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

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: BUG: usb: obex in g_nokia.ko causing kernel panic
  2013-11-26 17:16 ` Felipe Balbi
@ 2013-11-26 17:28   ` Pali Rohár
  2013-11-26 17:39     ` Felipe Balbi
  0 siblings, 1 reply; 22+ messages in thread
From: Pali Rohár @ 2013-11-26 17:28 UTC (permalink / raw)
  To: balbi
  Cc: Greg Kroah-Hartman, linux-usb, linux-kernel, Pavel Machek,
	Aaro Koskinen, freemangordon, Sebastian Reichel

[-- Attachment #1: Type: Text/Plain, Size: 5773 bytes --]

On Tuesday 26 November 2013 18:16:06 Felipe Balbi wrote:
> Hi,
> 
> On Tue, Nov 19, 2013 at 11:51:12AM +0100, 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)
> 
> 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.

-- 
Pali Rohár
pali.rohar@gmail.com

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

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

* Re: BUG: usb: obex in g_nokia.ko causing kernel panic
  2013-11-26 17:17   ` Sebastian Reichel
@ 2013-11-26 17:30     ` Pali Rohár
  2013-11-26 18:06     ` Pavel Machek
  1 sibling, 0 replies; 22+ messages in thread
From: Pali Rohár @ 2013-11-26 17:30 UTC (permalink / raw)
  To: Sebastian Reichel
  Cc: Felipe Balbi, Greg Kroah-Hartman, linux-usb, linux-kernel,
	Pavel Machek, Aaro Koskinen, freemangordon

[-- Attachment #1: Type: Text/Plain, Size: 1033 bytes --]

On Tuesday 26 November 2013 18:17:49 Sebastian Reichel wrote:
> On Tue, Nov 26, 2013 at 06:10:22PM +0100, Pali Rohár wrote:
> > 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

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.

-- 
Pali Rohár
pali.rohar@gmail.com

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

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

* Re: BUG: usb: obex in g_nokia.ko causing kernel panic
  2013-11-26 17:28   ` Pali Rohár
@ 2013-11-26 17:39     ` Felipe Balbi
  2013-11-26 18:10       ` Pali Rohár
  0 siblings, 1 reply; 22+ messages in thread
From: Felipe Balbi @ 2013-11-26 17:39 UTC (permalink / raw)
  To: Pali Rohár
  Cc: balbi, Greg Kroah-Hartman, linux-usb, linux-kernel, Pavel Machek,
	Aaro Koskinen, freemangordon, Sebastian Reichel

[-- Attachment #1: Type: text/plain, Size: 2170 bytes --]

Hi,

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

[ snip ]

> > > (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.

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

diff --git a/drivers/usb/gadget/f_obex.c 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
@@ -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",

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: BUG: usb: obex in g_nokia.ko causing kernel panic
  2013-11-26 17:17   ` Sebastian Reichel
  2013-11-26 17:30     ` Pali Rohár
@ 2013-11-26 18:06     ` Pavel Machek
  2013-11-26 18:10       ` Felipe Balbi
  1 sibling, 1 reply; 22+ messages in thread
From: Pavel Machek @ 2013-11-26 18:06 UTC (permalink / raw)
  To: Pali Rohár, Felipe Balbi, Greg Kroah-Hartman, linux-usb,
	linux-kernel, Aaro Koskinen, freemangordon

On Tue 2013-11-26 18:17:49, Sebastian Reichel wrote:
> On Tue, Nov 26, 2013 at 06:10:22PM +0100, Pali Rohár wrote:
> > 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?

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
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

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

* Re: BUG: usb: obex in g_nokia.ko causing kernel panic
  2013-11-26 17:39     ` Felipe Balbi
@ 2013-11-26 18:10       ` Pali Rohár
  2013-11-26 18:59         ` Felipe Balbi
  0 siblings, 1 reply; 22+ messages in thread
From: Pali Rohár @ 2013-11-26 18:10 UTC (permalink / raw)
  To: balbi
  Cc: Greg Kroah-Hartman, linux-usb, linux-kernel, Pavel Machek,
	Aaro Koskinen, freemangordon, Sebastian Reichel

[-- Attachment #1: Type: Text/Plain, Size: 2449 bytes --]

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 ]
> 
> > > > (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.
> 
> As a debug effort, can you apply hack below and see if it
> "helps" ?
> 
> diff --git a/drivers/usb/gadget/f_obex.c
> 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
> @@ -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",

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

-- 
Pali Rohár
pali.rohar@gmail.com

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

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

* Re: BUG: usb: obex in g_nokia.ko causing kernel panic
  2013-11-26 18:06     ` Pavel Machek
@ 2013-11-26 18:10       ` Felipe Balbi
  0 siblings, 0 replies; 22+ messages in thread
From: Felipe Balbi @ 2013-11-26 18:10 UTC (permalink / raw)
  To: Pavel Machek
  Cc: Pali Rohár, Felipe Balbi, Greg Kroah-Hartman, linux-usb,
	linux-kernel, Aaro Koskinen, freemangordon

[-- Attachment #1: Type: text/plain, Size: 859 bytes --]

Hi,

On Tue, Nov 26, 2013 at 07:06:43PM +0100, Pavel Machek 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?
> 
> 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 :-)

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: BUG: usb: obex in g_nokia.ko causing kernel panic
  2013-11-26 18:10       ` Pali Rohár
@ 2013-11-26 18:59         ` Felipe Balbi
  2013-11-26 19:03           ` Felipe Balbi
  0 siblings, 1 reply; 22+ messages in thread
From: Felipe Balbi @ 2013-11-26 18:59 UTC (permalink / raw)
  To: Pali Rohár
  Cc: balbi, Greg Kroah-Hartman, linux-usb, linux-kernel, Pavel Machek,
	Aaro Koskinen, freemangordon, Sebastian Reichel

[-- Attachment #1: Type: text/plain, Size: 2620 bytes --]

Hi,

On Tue, Nov 26, 2013 at 07:10:08PM +0100, Pali Rohár wrote:
> > > > > (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.
> > 
> > As a debug effort, can you apply hack below and see if it
> > "helps" ?
> > 
> > diff --git a/drivers/usb/gadget/f_obex.c
> > 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
> > @@ -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",
> 
> 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).

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: BUG: usb: obex in g_nokia.ko causing kernel panic
  2013-11-26 18:59         ` Felipe Balbi
@ 2013-11-26 19:03           ` Felipe Balbi
  2013-11-27 16:40             ` Pali Rohár
  0 siblings, 1 reply; 22+ messages in thread
From: Felipe Balbi @ 2013-11-26 19:03 UTC (permalink / raw)
  To: Felipe Balbi
  Cc: Pali Rohár, Greg Kroah-Hartman, linux-usb, linux-kernel,
	Pavel Machek, Aaro Koskinen, freemangordon, Sebastian Reichel

[-- Attachment #1: Type: text/plain, Size: 2690 bytes --]

Hi,

On Tue, Nov 26, 2013 at 12:59:13PM -0600, Felipe Balbi wrote:
> > > diff --git a/drivers/usb/gadget/f_obex.c
> > > 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
> > > @@ -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",
> > 
> > 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 ?

diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
index 2a408cd..8aa59a2 100644
--- a/drivers/usb/musb/omap2430.c
+++ b/drivers/usb/musb/omap2430.c
@@ -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;

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: BUG: usb: obex in g_nokia.ko causing kernel panic
  2013-11-26 19:03           ` Felipe Balbi
@ 2013-11-27 16:40             ` Pali Rohár
  2013-11-27 17:39               ` Felipe Balbi
  0 siblings, 1 reply; 22+ messages in thread
From: Pali Rohár @ 2013-11-27 16:40 UTC (permalink / raw)
  To: balbi
  Cc: Greg Kroah-Hartman, linux-usb, linux-kernel, Pavel Machek,
	Aaro Koskinen, freemangordon, Sebastian Reichel

[-- Attachment #1: Type: Text/Plain, Size: 3470 bytes --]

On Tuesday 26 November 2013 20:03:11 Felipe Balbi wrote:
> Hi,
> 
> On Tue, Nov 26, 2013 at 12:59:13PM -0600, Felipe Balbi wrote:
> > > > diff --git a/drivers/usb/gadget/f_obex.c
> > > > 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
> > > > @@ -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",
> > > 
> > > 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 ?
> 
> diff --git a/drivers/usb/musb/omap2430.c
> b/drivers/usb/musb/omap2430.c index 2a408cd..8aa59a2 100644
> --- a/drivers/usb/musb/omap2430.c
> +++ b/drivers/usb/musb/omap2430.c
> @@ -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;

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.

-- 
Pali Rohár
pali.rohar@gmail.com

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

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

* Re: BUG: usb: obex in g_nokia.ko causing kernel panic
  2013-11-27 16:40             ` Pali Rohár
@ 2013-11-27 17:39               ` Felipe Balbi
  2014-01-09 14:17                 ` Pali Rohár
  0 siblings, 1 reply; 22+ messages in thread
From: Felipe Balbi @ 2013-11-27 17:39 UTC (permalink / raw)
  To: Pali Rohár
  Cc: balbi, Greg Kroah-Hartman, linux-usb, linux-kernel, Pavel Machek,
	Aaro Koskinen, freemangordon, Sebastian Reichel

[-- Attachment #1: Type: text/plain, Size: 2936 bytes --]

Hi,

On Wed, Nov 27, 2013 at 05:40:42PM +0100, Pali Rohár wrote:
> > > > > @@ -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",
> > > > 
> > > > 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 ?
> > 
> > diff --git a/drivers/usb/musb/omap2430.c
> > b/drivers/usb/musb/omap2430.c index 2a408cd..8aa59a2 100644
> > --- a/drivers/usb/musb/omap2430.c
> > +++ b/drivers/usb/musb/omap2430.c
> > @@ -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;
> 
> 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.

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: BUG: usb: obex in g_nokia.ko causing kernel panic
  2013-11-27 17:39               ` Felipe Balbi
@ 2014-01-09 14:17                 ` Pali Rohár
  2014-01-26 22:06                   ` Pali Rohár
  0 siblings, 1 reply; 22+ messages in thread
From: Pali Rohár @ 2014-01-09 14:17 UTC (permalink / raw)
  To: balbi
  Cc: Greg Kroah-Hartman, linux-usb, linux-kernel, Pavel Machek,
	Aaro Koskinen, freemangordon, Sebastian Reichel

[-- Attachment #1: Type: Text/Plain, Size: 3375 bytes --]

On Wednesday 27 November 2013 18:39:04 Felipe Balbi wrote:
> Hi,
> 
> On Wed, Nov 27, 2013 at 05:40:42PM +0100, Pali Rohár wrote:
> > > > > > @@ -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",
> > > > > 
> > > > > 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 ?
> > > 
> > > diff --git a/drivers/usb/musb/omap2430.c
> > > b/drivers/usb/musb/omap2430.c index 2a408cd..8aa59a2
> > > 100644 --- a/drivers/usb/musb/omap2430.c
> > > +++ b/drivers/usb/musb/omap2430.c
> > > @@ -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;
> > 
> > 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.

PING!

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

-- 
Pali Rohár
pali.rohar@gmail.com

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

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

* Re: BUG: usb: obex in g_nokia.ko causing kernel panic
  2014-01-09 14:17                 ` Pali Rohár
@ 2014-01-26 22:06                   ` Pali Rohár
  2014-02-05 22:25                     ` Ivaylo Dimitrov
  0 siblings, 1 reply; 22+ messages in thread
From: Pali Rohár @ 2014-01-26 22:06 UTC (permalink / raw)
  To: Felipe Balbi, Pavel Machek, Sebastian Reichel
  Cc: Greg Kroah-Hartman, USB list, LKML, Aaro Koskinen,
	freemangordon @ maemo. org - Talk

2014-01-09 Pali Rohár <pali.rohar@gmail.com>:
> On Wednesday 27 November 2013 18:39:04 Felipe Balbi wrote:
>> Hi,
>>
>> On Wed, Nov 27, 2013 at 05:40:42PM +0100, Pali Rohár wrote:
>> > > > > > @@ -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",
>> > > > >
>> > > > > 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 ?
>> > >
>> > > diff --git a/drivers/usb/musb/omap2430.c
>> > > b/drivers/usb/musb/omap2430.c index 2a408cd..8aa59a2
>> > > 100644 --- a/drivers/usb/musb/omap2430.c
>> > > +++ b/drivers/usb/musb/omap2430.c
>> > > @@ -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;
>> >
>> > 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.
>
> PING!
>
> I still do not see this patch in linus tree. What happened?
>
> --
> Pali Rohár
> pali.rohar@gmail.com

BUMP

Is there any problem with above patch?

-- 
Pali Rohár
pali.rohar@gmail.com

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

* Re: BUG: usb: obex in g_nokia.ko causing kernel panic
  2014-01-26 22:06                   ` Pali Rohár
@ 2014-02-05 22:25                     ` Ivaylo Dimitrov
  2014-02-05 23:06                       ` Greg Kroah-Hartman
  0 siblings, 1 reply; 22+ messages in thread
From: Ivaylo Dimitrov @ 2014-02-05 22:25 UTC (permalink / raw)
  To: Felipe Balbi
  Cc: Pali Rohár, Pavel Machek, Sebastian Reichel,
	Greg Kroah-Hartman, USB list, LKML, Aaro Koskinen

Hi Felipe,

>>>
>>> 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
>> pali.rohar@gmail.com
>
> 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

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

* Re: BUG: usb: obex in g_nokia.ko causing kernel panic
  2014-02-05 22:25                     ` Ivaylo Dimitrov
@ 2014-02-05 23:06                       ` Greg Kroah-Hartman
  2014-02-06 19:25                         ` [PATCH] usb: musb: Fix " Ivaylo Dimitrov
  0 siblings, 1 reply; 22+ messages in thread
From: Greg Kroah-Hartman @ 2014-02-05 23:06 UTC (permalink / raw)
  To: Ivaylo Dimitrov
  Cc: Felipe Balbi, Pali Rohár, Pavel Machek, Sebastian Reichel,
	USB list, LKML, Aaro Koskinen

On Thu, Feb 06, 2014 at 12:25:21AM +0200, Ivaylo Dimitrov wrote:
> Hi Felipe,
> 
> >>>
> >>>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
> >>pali.rohar@gmail.com
> >
> >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

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

* [PATCH] usb: musb: Fix obex in g_nokia.ko causing kernel panic
  2014-02-05 23:06                       ` Greg Kroah-Hartman
@ 2014-02-06 19:25                         ` Ivaylo Dimitrov
  2014-02-06 19:33                           ` Greg KH
  2014-03-22  0:45                           ` Rabin Vincent
  0 siblings, 2 replies; 22+ messages in thread
From: Ivaylo Dimitrov @ 2014-02-06 19:25 UTC (permalink / raw)
  To: balbi; +Cc: gregkh, pali.rohar, pavel, linux-usb, linux-kernel, Ivaylo Dimitrov

From: Felipe Balbi <balbi@ti.com>

[   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

Reported-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
---
 drivers/usb/musb/omap2430.c |    2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
index 2a408cd..8aa59a2 100644
--- a/drivers/usb/musb/omap2430.c
+++ b/drivers/usb/musb/omap2430.c
@@ -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;
-- 
1.7.9.5


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

* Re: [PATCH] usb: musb: Fix obex in g_nokia.ko causing kernel panic
  2014-02-06 19:25                         ` [PATCH] usb: musb: Fix " Ivaylo Dimitrov
@ 2014-02-06 19:33                           ` Greg KH
  2014-03-22  0:45                           ` Rabin Vincent
  1 sibling, 0 replies; 22+ messages in thread
From: Greg KH @ 2014-02-06 19:33 UTC (permalink / raw)
  To: Ivaylo Dimitrov; +Cc: balbi, pali.rohar, pavel, linux-usb, linux-kernel

On Thu, Feb 06, 2014 at 09:25:37PM +0200, Ivaylo Dimitrov wrote:
> From: Felipe Balbi <balbi@ti.com>

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

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

* Re: [PATCH] usb: musb: Fix obex in g_nokia.ko causing kernel panic
  2014-02-06 19:25                         ` [PATCH] usb: musb: Fix " Ivaylo Dimitrov
  2014-02-06 19:33                           ` Greg KH
@ 2014-03-22  0:45                           ` Rabin Vincent
  2014-04-15 21:37                             ` Pavel Machek
  1 sibling, 1 reply; 22+ messages in thread
From: Rabin Vincent @ 2014-03-22  0:45 UTC (permalink / raw)
  To: balbi, Ivaylo Dimitrov
  Cc: Greg Kroah-Hartman, pali.rohar, pavel, linux-usb, LKML

[-- Attachment #1: Type: text/plain, Size: 1207 bytes --]

2014-02-06 20:25 GMT+01:00 Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>:
> From: Felipe Balbi <balbi@ti.com>

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.

> diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
> index 2a408cd..8aa59a2 100644
> --- a/drivers/usb/musb/omap2430.c
> +++ b/drivers/usb/musb/omap2430.c
> @@ -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;

[-- Attachment #2: panda-usb-config.gz --]
[-- Type: application/x-gzip, Size: 1982 bytes --]

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

* Re: [PATCH] usb: musb: Fix obex in g_nokia.ko causing kernel panic
  2014-03-22  0:45                           ` Rabin Vincent
@ 2014-04-15 21:37                             ` Pavel Machek
  0 siblings, 0 replies; 22+ messages in thread
From: Pavel Machek @ 2014-04-15 21:37 UTC (permalink / raw)
  To: Rabin Vincent
  Cc: balbi, Ivaylo Dimitrov, Greg Kroah-Hartman, pali.rohar, linux-usb, LKML

Hi!

> > From: Felipe Balbi <balbi@ti.com>
> 
> 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
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

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

end of thread, other threads:[~2014-04-15 21:37 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-19 10:51 BUG: usb: obex in g_nokia.ko causing kernel panic Pali Rohár
2013-11-26 17:10 ` Pali Rohár
2013-11-26 17:17   ` Sebastian Reichel
2013-11-26 17:30     ` Pali Rohár
2013-11-26 18:06     ` Pavel Machek
2013-11-26 18:10       ` Felipe Balbi
2013-11-26 17:16 ` Felipe Balbi
2013-11-26 17:28   ` Pali Rohár
2013-11-26 17:39     ` Felipe Balbi
2013-11-26 18:10       ` Pali Rohár
2013-11-26 18:59         ` Felipe Balbi
2013-11-26 19:03           ` Felipe Balbi
2013-11-27 16:40             ` Pali Rohár
2013-11-27 17:39               ` Felipe Balbi
2014-01-09 14:17                 ` Pali Rohár
2014-01-26 22:06                   ` Pali Rohár
2014-02-05 22:25                     ` Ivaylo Dimitrov
2014-02-05 23:06                       ` Greg Kroah-Hartman
2014-02-06 19:25                         ` [PATCH] usb: musb: Fix " Ivaylo Dimitrov
2014-02-06 19:33                           ` Greg KH
2014-03-22  0:45                           ` Rabin Vincent
2014-04-15 21:37                             ` Pavel Machek

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