All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/7] s3c-hsudc: regulator handling and a lot of fixes
@ 2011-12-17 19:23 ` Heiko Stübner
  0 siblings, 0 replies; 48+ messages in thread
From: Heiko Stübner @ 2011-12-17 19:23 UTC (permalink / raw)
  To: Felipe Balbi, Kukjin Kim
  Cc: linux-usb, linux-samsung-soc, linux-arm-kernel, Thomas Abraham,
	Heiko Stübner

In his response to the first submission Felipe Balbi asked to also move
the driver to the new udc_start and udc_stop functions and to make an
effort to reduce dependencies on archictecture code.

The first patch reduces the number of arch dependencies by one by moving
the platform data struct to a header unter include/linux/usb.

The third patch adds a remove function, that was missing until now.

The fifth and sixt patches implement the move to udc_start / udc_stop

And the last patch finally allows the s3c-hsudc driver to control its
supplying regulators as intended in the first place.

The regulator calls can use the regulators unconditionally and let
necessary "stubbing and mapping" happen through the regulator framework,
according to for example
http://marc.info/?l=linux-netdev&m=131914562120725&w=2
meaning there is no need to gracefully fail if a regulator is not present.


Each patch was compile-tested individually, the series applies cleanly
against linux-next from 2011-12-16.

Real-life testing happened on S3C2416 hardware including adding and
removing of gadgets and unloading and later on reloading the s3c_hsudc
module.

Heiko Stuebner (7):
  s3c-hsudc: move platform_data struct to global header
  s3c-hsudc: add __devinit to probe function
  s3c-hsudc: add a remove function
  s3c-hsudc: add missing otg_put_transceiver in probe
  s3c-hsudc: move device registration to probe and remove
  s3c-hsudc: use udc_start and udc_stop functions
  s3c-hsudc: Add regulator handling

 arch/arm/mach-s3c2416/mach-smdk2416.c    |    1 +
 arch/arm/plat-samsung/devs.c             |    1 +
 arch/arm/plat-samsung/include/plat/udc.h |   15 +---
 drivers/usb/gadget/s3c-hsudc.c           |  142 +++++++++++++++++++++---------
 include/linux/usb/s3c-hsudc.h            |   34 +++++++
 5 files changed, 136 insertions(+), 57 deletions(-)
 create mode 100644 include/linux/usb/s3c-hsudc.h

-- 
1.7.2.3

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

* [PATCH v2 0/7] s3c-hsudc: regulator handling and a lot of fixes
@ 2011-12-17 19:23 ` Heiko Stübner
  0 siblings, 0 replies; 48+ messages in thread
From: Heiko Stübner @ 2011-12-17 19:23 UTC (permalink / raw)
  To: linux-arm-kernel

In his response to the first submission Felipe Balbi asked to also move
the driver to the new udc_start and udc_stop functions and to make an
effort to reduce dependencies on archictecture code.

The first patch reduces the number of arch dependencies by one by moving
the platform data struct to a header unter include/linux/usb.

The third patch adds a remove function, that was missing until now.

The fifth and sixt patches implement the move to udc_start / udc_stop

And the last patch finally allows the s3c-hsudc driver to control its
supplying regulators as intended in the first place.

The regulator calls can use the regulators unconditionally and let
necessary "stubbing and mapping" happen through the regulator framework,
according to for example
http://marc.info/?l=linux-netdev&m=131914562120725&w=2
meaning there is no need to gracefully fail if a regulator is not present.


Each patch was compile-tested individually, the series applies cleanly
against linux-next from 2011-12-16.

Real-life testing happened on S3C2416 hardware including adding and
removing of gadgets and unloading and later on reloading the s3c_hsudc
module.

Heiko Stuebner (7):
  s3c-hsudc: move platform_data struct to global header
  s3c-hsudc: add __devinit to probe function
  s3c-hsudc: add a remove function
  s3c-hsudc: add missing otg_put_transceiver in probe
  s3c-hsudc: move device registration to probe and remove
  s3c-hsudc: use udc_start and udc_stop functions
  s3c-hsudc: Add regulator handling

 arch/arm/mach-s3c2416/mach-smdk2416.c    |    1 +
 arch/arm/plat-samsung/devs.c             |    1 +
 arch/arm/plat-samsung/include/plat/udc.h |   15 +---
 drivers/usb/gadget/s3c-hsudc.c           |  142 +++++++++++++++++++++---------
 include/linux/usb/s3c-hsudc.h            |   34 +++++++
 5 files changed, 136 insertions(+), 57 deletions(-)
 create mode 100644 include/linux/usb/s3c-hsudc.h

-- 
1.7.2.3

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

* [PATCH 1/7] s3c-hsudc: move platform_data struct to global header
  2011-12-17 19:23 ` Heiko Stübner
@ 2011-12-17 19:24   ` Heiko Stübner
  -1 siblings, 0 replies; 48+ messages in thread
From: Heiko Stübner @ 2011-12-17 19:24 UTC (permalink / raw)
  To: Felipe Balbi, Kukjin Kim
  Cc: linux-usb, linux-samsung-soc, linux-arm-kernel, Thomas Abraham

Gadget drivers should be compilable on all architectures.
This patch removes one dependency on architecture-specific code.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
 arch/arm/mach-s3c2416/mach-smdk2416.c    |    1 +
 arch/arm/plat-samsung/devs.c             |    1 +
 arch/arm/plat-samsung/include/plat/udc.h |   15 +------------
 drivers/usb/gadget/s3c-hsudc.c           |    2 +-
 include/linux/usb/s3c-hsudc.h            |   34 ++++++++++++++++++++++++++++++
 5 files changed, 38 insertions(+), 15 deletions(-)
 create mode 100644 include/linux/usb/s3c-hsudc.h

diff --git a/arch/arm/mach-s3c2416/mach-smdk2416.c b/arch/arm/mach-s3c2416/mach-smdk2416.c
index a9eee53..018338a 100644
--- a/arch/arm/mach-s3c2416/mach-smdk2416.c
+++ b/arch/arm/mach-s3c2416/mach-smdk2416.c
@@ -50,6 +50,7 @@
 #include <plat/nand.h>
 #include <plat/sdhci.h>
 #include <plat/udc.h>
+#include <linux/usb/s3c-hsudc.h>
 
 #include <plat/regs-fb-v4.h>
 #include <plat/fb.h>
diff --git a/arch/arm/plat-samsung/devs.c b/arch/arm/plat-samsung/devs.c
index 4ca8b57..5468723 100644
--- a/arch/arm/plat-samsung/devs.c
+++ b/arch/arm/plat-samsung/devs.c
@@ -29,6 +29,7 @@
 #include <linux/mtd/partitions.h>
 #include <linux/mmc/host.h>
 #include <linux/ioport.h>
+#include <linux/usb/s3c-hsudc.h>
 
 #include <asm/irq.h>
 #include <asm/pmu.h>
diff --git a/arch/arm/plat-samsung/include/plat/udc.h b/arch/arm/plat-samsung/include/plat/udc.h
index 8c22d58..de8e228 100644
--- a/arch/arm/plat-samsung/include/plat/udc.h
+++ b/arch/arm/plat-samsung/include/plat/udc.h
@@ -37,20 +37,7 @@ struct s3c2410_udc_mach_info {
 
 extern void __init s3c24xx_udc_set_platdata(struct s3c2410_udc_mach_info *);
 
-/**
- * s3c24xx_hsudc_platdata - Platform data for USB High-Speed gadget controller.
- * @epnum: Number of endpoints to be instantiated by the controller driver.
- * @gpio_init: Platform specific USB related GPIO initialization.
- * @gpio_uninit: Platform specific USB releted GPIO uninitialzation.
- *
- * Representation of platform data for the S3C24XX USB 2.0 High Speed gadget
- * controllers.
- */
-struct s3c24xx_hsudc_platdata {
-	unsigned int	epnum;
-	void		(*gpio_init)(void);
-	void		(*gpio_uninit)(void);
-};
+struct s3c24xx_hsudc_platdata;
 
 extern void __init s3c24xx_hsudc_set_platdata(struct s3c24xx_hsudc_platdata *pd);
 
diff --git a/drivers/usb/gadget/s3c-hsudc.c b/drivers/usb/gadget/s3c-hsudc.c
index 6f2a041..4c1abb1 100644
--- a/drivers/usb/gadget/s3c-hsudc.c
+++ b/drivers/usb/gadget/s3c-hsudc.c
@@ -28,9 +28,9 @@
 #include <linux/usb/gadget.h>
 #include <linux/usb/otg.h>
 #include <linux/prefetch.h>
+#include <linux/usb/s3c-hsudc.h>
 
 #include <mach/regs-s3c2443-clock.h>
-#include <plat/udc.h>
 
 #define S3C_HSUDC_REG(x)	(x)
 
diff --git a/include/linux/usb/s3c-hsudc.h b/include/linux/usb/s3c-hsudc.h
new file mode 100644
index 0000000..6fa1093
--- /dev/null
+++ b/include/linux/usb/s3c-hsudc.h
@@ -0,0 +1,34 @@
+/*
+ * S3C24XX USB 2.0 High-speed USB controller gadget driver
+ *
+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.
+ *		http://www.samsung.com/
+ *
+ * The S3C24XX USB 2.0 high-speed USB controller supports upto 9 endpoints.
+ * Each endpoint can be configured as either in or out endpoint. Endpoints
+ * can be configured for Bulk or Interrupt transfer mode.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+#ifndef __LINUX_USB_S3C_HSUDC_H
+#define __LINUX_USB_S3C_HSUDC_H
+
+/**
+ * s3c24xx_hsudc_platdata - Platform data for USB High-Speed gadget controller.
+ * @epnum: Number of endpoints to be instantiated by the controller driver.
+ * @gpio_init: Platform specific USB related GPIO initialization.
+ * @gpio_uninit: Platform specific USB releted GPIO uninitialzation.
+ *
+ * Representation of platform data for the S3C24XX USB 2.0 High Speed gadget
+ * controllers.
+ */
+struct s3c24xx_hsudc_platdata {
+	unsigned int	epnum;
+	void		(*gpio_init)(void);
+	void		(*gpio_uninit)(void);
+};
+
+#endif	/* __LINUX_USB_S3C_HSUDC_H */
-- 
1.7.2.3

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

* [PATCH 1/7] s3c-hsudc: move platform_data struct to global header
@ 2011-12-17 19:24   ` Heiko Stübner
  0 siblings, 0 replies; 48+ messages in thread
From: Heiko Stübner @ 2011-12-17 19:24 UTC (permalink / raw)
  To: linux-arm-kernel

Gadget drivers should be compilable on all architectures.
This patch removes one dependency on architecture-specific code.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
 arch/arm/mach-s3c2416/mach-smdk2416.c    |    1 +
 arch/arm/plat-samsung/devs.c             |    1 +
 arch/arm/plat-samsung/include/plat/udc.h |   15 +------------
 drivers/usb/gadget/s3c-hsudc.c           |    2 +-
 include/linux/usb/s3c-hsudc.h            |   34 ++++++++++++++++++++++++++++++
 5 files changed, 38 insertions(+), 15 deletions(-)
 create mode 100644 include/linux/usb/s3c-hsudc.h

diff --git a/arch/arm/mach-s3c2416/mach-smdk2416.c b/arch/arm/mach-s3c2416/mach-smdk2416.c
index a9eee53..018338a 100644
--- a/arch/arm/mach-s3c2416/mach-smdk2416.c
+++ b/arch/arm/mach-s3c2416/mach-smdk2416.c
@@ -50,6 +50,7 @@
 #include <plat/nand.h>
 #include <plat/sdhci.h>
 #include <plat/udc.h>
+#include <linux/usb/s3c-hsudc.h>
 
 #include <plat/regs-fb-v4.h>
 #include <plat/fb.h>
diff --git a/arch/arm/plat-samsung/devs.c b/arch/arm/plat-samsung/devs.c
index 4ca8b57..5468723 100644
--- a/arch/arm/plat-samsung/devs.c
+++ b/arch/arm/plat-samsung/devs.c
@@ -29,6 +29,7 @@
 #include <linux/mtd/partitions.h>
 #include <linux/mmc/host.h>
 #include <linux/ioport.h>
+#include <linux/usb/s3c-hsudc.h>
 
 #include <asm/irq.h>
 #include <asm/pmu.h>
diff --git a/arch/arm/plat-samsung/include/plat/udc.h b/arch/arm/plat-samsung/include/plat/udc.h
index 8c22d58..de8e228 100644
--- a/arch/arm/plat-samsung/include/plat/udc.h
+++ b/arch/arm/plat-samsung/include/plat/udc.h
@@ -37,20 +37,7 @@ struct s3c2410_udc_mach_info {
 
 extern void __init s3c24xx_udc_set_platdata(struct s3c2410_udc_mach_info *);
 
-/**
- * s3c24xx_hsudc_platdata - Platform data for USB High-Speed gadget controller.
- * @epnum: Number of endpoints to be instantiated by the controller driver.
- * @gpio_init: Platform specific USB related GPIO initialization.
- * @gpio_uninit: Platform specific USB releted GPIO uninitialzation.
- *
- * Representation of platform data for the S3C24XX USB 2.0 High Speed gadget
- * controllers.
- */
-struct s3c24xx_hsudc_platdata {
-	unsigned int	epnum;
-	void		(*gpio_init)(void);
-	void		(*gpio_uninit)(void);
-};
+struct s3c24xx_hsudc_platdata;
 
 extern void __init s3c24xx_hsudc_set_platdata(struct s3c24xx_hsudc_platdata *pd);
 
diff --git a/drivers/usb/gadget/s3c-hsudc.c b/drivers/usb/gadget/s3c-hsudc.c
index 6f2a041..4c1abb1 100644
--- a/drivers/usb/gadget/s3c-hsudc.c
+++ b/drivers/usb/gadget/s3c-hsudc.c
@@ -28,9 +28,9 @@
 #include <linux/usb/gadget.h>
 #include <linux/usb/otg.h>
 #include <linux/prefetch.h>
+#include <linux/usb/s3c-hsudc.h>
 
 #include <mach/regs-s3c2443-clock.h>
-#include <plat/udc.h>
 
 #define S3C_HSUDC_REG(x)	(x)
 
diff --git a/include/linux/usb/s3c-hsudc.h b/include/linux/usb/s3c-hsudc.h
new file mode 100644
index 0000000..6fa1093
--- /dev/null
+++ b/include/linux/usb/s3c-hsudc.h
@@ -0,0 +1,34 @@
+/*
+ * S3C24XX USB 2.0 High-speed USB controller gadget driver
+ *
+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.
+ *		http://www.samsung.com/
+ *
+ * The S3C24XX USB 2.0 high-speed USB controller supports upto 9 endpoints.
+ * Each endpoint can be configured as either in or out endpoint. Endpoints
+ * can be configured for Bulk or Interrupt transfer mode.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+#ifndef __LINUX_USB_S3C_HSUDC_H
+#define __LINUX_USB_S3C_HSUDC_H
+
+/**
+ * s3c24xx_hsudc_platdata - Platform data for USB High-Speed gadget controller.
+ * @epnum: Number of endpoints to be instantiated by the controller driver.
+ * @gpio_init: Platform specific USB related GPIO initialization.
+ * @gpio_uninit: Platform specific USB releted GPIO uninitialzation.
+ *
+ * Representation of platform data for the S3C24XX USB 2.0 High Speed gadget
+ * controllers.
+ */
+struct s3c24xx_hsudc_platdata {
+	unsigned int	epnum;
+	void		(*gpio_init)(void);
+	void		(*gpio_uninit)(void);
+};
+
+#endif	/* __LINUX_USB_S3C_HSUDC_H */
-- 
1.7.2.3

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

* [PATCH 2/7] s3c-hsudc: add __devinit to probe function
  2011-12-17 19:23 ` Heiko Stübner
@ 2011-12-17 19:25   ` Heiko Stübner
  -1 siblings, 0 replies; 48+ messages in thread
From: Heiko Stübner @ 2011-12-17 19:25 UTC (permalink / raw)
  To: Felipe Balbi, Kukjin Kim
  Cc: linux-usb, linux-samsung-soc, linux-arm-kernel, Thomas Abraham

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
 drivers/usb/gadget/s3c-hsudc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/gadget/s3c-hsudc.c b/drivers/usb/gadget/s3c-hsudc.c
index 4c1abb1..3e5673d 100644
--- a/drivers/usb/gadget/s3c-hsudc.c
+++ b/drivers/usb/gadget/s3c-hsudc.c
@@ -1260,7 +1260,7 @@ static struct usb_gadget_ops s3c_hsudc_gadget_ops = {
 	.vbus_draw	= s3c_hsudc_vbus_draw,
 };
 
-static int s3c_hsudc_probe(struct platform_device *pdev)
+static int __devinit s3c_hsudc_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
 	struct resource *res;
-- 
1.7.2.3

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

* [PATCH 2/7] s3c-hsudc: add __devinit to probe function
@ 2011-12-17 19:25   ` Heiko Stübner
  0 siblings, 0 replies; 48+ messages in thread
From: Heiko Stübner @ 2011-12-17 19:25 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
 drivers/usb/gadget/s3c-hsudc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/gadget/s3c-hsudc.c b/drivers/usb/gadget/s3c-hsudc.c
index 4c1abb1..3e5673d 100644
--- a/drivers/usb/gadget/s3c-hsudc.c
+++ b/drivers/usb/gadget/s3c-hsudc.c
@@ -1260,7 +1260,7 @@ static struct usb_gadget_ops s3c_hsudc_gadget_ops = {
 	.vbus_draw	= s3c_hsudc_vbus_draw,
 };
 
-static int s3c_hsudc_probe(struct platform_device *pdev)
+static int __devinit s3c_hsudc_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
 	struct resource *res;
-- 
1.7.2.3

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

* [PATCH 3/7] s3c-hsudc: add a remove function
  2011-12-17 19:23 ` Heiko Stübner
@ 2011-12-17 19:26   ` Heiko Stübner
  -1 siblings, 0 replies; 48+ messages in thread
From: Heiko Stübner @ 2011-12-17 19:26 UTC (permalink / raw)
  To: Felipe Balbi, Kukjin Kim
  Cc: linux-usb, linux-samsung-soc, linux-arm-kernel, Thomas Abraham

As the driver is also buildable as a module it should need
a cleanup function for the removal of the module.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
 drivers/usb/gadget/s3c-hsudc.c |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/gadget/s3c-hsudc.c b/drivers/usb/gadget/s3c-hsudc.c
index 3e5673d..7cb0850 100644
--- a/drivers/usb/gadget/s3c-hsudc.c
+++ b/drivers/usb/gadget/s3c-hsudc.c
@@ -1370,12 +1370,37 @@ err_res:
 	return ret;
 }
 
+static int __devexit s3c_hsudc_remove(struct platform_device *pdev)
+{
+	struct s3c_hsudc *hsudc = the_controller;
+
+	usb_del_gadget_udc(&hsudc->gadget);
+
+	clk_disable(hsudc->uclk);
+	clk_put(hsudc->uclk);
+
+	free_irq(hsudc->irq, hsudc);
+
+	iounmap(hsudc->regs);
+
+	release_resource(hsudc->mem_rsrc);
+	kfree(hsudc->mem_rsrc);
+
+	if (hsudc->transceiver)
+		otg_put_transceiver(hsudc->transceiver);
+
+	the_controller = NULL;
+	kfree(hsudc);
+	return 0;
+}
+
 static struct platform_driver s3c_hsudc_driver = {
 	.driver		= {
 		.owner	= THIS_MODULE,
 		.name	= "s3c-hsudc",
 	},
 	.probe		= s3c_hsudc_probe,
+	.remove		= __devexit_p(s3c_hsudc_remove),
 };
 
 module_platform_driver(s3c_hsudc_driver);
-- 
1.7.2.3

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

* [PATCH 3/7] s3c-hsudc: add a remove function
@ 2011-12-17 19:26   ` Heiko Stübner
  0 siblings, 0 replies; 48+ messages in thread
From: Heiko Stübner @ 2011-12-17 19:26 UTC (permalink / raw)
  To: linux-arm-kernel

As the driver is also buildable as a module it should need
a cleanup function for the removal of the module.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
 drivers/usb/gadget/s3c-hsudc.c |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/gadget/s3c-hsudc.c b/drivers/usb/gadget/s3c-hsudc.c
index 3e5673d..7cb0850 100644
--- a/drivers/usb/gadget/s3c-hsudc.c
+++ b/drivers/usb/gadget/s3c-hsudc.c
@@ -1370,12 +1370,37 @@ err_res:
 	return ret;
 }
 
+static int __devexit s3c_hsudc_remove(struct platform_device *pdev)
+{
+	struct s3c_hsudc *hsudc = the_controller;
+
+	usb_del_gadget_udc(&hsudc->gadget);
+
+	clk_disable(hsudc->uclk);
+	clk_put(hsudc->uclk);
+
+	free_irq(hsudc->irq, hsudc);
+
+	iounmap(hsudc->regs);
+
+	release_resource(hsudc->mem_rsrc);
+	kfree(hsudc->mem_rsrc);
+
+	if (hsudc->transceiver)
+		otg_put_transceiver(hsudc->transceiver);
+
+	the_controller = NULL;
+	kfree(hsudc);
+	return 0;
+}
+
 static struct platform_driver s3c_hsudc_driver = {
 	.driver		= {
 		.owner	= THIS_MODULE,
 		.name	= "s3c-hsudc",
 	},
 	.probe		= s3c_hsudc_probe,
+	.remove		= __devexit_p(s3c_hsudc_remove),
 };
 
 module_platform_driver(s3c_hsudc_driver);
-- 
1.7.2.3

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

* [PATCH 4/7] s3c-hsudc: add missing otg_put_transceiver in probe
  2011-12-17 19:23 ` Heiko Stübner
@ 2011-12-17 19:27   ` Heiko Stübner
  -1 siblings, 0 replies; 48+ messages in thread
From: Heiko Stübner @ 2011-12-17 19:27 UTC (permalink / raw)
  To: Felipe Balbi, Kukjin Kim
  Cc: linux-usb, linux-samsung-soc, linux-arm-kernel, Thomas Abraham

The number of get and put calls should always be equal.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
 drivers/usb/gadget/s3c-hsudc.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/gadget/s3c-hsudc.c b/drivers/usb/gadget/s3c-hsudc.c
index 7cb0850..06ca8c4 100644
--- a/drivers/usb/gadget/s3c-hsudc.c
+++ b/drivers/usb/gadget/s3c-hsudc.c
@@ -1366,6 +1366,9 @@ err_remap:
 	kfree(hsudc->mem_rsrc);
 
 err_res:
+	if (hsudc->transceiver)
+		otg_put_transceiver(hsudc->transceiver);
+
 	kfree(hsudc);
 	return ret;
 }
-- 
1.7.2.3

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

* [PATCH 4/7] s3c-hsudc: add missing otg_put_transceiver in probe
@ 2011-12-17 19:27   ` Heiko Stübner
  0 siblings, 0 replies; 48+ messages in thread
From: Heiko Stübner @ 2011-12-17 19:27 UTC (permalink / raw)
  To: linux-arm-kernel

The number of get and put calls should always be equal.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
 drivers/usb/gadget/s3c-hsudc.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/gadget/s3c-hsudc.c b/drivers/usb/gadget/s3c-hsudc.c
index 7cb0850..06ca8c4 100644
--- a/drivers/usb/gadget/s3c-hsudc.c
+++ b/drivers/usb/gadget/s3c-hsudc.c
@@ -1366,6 +1366,9 @@ err_remap:
 	kfree(hsudc->mem_rsrc);
 
 err_res:
+	if (hsudc->transceiver)
+		otg_put_transceiver(hsudc->transceiver);
+
 	kfree(hsudc);
 	return ret;
 }
-- 
1.7.2.3

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

* [PATCH 5/7] s3c-hsudc: move device registration to probe and remove
  2011-12-17 19:23 ` Heiko Stübner
@ 2011-12-17 19:28   ` Heiko Stübner
  -1 siblings, 0 replies; 48+ messages in thread
From: Heiko Stübner @ 2011-12-17 19:28 UTC (permalink / raw)
  To: Felipe Balbi, Kukjin Kim
  Cc: linux-usb, linux-samsung-soc, linux-arm-kernel, Thomas Abraham

Instead of adding and deleting the gadget device in the start and stop
invocations. Use device_register in the probe method to initialize
and add the gadget device and unregister it in the remove function.

This also requires a release function for the gadget device.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
 drivers/usb/gadget/s3c-hsudc.c |   27 ++++++++++++++++++---------
 1 files changed, 18 insertions(+), 9 deletions(-)

diff --git a/drivers/usb/gadget/s3c-hsudc.c b/drivers/usb/gadget/s3c-hsudc.c
index 06ca8c4..fa2ae7a 100644
--- a/drivers/usb/gadget/s3c-hsudc.c
+++ b/drivers/usb/gadget/s3c-hsudc.c
@@ -1156,11 +1156,6 @@ static int s3c_hsudc_start(struct usb_gadget_driver *driver,
 	hsudc->driver = driver;
 	hsudc->gadget.dev.driver = &driver->driver;
 	hsudc->gadget.speed = USB_SPEED_UNKNOWN;
-	ret = device_add(&hsudc->gadget.dev);
-	if (ret) {
-		dev_err(hsudc->dev, "failed to probe gadget device");
-		return ret;
-	}
 
 	ret = bind(&hsudc->gadget);
 	if (ret) {
@@ -1180,8 +1175,6 @@ static int s3c_hsudc_start(struct usb_gadget_driver *driver,
 					hsudc->gadget.name);
 			driver->unbind(&hsudc->gadget);
 
-			device_del(&hsudc->gadget.dev);
-
 			hsudc->driver = NULL;
 			hsudc->gadget.dev.driver = NULL;
 			return ret;
@@ -1222,7 +1215,6 @@ static int s3c_hsudc_stop(struct usb_gadget_driver *driver)
 		(void) otg_set_peripheral(hsudc->transceiver, NULL);
 
 	driver->unbind(&hsudc->gadget);
-	device_del(&hsudc->gadget.dev);
 	disable_irq(hsudc->irq);
 
 	dev_info(hsudc->dev, "unregistered gadget driver '%s'\n",
@@ -1260,6 +1252,13 @@ static struct usb_gadget_ops s3c_hsudc_gadget_ops = {
 	.vbus_draw	= s3c_hsudc_vbus_draw,
 };
 
+/* The gadget structure is stored inside the hsudc structure and will be
+ * released along with it. */
+static void s3c_hsudc_gadget_release(struct device *dev)
+{
+	return;
+}
+
 static int __devinit s3c_hsudc_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
@@ -1307,7 +1306,6 @@ static int __devinit s3c_hsudc_probe(struct platform_device *pdev)
 
 	spin_lock_init(&hsudc->lock);
 
-	device_initialize(&hsudc->gadget.dev);
 	dev_set_name(&hsudc->gadget.dev, "gadget");
 
 	hsudc->gadget.max_speed = USB_SPEED_HIGH;
@@ -1315,6 +1313,7 @@ static int __devinit s3c_hsudc_probe(struct platform_device *pdev)
 	hsudc->gadget.name = dev_name(dev);
 	hsudc->gadget.dev.parent = dev;
 	hsudc->gadget.dev.dma_mask = dev->dma_mask;
+	hsudc->gadget.dev.release = s3c_hsudc_gadget_release;
 	hsudc->gadget.ep0 = &hsudc->ep[0].ep;
 
 	hsudc->gadget.is_otg = 0;
@@ -1348,12 +1347,20 @@ static int __devinit s3c_hsudc_probe(struct platform_device *pdev)
 	disable_irq(hsudc->irq);
 	local_irq_enable();
 
+	ret = device_register(&hsudc->gadget.dev);
+	if (ret) {
+		put_device(&hsudc->gadget.dev);
+		goto err_add_device;
+	}
+
 	ret = usb_add_gadget_udc(&pdev->dev, &hsudc->gadget);
 	if (ret)
 		goto err_add_udc;
 
 	return 0;
 err_add_udc:
+	device_unregister(&hsudc->gadget.dev);
+err_add_device:
 	clk_disable(hsudc->uclk);
 	clk_put(hsudc->uclk);
 err_clk:
@@ -1379,6 +1386,8 @@ static int __devexit s3c_hsudc_remove(struct platform_device *pdev)
 
 	usb_del_gadget_udc(&hsudc->gadget);
 
+	device_unregister(&hsudc->gadget.dev);
+
 	clk_disable(hsudc->uclk);
 	clk_put(hsudc->uclk);
 
-- 
1.7.2.3

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

* [PATCH 5/7] s3c-hsudc: move device registration to probe and remove
@ 2011-12-17 19:28   ` Heiko Stübner
  0 siblings, 0 replies; 48+ messages in thread
From: Heiko Stübner @ 2011-12-17 19:28 UTC (permalink / raw)
  To: linux-arm-kernel

Instead of adding and deleting the gadget device in the start and stop
invocations. Use device_register in the probe method to initialize
and add the gadget device and unregister it in the remove function.

This also requires a release function for the gadget device.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
 drivers/usb/gadget/s3c-hsudc.c |   27 ++++++++++++++++++---------
 1 files changed, 18 insertions(+), 9 deletions(-)

diff --git a/drivers/usb/gadget/s3c-hsudc.c b/drivers/usb/gadget/s3c-hsudc.c
index 06ca8c4..fa2ae7a 100644
--- a/drivers/usb/gadget/s3c-hsudc.c
+++ b/drivers/usb/gadget/s3c-hsudc.c
@@ -1156,11 +1156,6 @@ static int s3c_hsudc_start(struct usb_gadget_driver *driver,
 	hsudc->driver = driver;
 	hsudc->gadget.dev.driver = &driver->driver;
 	hsudc->gadget.speed = USB_SPEED_UNKNOWN;
-	ret = device_add(&hsudc->gadget.dev);
-	if (ret) {
-		dev_err(hsudc->dev, "failed to probe gadget device");
-		return ret;
-	}
 
 	ret = bind(&hsudc->gadget);
 	if (ret) {
@@ -1180,8 +1175,6 @@ static int s3c_hsudc_start(struct usb_gadget_driver *driver,
 					hsudc->gadget.name);
 			driver->unbind(&hsudc->gadget);
 
-			device_del(&hsudc->gadget.dev);
-
 			hsudc->driver = NULL;
 			hsudc->gadget.dev.driver = NULL;
 			return ret;
@@ -1222,7 +1215,6 @@ static int s3c_hsudc_stop(struct usb_gadget_driver *driver)
 		(void) otg_set_peripheral(hsudc->transceiver, NULL);
 
 	driver->unbind(&hsudc->gadget);
-	device_del(&hsudc->gadget.dev);
 	disable_irq(hsudc->irq);
 
 	dev_info(hsudc->dev, "unregistered gadget driver '%s'\n",
@@ -1260,6 +1252,13 @@ static struct usb_gadget_ops s3c_hsudc_gadget_ops = {
 	.vbus_draw	= s3c_hsudc_vbus_draw,
 };
 
+/* The gadget structure is stored inside the hsudc structure and will be
+ * released along with it. */
+static void s3c_hsudc_gadget_release(struct device *dev)
+{
+	return;
+}
+
 static int __devinit s3c_hsudc_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
@@ -1307,7 +1306,6 @@ static int __devinit s3c_hsudc_probe(struct platform_device *pdev)
 
 	spin_lock_init(&hsudc->lock);
 
-	device_initialize(&hsudc->gadget.dev);
 	dev_set_name(&hsudc->gadget.dev, "gadget");
 
 	hsudc->gadget.max_speed = USB_SPEED_HIGH;
@@ -1315,6 +1313,7 @@ static int __devinit s3c_hsudc_probe(struct platform_device *pdev)
 	hsudc->gadget.name = dev_name(dev);
 	hsudc->gadget.dev.parent = dev;
 	hsudc->gadget.dev.dma_mask = dev->dma_mask;
+	hsudc->gadget.dev.release = s3c_hsudc_gadget_release;
 	hsudc->gadget.ep0 = &hsudc->ep[0].ep;
 
 	hsudc->gadget.is_otg = 0;
@@ -1348,12 +1347,20 @@ static int __devinit s3c_hsudc_probe(struct platform_device *pdev)
 	disable_irq(hsudc->irq);
 	local_irq_enable();
 
+	ret = device_register(&hsudc->gadget.dev);
+	if (ret) {
+		put_device(&hsudc->gadget.dev);
+		goto err_add_device;
+	}
+
 	ret = usb_add_gadget_udc(&pdev->dev, &hsudc->gadget);
 	if (ret)
 		goto err_add_udc;
 
 	return 0;
 err_add_udc:
+	device_unregister(&hsudc->gadget.dev);
+err_add_device:
 	clk_disable(hsudc->uclk);
 	clk_put(hsudc->uclk);
 err_clk:
@@ -1379,6 +1386,8 @@ static int __devexit s3c_hsudc_remove(struct platform_device *pdev)
 
 	usb_del_gadget_udc(&hsudc->gadget);
 
+	device_unregister(&hsudc->gadget.dev);
+
 	clk_disable(hsudc->uclk);
 	clk_put(hsudc->uclk);
 
-- 
1.7.2.3

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

* [PATCH 6/7] s3c-hsudc: use udc_start and udc_stop functions
  2011-12-17 19:23 ` Heiko Stübner
@ 2011-12-17 19:29     ` Heiko Stübner
  -1 siblings, 0 replies; 48+ messages in thread
From: Heiko Stübner @ 2011-12-17 19:29 UTC (permalink / raw)
  To: Felipe Balbi, Kukjin Kim
  Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	Thomas Abraham

udc_start and udc_stop reduce code duplication in comparison to
start and stop generalising calls done by all drivers
(i.e. bind and unbind) and moving these calls to common code.

Signed-off-by: Heiko Stuebner <heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>
---
 drivers/usb/gadget/s3c-hsudc.c |   44 ++++++++++++---------------------------
 1 files changed, 14 insertions(+), 30 deletions(-)

diff --git a/drivers/usb/gadget/s3c-hsudc.c b/drivers/usb/gadget/s3c-hsudc.c
index fa2ae7a..a47bfa0 100644
--- a/drivers/usb/gadget/s3c-hsudc.c
+++ b/drivers/usb/gadget/s3c-hsudc.c
@@ -282,8 +282,7 @@ static void s3c_hsudc_nuke_ep(struct s3c_hsudc_ep *hsep, int status)
  * All the endpoints are stopped and any pending transfer requests if any on
  * the endpoint are terminated.
  */
-static void s3c_hsudc_stop_activity(struct s3c_hsudc *hsudc,
-			  struct usb_gadget_driver *driver)
+static void s3c_hsudc_stop_activity(struct s3c_hsudc *hsudc)
 {
 	struct s3c_hsudc_ep *hsep;
 	int epnum;
@@ -295,10 +294,6 @@ static void s3c_hsudc_stop_activity(struct s3c_hsudc *hsudc,
 		hsep->stopped = 1;
 		s3c_hsudc_nuke_ep(hsep, -ESHUTDOWN);
 	}
-
-	spin_unlock(&hsudc->lock);
-	driver->disconnect(&hsudc->gadget);
-	spin_lock(&hsudc->lock);
 }
 
 /**
@@ -1135,16 +1130,15 @@ static irqreturn_t s3c_hsudc_irq(int irq, void *_dev)
 	return IRQ_HANDLED;
 }
 
-static int s3c_hsudc_start(struct usb_gadget_driver *driver,
-		int (*bind)(struct usb_gadget *))
+static int s3c_hsudc_start(struct usb_gadget *g,
+		struct usb_gadget_driver *driver)
 {
 	struct s3c_hsudc *hsudc = the_controller;
 	int ret;
 
 	if (!driver
 		|| driver->max_speed < USB_SPEED_FULL
-		|| !bind
-		|| !driver->unbind || !driver->disconnect || !driver->setup)
+		|| !driver->setup)
 		return -EINVAL;
 
 	if (!hsudc)
@@ -1155,17 +1149,6 @@ static int s3c_hsudc_start(struct usb_gadget_driver *driver,
 
 	hsudc->driver = driver;
 	hsudc->gadget.dev.driver = &driver->driver;
-	hsudc->gadget.speed = USB_SPEED_UNKNOWN;
-
-	ret = bind(&hsudc->gadget);
-	if (ret) {
-		dev_err(hsudc->dev, "%s: bind failed\n", hsudc->gadget.name);
-		device_del(&hsudc->gadget.dev);
-
-		hsudc->driver = NULL;
-		hsudc->gadget.dev.driver = NULL;
-		return ret;
-	}
 
 	/* connect to bus through transceiver */
 	if (hsudc->transceiver) {
@@ -1173,8 +1156,6 @@ static int s3c_hsudc_start(struct usb_gadget_driver *driver,
 		if (ret) {
 			dev_err(hsudc->dev, "%s: can't bind to transceiver\n",
 					hsudc->gadget.name);
-			driver->unbind(&hsudc->gadget);
-
 			hsudc->driver = NULL;
 			hsudc->gadget.dev.driver = NULL;
 			return ret;
@@ -1192,7 +1173,8 @@ static int s3c_hsudc_start(struct usb_gadget_driver *driver,
 	return 0;
 }
 
-static int s3c_hsudc_stop(struct usb_gadget_driver *driver)
+static int s3c_hsudc_stop(struct usb_gadget *g,
+		struct usb_gadget_driver *driver)
 {
 	struct s3c_hsudc *hsudc = the_controller;
 	unsigned long flags;
@@ -1200,21 +1182,22 @@ static int s3c_hsudc_stop(struct usb_gadget_driver *driver)
 	if (!hsudc)
 		return -ENODEV;
 
-	if (!driver || driver != hsudc->driver || !driver->unbind)
+	if (!driver || driver != hsudc->driver)
 		return -EINVAL;
 
 	spin_lock_irqsave(&hsudc->lock, flags);
-	hsudc->driver = 0;
+	hsudc->driver = NULL;
+	hsudc->gadget.dev.driver = NULL;
+	hsudc->gadget.speed = USB_SPEED_UNKNOWN;
 	s3c_hsudc_uninit_phy();
 	if (hsudc->pd->gpio_uninit)
 		hsudc->pd->gpio_uninit();
-	s3c_hsudc_stop_activity(hsudc, driver);
+	s3c_hsudc_stop_activity(hsudc);
 	spin_unlock_irqrestore(&hsudc->lock, flags);
 
 	if (hsudc->transceiver)
 		(void) otg_set_peripheral(hsudc->transceiver, NULL);
 
-	driver->unbind(&hsudc->gadget);
 	disable_irq(hsudc->irq);
 
 	dev_info(hsudc->dev, "unregistered gadget driver '%s'\n",
@@ -1247,8 +1230,8 @@ static int s3c_hsudc_vbus_draw(struct usb_gadget *gadget, unsigned mA)
 
 static struct usb_gadget_ops s3c_hsudc_gadget_ops = {
 	.get_frame	= s3c_hsudc_gadget_getframe,
-	.start		= s3c_hsudc_start,
-	.stop		= s3c_hsudc_stop,
+	.udc_start	= s3c_hsudc_start,
+	.udc_stop	= s3c_hsudc_stop,
 	.vbus_draw	= s3c_hsudc_vbus_draw,
 };
 
@@ -1318,6 +1301,7 @@ static int __devinit s3c_hsudc_probe(struct platform_device *pdev)
 
 	hsudc->gadget.is_otg = 0;
 	hsudc->gadget.is_a_peripheral = 0;
+	hsudc->gadget.speed = USB_SPEED_UNKNOWN;
 
 	s3c_hsudc_setup_ep(hsudc);
 
-- 
1.7.2.3

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

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

* [PATCH 6/7] s3c-hsudc: use udc_start and udc_stop functions
@ 2011-12-17 19:29     ` Heiko Stübner
  0 siblings, 0 replies; 48+ messages in thread
From: Heiko Stübner @ 2011-12-17 19:29 UTC (permalink / raw)
  To: linux-arm-kernel

udc_start and udc_stop reduce code duplication in comparison to
start and stop generalising calls done by all drivers
(i.e. bind and unbind) and moving these calls to common code.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
 drivers/usb/gadget/s3c-hsudc.c |   44 ++++++++++++---------------------------
 1 files changed, 14 insertions(+), 30 deletions(-)

diff --git a/drivers/usb/gadget/s3c-hsudc.c b/drivers/usb/gadget/s3c-hsudc.c
index fa2ae7a..a47bfa0 100644
--- a/drivers/usb/gadget/s3c-hsudc.c
+++ b/drivers/usb/gadget/s3c-hsudc.c
@@ -282,8 +282,7 @@ static void s3c_hsudc_nuke_ep(struct s3c_hsudc_ep *hsep, int status)
  * All the endpoints are stopped and any pending transfer requests if any on
  * the endpoint are terminated.
  */
-static void s3c_hsudc_stop_activity(struct s3c_hsudc *hsudc,
-			  struct usb_gadget_driver *driver)
+static void s3c_hsudc_stop_activity(struct s3c_hsudc *hsudc)
 {
 	struct s3c_hsudc_ep *hsep;
 	int epnum;
@@ -295,10 +294,6 @@ static void s3c_hsudc_stop_activity(struct s3c_hsudc *hsudc,
 		hsep->stopped = 1;
 		s3c_hsudc_nuke_ep(hsep, -ESHUTDOWN);
 	}
-
-	spin_unlock(&hsudc->lock);
-	driver->disconnect(&hsudc->gadget);
-	spin_lock(&hsudc->lock);
 }
 
 /**
@@ -1135,16 +1130,15 @@ static irqreturn_t s3c_hsudc_irq(int irq, void *_dev)
 	return IRQ_HANDLED;
 }
 
-static int s3c_hsudc_start(struct usb_gadget_driver *driver,
-		int (*bind)(struct usb_gadget *))
+static int s3c_hsudc_start(struct usb_gadget *g,
+		struct usb_gadget_driver *driver)
 {
 	struct s3c_hsudc *hsudc = the_controller;
 	int ret;
 
 	if (!driver
 		|| driver->max_speed < USB_SPEED_FULL
-		|| !bind
-		|| !driver->unbind || !driver->disconnect || !driver->setup)
+		|| !driver->setup)
 		return -EINVAL;
 
 	if (!hsudc)
@@ -1155,17 +1149,6 @@ static int s3c_hsudc_start(struct usb_gadget_driver *driver,
 
 	hsudc->driver = driver;
 	hsudc->gadget.dev.driver = &driver->driver;
-	hsudc->gadget.speed = USB_SPEED_UNKNOWN;
-
-	ret = bind(&hsudc->gadget);
-	if (ret) {
-		dev_err(hsudc->dev, "%s: bind failed\n", hsudc->gadget.name);
-		device_del(&hsudc->gadget.dev);
-
-		hsudc->driver = NULL;
-		hsudc->gadget.dev.driver = NULL;
-		return ret;
-	}
 
 	/* connect to bus through transceiver */
 	if (hsudc->transceiver) {
@@ -1173,8 +1156,6 @@ static int s3c_hsudc_start(struct usb_gadget_driver *driver,
 		if (ret) {
 			dev_err(hsudc->dev, "%s: can't bind to transceiver\n",
 					hsudc->gadget.name);
-			driver->unbind(&hsudc->gadget);
-
 			hsudc->driver = NULL;
 			hsudc->gadget.dev.driver = NULL;
 			return ret;
@@ -1192,7 +1173,8 @@ static int s3c_hsudc_start(struct usb_gadget_driver *driver,
 	return 0;
 }
 
-static int s3c_hsudc_stop(struct usb_gadget_driver *driver)
+static int s3c_hsudc_stop(struct usb_gadget *g,
+		struct usb_gadget_driver *driver)
 {
 	struct s3c_hsudc *hsudc = the_controller;
 	unsigned long flags;
@@ -1200,21 +1182,22 @@ static int s3c_hsudc_stop(struct usb_gadget_driver *driver)
 	if (!hsudc)
 		return -ENODEV;
 
-	if (!driver || driver != hsudc->driver || !driver->unbind)
+	if (!driver || driver != hsudc->driver)
 		return -EINVAL;
 
 	spin_lock_irqsave(&hsudc->lock, flags);
-	hsudc->driver = 0;
+	hsudc->driver = NULL;
+	hsudc->gadget.dev.driver = NULL;
+	hsudc->gadget.speed = USB_SPEED_UNKNOWN;
 	s3c_hsudc_uninit_phy();
 	if (hsudc->pd->gpio_uninit)
 		hsudc->pd->gpio_uninit();
-	s3c_hsudc_stop_activity(hsudc, driver);
+	s3c_hsudc_stop_activity(hsudc);
 	spin_unlock_irqrestore(&hsudc->lock, flags);
 
 	if (hsudc->transceiver)
 		(void) otg_set_peripheral(hsudc->transceiver, NULL);
 
-	driver->unbind(&hsudc->gadget);
 	disable_irq(hsudc->irq);
 
 	dev_info(hsudc->dev, "unregistered gadget driver '%s'\n",
@@ -1247,8 +1230,8 @@ static int s3c_hsudc_vbus_draw(struct usb_gadget *gadget, unsigned mA)
 
 static struct usb_gadget_ops s3c_hsudc_gadget_ops = {
 	.get_frame	= s3c_hsudc_gadget_getframe,
-	.start		= s3c_hsudc_start,
-	.stop		= s3c_hsudc_stop,
+	.udc_start	= s3c_hsudc_start,
+	.udc_stop	= s3c_hsudc_stop,
 	.vbus_draw	= s3c_hsudc_vbus_draw,
 };
 
@@ -1318,6 +1301,7 @@ static int __devinit s3c_hsudc_probe(struct platform_device *pdev)
 
 	hsudc->gadget.is_otg = 0;
 	hsudc->gadget.is_a_peripheral = 0;
+	hsudc->gadget.speed = USB_SPEED_UNKNOWN;
 
 	s3c_hsudc_setup_ep(hsudc);
 
-- 
1.7.2.3

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

* [PATCH 7/7] s3c-hsudc: Add regulator handling
  2011-12-17 19:23 ` Heiko Stübner
@ 2011-12-17 19:30   ` Heiko Stübner
  -1 siblings, 0 replies; 48+ messages in thread
From: Heiko Stübner @ 2011-12-17 19:30 UTC (permalink / raw)
  To: Felipe Balbi, Kukjin Kim
  Cc: linux-usb, linux-samsung-soc, linux-arm-kernel, Thomas Abraham

The udc has three supplies: vdda (3.3V), vddi (1.2V) and vddosc (1.8-3.3V).
Turn these on and off on start and stop calls.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
 drivers/usb/gadget/s3c-hsudc.c |   43 ++++++++++++++++++++++++++++++++++++---
 1 files changed, 39 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/gadget/s3c-hsudc.c b/drivers/usb/gadget/s3c-hsudc.c
index a47bfa0..584a80f 100644
--- a/drivers/usb/gadget/s3c-hsudc.c
+++ b/drivers/usb/gadget/s3c-hsudc.c
@@ -29,6 +29,7 @@
 #include <linux/usb/otg.h>
 #include <linux/prefetch.h>
 #include <linux/usb/s3c-hsudc.h>
+#include <linux/regulator/consumer.h>
 
 #include <mach/regs-s3c2443-clock.h>
 
@@ -87,6 +88,12 @@
 #define DATA_STATE_XMIT			(1)
 #define DATA_STATE_RECV			(2)
 
+static const char * const s3c_hsudc_supply_names[] = {
+	"vdda",		/* analog phy supply, 3.3V */
+	"vddi",		/* digital phy supply, 1.2V */
+	"vddosc",	/* oscillator supply, 1.8V - 3.3V */
+};
+
 /**
  * struct s3c_hsudc_ep - Endpoint representation used by driver.
  * @ep: USB gadget layer representation of device endpoint.
@@ -139,6 +146,7 @@ struct s3c_hsudc {
 	struct device *dev;
 	struct s3c24xx_hsudc_platdata *pd;
 	struct otg_transceiver *transceiver;
+	struct regulator_bulk_data supplies[ARRAY_SIZE(s3c_hsudc_supply_names)];
 	spinlock_t lock;
 	void __iomem *regs;
 	struct resource *mem_rsrc;
@@ -1150,15 +1158,20 @@ static int s3c_hsudc_start(struct usb_gadget *g,
 	hsudc->driver = driver;
 	hsudc->gadget.dev.driver = &driver->driver;
 
+	ret = regulator_bulk_enable(ARRAY_SIZE(hsudc->supplies),
+				    hsudc->supplies);
+	if (ret != 0) {
+		dev_err(hsudc->dev, "failed to enable supplies: %d\n", ret);
+		goto err_supplies;
+	}
+
 	/* connect to bus through transceiver */
 	if (hsudc->transceiver) {
 		ret = otg_set_peripheral(hsudc->transceiver, &hsudc->gadget);
 		if (ret) {
 			dev_err(hsudc->dev, "%s: can't bind to transceiver\n",
 					hsudc->gadget.name);
-			hsudc->driver = NULL;
-			hsudc->gadget.dev.driver = NULL;
-			return ret;
+			goto err_otg;
 		}
 	}
 
@@ -1171,6 +1184,12 @@ static int s3c_hsudc_start(struct usb_gadget *g,
 		hsudc->pd->gpio_init();
 
 	return 0;
+err_otg:
+	regulator_bulk_disable(ARRAY_SIZE(hsudc->supplies), hsudc->supplies);
+err_supplies:
+	hsudc->driver = NULL;
+	hsudc->gadget.dev.driver = NULL;
+	return ret;
 }
 
 static int s3c_hsudc_stop(struct usb_gadget *g,
@@ -1200,6 +1219,8 @@ static int s3c_hsudc_stop(struct usb_gadget *g,
 
 	disable_irq(hsudc->irq);
 
+	regulator_bulk_disable(ARRAY_SIZE(hsudc->supplies), hsudc->supplies);
+
 	dev_info(hsudc->dev, "unregistered gadget driver '%s'\n",
 			driver->driver.name);
 	return 0;
@@ -1248,7 +1269,7 @@ static int __devinit s3c_hsudc_probe(struct platform_device *pdev)
 	struct resource *res;
 	struct s3c_hsudc *hsudc;
 	struct s3c24xx_hsudc_platdata *pd = pdev->dev.platform_data;
-	int ret;
+	int ret, i;
 
 	hsudc = kzalloc(sizeof(struct s3c_hsudc) +
 			sizeof(struct s3c_hsudc_ep) * pd->epnum,
@@ -1265,6 +1286,16 @@ static int __devinit s3c_hsudc_probe(struct platform_device *pdev)
 
 	hsudc->transceiver = otg_get_transceiver();
 
+	for (i = 0; i < ARRAY_SIZE(hsudc->supplies); i++)
+		hsudc->supplies[i].supply = s3c_hsudc_supply_names[i];
+
+	ret = regulator_bulk_get(dev, ARRAY_SIZE(hsudc->supplies),
+				 hsudc->supplies);
+	if (ret != 0) {
+		dev_err(dev, "failed to request supplies: %d\n", ret);
+		goto err_supplies;
+	}
+
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (!res) {
 		dev_err(dev, "unable to obtain driver resource data\n");
@@ -1360,6 +1391,8 @@ err_res:
 	if (hsudc->transceiver)
 		otg_put_transceiver(hsudc->transceiver);
 
+	regulator_bulk_free(ARRAY_SIZE(hsudc->supplies), hsudc->supplies);
+err_supplies:
 	kfree(hsudc);
 	return ret;
 }
@@ -1382,6 +1415,8 @@ static int __devexit s3c_hsudc_remove(struct platform_device *pdev)
 	release_resource(hsudc->mem_rsrc);
 	kfree(hsudc->mem_rsrc);
 
+	regulator_bulk_free(ARRAY_SIZE(hsudc->supplies), hsudc->supplies);
+
 	if (hsudc->transceiver)
 		otg_put_transceiver(hsudc->transceiver);
 
-- 
1.7.2.3

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

* [PATCH 7/7] s3c-hsudc: Add regulator handling
@ 2011-12-17 19:30   ` Heiko Stübner
  0 siblings, 0 replies; 48+ messages in thread
From: Heiko Stübner @ 2011-12-17 19:30 UTC (permalink / raw)
  To: linux-arm-kernel

The udc has three supplies: vdda (3.3V), vddi (1.2V) and vddosc (1.8-3.3V).
Turn these on and off on start and stop calls.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
 drivers/usb/gadget/s3c-hsudc.c |   43 ++++++++++++++++++++++++++++++++++++---
 1 files changed, 39 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/gadget/s3c-hsudc.c b/drivers/usb/gadget/s3c-hsudc.c
index a47bfa0..584a80f 100644
--- a/drivers/usb/gadget/s3c-hsudc.c
+++ b/drivers/usb/gadget/s3c-hsudc.c
@@ -29,6 +29,7 @@
 #include <linux/usb/otg.h>
 #include <linux/prefetch.h>
 #include <linux/usb/s3c-hsudc.h>
+#include <linux/regulator/consumer.h>
 
 #include <mach/regs-s3c2443-clock.h>
 
@@ -87,6 +88,12 @@
 #define DATA_STATE_XMIT			(1)
 #define DATA_STATE_RECV			(2)
 
+static const char * const s3c_hsudc_supply_names[] = {
+	"vdda",		/* analog phy supply, 3.3V */
+	"vddi",		/* digital phy supply, 1.2V */
+	"vddosc",	/* oscillator supply, 1.8V - 3.3V */
+};
+
 /**
  * struct s3c_hsudc_ep - Endpoint representation used by driver.
  * @ep: USB gadget layer representation of device endpoint.
@@ -139,6 +146,7 @@ struct s3c_hsudc {
 	struct device *dev;
 	struct s3c24xx_hsudc_platdata *pd;
 	struct otg_transceiver *transceiver;
+	struct regulator_bulk_data supplies[ARRAY_SIZE(s3c_hsudc_supply_names)];
 	spinlock_t lock;
 	void __iomem *regs;
 	struct resource *mem_rsrc;
@@ -1150,15 +1158,20 @@ static int s3c_hsudc_start(struct usb_gadget *g,
 	hsudc->driver = driver;
 	hsudc->gadget.dev.driver = &driver->driver;
 
+	ret = regulator_bulk_enable(ARRAY_SIZE(hsudc->supplies),
+				    hsudc->supplies);
+	if (ret != 0) {
+		dev_err(hsudc->dev, "failed to enable supplies: %d\n", ret);
+		goto err_supplies;
+	}
+
 	/* connect to bus through transceiver */
 	if (hsudc->transceiver) {
 		ret = otg_set_peripheral(hsudc->transceiver, &hsudc->gadget);
 		if (ret) {
 			dev_err(hsudc->dev, "%s: can't bind to transceiver\n",
 					hsudc->gadget.name);
-			hsudc->driver = NULL;
-			hsudc->gadget.dev.driver = NULL;
-			return ret;
+			goto err_otg;
 		}
 	}
 
@@ -1171,6 +1184,12 @@ static int s3c_hsudc_start(struct usb_gadget *g,
 		hsudc->pd->gpio_init();
 
 	return 0;
+err_otg:
+	regulator_bulk_disable(ARRAY_SIZE(hsudc->supplies), hsudc->supplies);
+err_supplies:
+	hsudc->driver = NULL;
+	hsudc->gadget.dev.driver = NULL;
+	return ret;
 }
 
 static int s3c_hsudc_stop(struct usb_gadget *g,
@@ -1200,6 +1219,8 @@ static int s3c_hsudc_stop(struct usb_gadget *g,
 
 	disable_irq(hsudc->irq);
 
+	regulator_bulk_disable(ARRAY_SIZE(hsudc->supplies), hsudc->supplies);
+
 	dev_info(hsudc->dev, "unregistered gadget driver '%s'\n",
 			driver->driver.name);
 	return 0;
@@ -1248,7 +1269,7 @@ static int __devinit s3c_hsudc_probe(struct platform_device *pdev)
 	struct resource *res;
 	struct s3c_hsudc *hsudc;
 	struct s3c24xx_hsudc_platdata *pd = pdev->dev.platform_data;
-	int ret;
+	int ret, i;
 
 	hsudc = kzalloc(sizeof(struct s3c_hsudc) +
 			sizeof(struct s3c_hsudc_ep) * pd->epnum,
@@ -1265,6 +1286,16 @@ static int __devinit s3c_hsudc_probe(struct platform_device *pdev)
 
 	hsudc->transceiver = otg_get_transceiver();
 
+	for (i = 0; i < ARRAY_SIZE(hsudc->supplies); i++)
+		hsudc->supplies[i].supply = s3c_hsudc_supply_names[i];
+
+	ret = regulator_bulk_get(dev, ARRAY_SIZE(hsudc->supplies),
+				 hsudc->supplies);
+	if (ret != 0) {
+		dev_err(dev, "failed to request supplies: %d\n", ret);
+		goto err_supplies;
+	}
+
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (!res) {
 		dev_err(dev, "unable to obtain driver resource data\n");
@@ -1360,6 +1391,8 @@ err_res:
 	if (hsudc->transceiver)
 		otg_put_transceiver(hsudc->transceiver);
 
+	regulator_bulk_free(ARRAY_SIZE(hsudc->supplies), hsudc->supplies);
+err_supplies:
 	kfree(hsudc);
 	return ret;
 }
@@ -1382,6 +1415,8 @@ static int __devexit s3c_hsudc_remove(struct platform_device *pdev)
 	release_resource(hsudc->mem_rsrc);
 	kfree(hsudc->mem_rsrc);
 
+	regulator_bulk_free(ARRAY_SIZE(hsudc->supplies), hsudc->supplies);
+
 	if (hsudc->transceiver)
 		otg_put_transceiver(hsudc->transceiver);
 
-- 
1.7.2.3

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

* Re: [PATCH 3/7] s3c-hsudc: add a remove function
  2011-12-17 19:26   ` Heiko Stübner
@ 2011-12-18  8:03     ` Russell King - ARM Linux
  -1 siblings, 0 replies; 48+ messages in thread
From: Russell King - ARM Linux @ 2011-12-18  8:03 UTC (permalink / raw)
  To: Heiko Stübner
  Cc: Felipe Balbi, Kukjin Kim, linux-samsung-soc, linux-usb,
	Thomas Abraham, linux-arm-kernel

On Sat, Dec 17, 2011 at 08:26:33PM +0100, Heiko Stübner wrote:
> +	release_resource(hsudc->mem_rsrc);
> +	kfree(hsudc->mem_rsrc);

release_mem_region() is paired with request_mem_region.  Do not go beneath
the API by doing the above.

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

* [PATCH 3/7] s3c-hsudc: add a remove function
@ 2011-12-18  8:03     ` Russell King - ARM Linux
  0 siblings, 0 replies; 48+ messages in thread
From: Russell King - ARM Linux @ 2011-12-18  8:03 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, Dec 17, 2011 at 08:26:33PM +0100, Heiko St?bner wrote:
> +	release_resource(hsudc->mem_rsrc);
> +	kfree(hsudc->mem_rsrc);

release_mem_region() is paired with request_mem_region.  Do not go beneath
the API by doing the above.

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

* Re: [PATCH 5/7] s3c-hsudc: move device registration to probe and remove
  2011-12-17 19:28   ` Heiko Stübner
@ 2011-12-18  8:09     ` Russell King - ARM Linux
  -1 siblings, 0 replies; 48+ messages in thread
From: Russell King - ARM Linux @ 2011-12-18  8:09 UTC (permalink / raw)
  To: Heiko Stübner, Greg KH
  Cc: Felipe Balbi, Kukjin Kim, linux-samsung-soc, linux-usb,
	Thomas Abraham, linux-arm-kernel

On Sat, Dec 17, 2011 at 08:28:34PM +0100, Heiko Stübner wrote:
> Instead of adding and deleting the gadget device in the start and stop
> invocations. Use device_register in the probe method to initialize
> and add the gadget device and unregister it in the remove function.
> 
> This also requires a release function for the gadget device.

Ouch.  This is a sure sign that your code is broken.  The lifetime of a
device structure is rather indeterminant, and modules should not contain
release functions for these.

> Signed-off-by: Heiko Stuebner <heiko@sntech.de>
> ---
>  drivers/usb/gadget/s3c-hsudc.c |   27 ++++++++++++++++++---------
>  1 files changed, 18 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/usb/gadget/s3c-hsudc.c b/drivers/usb/gadget/s3c-hsudc.c
> index 06ca8c4..fa2ae7a 100644
> --- a/drivers/usb/gadget/s3c-hsudc.c
> +++ b/drivers/usb/gadget/s3c-hsudc.c
> @@ -1156,11 +1156,6 @@ static int s3c_hsudc_start(struct usb_gadget_driver *driver,
>  	hsudc->driver = driver;
>  	hsudc->gadget.dev.driver = &driver->driver;
>  	hsudc->gadget.speed = USB_SPEED_UNKNOWN;
> -	ret = device_add(&hsudc->gadget.dev);
> -	if (ret) {
> -		dev_err(hsudc->dev, "failed to probe gadget device");
> -		return ret;
> -	}
>  
>  	ret = bind(&hsudc->gadget);
>  	if (ret) {
> @@ -1180,8 +1175,6 @@ static int s3c_hsudc_start(struct usb_gadget_driver *driver,
>  					hsudc->gadget.name);
>  			driver->unbind(&hsudc->gadget);
>  
> -			device_del(&hsudc->gadget.dev);
> -
>  			hsudc->driver = NULL;
>  			hsudc->gadget.dev.driver = NULL;
>  			return ret;
> @@ -1222,7 +1215,6 @@ static int s3c_hsudc_stop(struct usb_gadget_driver *driver)
>  		(void) otg_set_peripheral(hsudc->transceiver, NULL);
>  
>  	driver->unbind(&hsudc->gadget);
> -	device_del(&hsudc->gadget.dev);
>  	disable_irq(hsudc->irq);
>  
>  	dev_info(hsudc->dev, "unregistered gadget driver '%s'\n",
> @@ -1260,6 +1252,13 @@ static struct usb_gadget_ops s3c_hsudc_gadget_ops = {
>  	.vbus_draw	= s3c_hsudc_vbus_draw,
>  };
>  
> +/* The gadget structure is stored inside the hsudc structure and will be
> + * released along with it. */
> +static void s3c_hsudc_gadget_release(struct device *dev)
> +{
> +	return;
> +}
> +
>  static int __devinit s3c_hsudc_probe(struct platform_device *pdev)
>  {
>  	struct device *dev = &pdev->dev;
> @@ -1307,7 +1306,6 @@ static int __devinit s3c_hsudc_probe(struct platform_device *pdev)
>  
>  	spin_lock_init(&hsudc->lock);
>  
> -	device_initialize(&hsudc->gadget.dev);
>  	dev_set_name(&hsudc->gadget.dev, "gadget");
>  
>  	hsudc->gadget.max_speed = USB_SPEED_HIGH;
> @@ -1315,6 +1313,7 @@ static int __devinit s3c_hsudc_probe(struct platform_device *pdev)
>  	hsudc->gadget.name = dev_name(dev);
>  	hsudc->gadget.dev.parent = dev;
>  	hsudc->gadget.dev.dma_mask = dev->dma_mask;
> +	hsudc->gadget.dev.release = s3c_hsudc_gadget_release;
>  	hsudc->gadget.ep0 = &hsudc->ep[0].ep;
>  
>  	hsudc->gadget.is_otg = 0;
> @@ -1348,12 +1347,20 @@ static int __devinit s3c_hsudc_probe(struct platform_device *pdev)
>  	disable_irq(hsudc->irq);
>  	local_irq_enable();
>  
> +	ret = device_register(&hsudc->gadget.dev);
> +	if (ret) {
> +		put_device(&hsudc->gadget.dev);
> +		goto err_add_device;
> +	}
> +
>  	ret = usb_add_gadget_udc(&pdev->dev, &hsudc->gadget);
>  	if (ret)
>  		goto err_add_udc;
>  
>  	return 0;
>  err_add_udc:
> +	device_unregister(&hsudc->gadget.dev);
> +err_add_device:
>  	clk_disable(hsudc->uclk);
>  	clk_put(hsudc->uclk);
>  err_clk:
> @@ -1379,6 +1386,8 @@ static int __devexit s3c_hsudc_remove(struct platform_device *pdev)
>  
>  	usb_del_gadget_udc(&hsudc->gadget);
>  
> +	device_unregister(&hsudc->gadget.dev);
> +
>  	clk_disable(hsudc->uclk);
>  	clk_put(hsudc->uclk);
>  
> -- 
> 1.7.2.3
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 5/7] s3c-hsudc: move device registration to probe and remove
@ 2011-12-18  8:09     ` Russell King - ARM Linux
  0 siblings, 0 replies; 48+ messages in thread
From: Russell King - ARM Linux @ 2011-12-18  8:09 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, Dec 17, 2011 at 08:28:34PM +0100, Heiko St?bner wrote:
> Instead of adding and deleting the gadget device in the start and stop
> invocations. Use device_register in the probe method to initialize
> and add the gadget device and unregister it in the remove function.
> 
> This also requires a release function for the gadget device.

Ouch.  This is a sure sign that your code is broken.  The lifetime of a
device structure is rather indeterminant, and modules should not contain
release functions for these.

> Signed-off-by: Heiko Stuebner <heiko@sntech.de>
> ---
>  drivers/usb/gadget/s3c-hsudc.c |   27 ++++++++++++++++++---------
>  1 files changed, 18 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/usb/gadget/s3c-hsudc.c b/drivers/usb/gadget/s3c-hsudc.c
> index 06ca8c4..fa2ae7a 100644
> --- a/drivers/usb/gadget/s3c-hsudc.c
> +++ b/drivers/usb/gadget/s3c-hsudc.c
> @@ -1156,11 +1156,6 @@ static int s3c_hsudc_start(struct usb_gadget_driver *driver,
>  	hsudc->driver = driver;
>  	hsudc->gadget.dev.driver = &driver->driver;
>  	hsudc->gadget.speed = USB_SPEED_UNKNOWN;
> -	ret = device_add(&hsudc->gadget.dev);
> -	if (ret) {
> -		dev_err(hsudc->dev, "failed to probe gadget device");
> -		return ret;
> -	}
>  
>  	ret = bind(&hsudc->gadget);
>  	if (ret) {
> @@ -1180,8 +1175,6 @@ static int s3c_hsudc_start(struct usb_gadget_driver *driver,
>  					hsudc->gadget.name);
>  			driver->unbind(&hsudc->gadget);
>  
> -			device_del(&hsudc->gadget.dev);
> -
>  			hsudc->driver = NULL;
>  			hsudc->gadget.dev.driver = NULL;
>  			return ret;
> @@ -1222,7 +1215,6 @@ static int s3c_hsudc_stop(struct usb_gadget_driver *driver)
>  		(void) otg_set_peripheral(hsudc->transceiver, NULL);
>  
>  	driver->unbind(&hsudc->gadget);
> -	device_del(&hsudc->gadget.dev);
>  	disable_irq(hsudc->irq);
>  
>  	dev_info(hsudc->dev, "unregistered gadget driver '%s'\n",
> @@ -1260,6 +1252,13 @@ static struct usb_gadget_ops s3c_hsudc_gadget_ops = {
>  	.vbus_draw	= s3c_hsudc_vbus_draw,
>  };
>  
> +/* The gadget structure is stored inside the hsudc structure and will be
> + * released along with it. */
> +static void s3c_hsudc_gadget_release(struct device *dev)
> +{
> +	return;
> +}
> +
>  static int __devinit s3c_hsudc_probe(struct platform_device *pdev)
>  {
>  	struct device *dev = &pdev->dev;
> @@ -1307,7 +1306,6 @@ static int __devinit s3c_hsudc_probe(struct platform_device *pdev)
>  
>  	spin_lock_init(&hsudc->lock);
>  
> -	device_initialize(&hsudc->gadget.dev);
>  	dev_set_name(&hsudc->gadget.dev, "gadget");
>  
>  	hsudc->gadget.max_speed = USB_SPEED_HIGH;
> @@ -1315,6 +1313,7 @@ static int __devinit s3c_hsudc_probe(struct platform_device *pdev)
>  	hsudc->gadget.name = dev_name(dev);
>  	hsudc->gadget.dev.parent = dev;
>  	hsudc->gadget.dev.dma_mask = dev->dma_mask;
> +	hsudc->gadget.dev.release = s3c_hsudc_gadget_release;
>  	hsudc->gadget.ep0 = &hsudc->ep[0].ep;
>  
>  	hsudc->gadget.is_otg = 0;
> @@ -1348,12 +1347,20 @@ static int __devinit s3c_hsudc_probe(struct platform_device *pdev)
>  	disable_irq(hsudc->irq);
>  	local_irq_enable();
>  
> +	ret = device_register(&hsudc->gadget.dev);
> +	if (ret) {
> +		put_device(&hsudc->gadget.dev);
> +		goto err_add_device;
> +	}
> +
>  	ret = usb_add_gadget_udc(&pdev->dev, &hsudc->gadget);
>  	if (ret)
>  		goto err_add_udc;
>  
>  	return 0;
>  err_add_udc:
> +	device_unregister(&hsudc->gadget.dev);
> +err_add_device:
>  	clk_disable(hsudc->uclk);
>  	clk_put(hsudc->uclk);
>  err_clk:
> @@ -1379,6 +1386,8 @@ static int __devexit s3c_hsudc_remove(struct platform_device *pdev)
>  
>  	usb_del_gadget_udc(&hsudc->gadget);
>  
> +	device_unregister(&hsudc->gadget.dev);
> +
>  	clk_disable(hsudc->uclk);
>  	clk_put(hsudc->uclk);
>  
> -- 
> 1.7.2.3
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 3/7] s3c-hsudc: add a remove function
  2011-12-17 19:26   ` Heiko Stübner
@ 2011-12-18  8:10     ` Russell King - ARM Linux
  -1 siblings, 0 replies; 48+ messages in thread
From: Russell King - ARM Linux @ 2011-12-18  8:10 UTC (permalink / raw)
  To: Heiko Stübner, Greg KH
  Cc: Felipe Balbi, Kukjin Kim, linux-samsung-soc, linux-usb,
	Thomas Abraham, linux-arm-kernel

On Sat, Dec 17, 2011 at 08:26:33PM +0100, Heiko Stübner wrote:
> As the driver is also buildable as a module it should need
> a cleanup function for the removal of the module.

My guess is that this wasn't implemented because of the embedded struct
device lifetime rules for the gadget - to prevent the unbinding of the
driver.

Until the struct device lifetime gets fixed, you must not allow the module
nor the data structure containing the struct device to be freed.

> Signed-off-by: Heiko Stuebner <heiko@sntech.de>
> ---
>  drivers/usb/gadget/s3c-hsudc.c |   25 +++++++++++++++++++++++++
>  1 files changed, 25 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/usb/gadget/s3c-hsudc.c b/drivers/usb/gadget/s3c-hsudc.c
> index 3e5673d..7cb0850 100644
> --- a/drivers/usb/gadget/s3c-hsudc.c
> +++ b/drivers/usb/gadget/s3c-hsudc.c
> @@ -1370,12 +1370,37 @@ err_res:
>  	return ret;
>  }
>  
> +static int __devexit s3c_hsudc_remove(struct platform_device *pdev)
> +{
> +	struct s3c_hsudc *hsudc = the_controller;
> +
> +	usb_del_gadget_udc(&hsudc->gadget);
> +
> +	clk_disable(hsudc->uclk);
> +	clk_put(hsudc->uclk);
> +
> +	free_irq(hsudc->irq, hsudc);
> +
> +	iounmap(hsudc->regs);
> +
> +	release_resource(hsudc->mem_rsrc);
> +	kfree(hsudc->mem_rsrc);
> +
> +	if (hsudc->transceiver)
> +		otg_put_transceiver(hsudc->transceiver);
> +
> +	the_controller = NULL;
> +	kfree(hsudc);
> +	return 0;
> +}
> +
>  static struct platform_driver s3c_hsudc_driver = {
>  	.driver		= {
>  		.owner	= THIS_MODULE,
>  		.name	= "s3c-hsudc",
>  	},
>  	.probe		= s3c_hsudc_probe,
> +	.remove		= __devexit_p(s3c_hsudc_remove),
>  };
>  
>  module_platform_driver(s3c_hsudc_driver);
> -- 
> 1.7.2.3
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 3/7] s3c-hsudc: add a remove function
@ 2011-12-18  8:10     ` Russell King - ARM Linux
  0 siblings, 0 replies; 48+ messages in thread
From: Russell King - ARM Linux @ 2011-12-18  8:10 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, Dec 17, 2011 at 08:26:33PM +0100, Heiko St?bner wrote:
> As the driver is also buildable as a module it should need
> a cleanup function for the removal of the module.

My guess is that this wasn't implemented because of the embedded struct
device lifetime rules for the gadget - to prevent the unbinding of the
driver.

Until the struct device lifetime gets fixed, you must not allow the module
nor the data structure containing the struct device to be freed.

> Signed-off-by: Heiko Stuebner <heiko@sntech.de>
> ---
>  drivers/usb/gadget/s3c-hsudc.c |   25 +++++++++++++++++++++++++
>  1 files changed, 25 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/usb/gadget/s3c-hsudc.c b/drivers/usb/gadget/s3c-hsudc.c
> index 3e5673d..7cb0850 100644
> --- a/drivers/usb/gadget/s3c-hsudc.c
> +++ b/drivers/usb/gadget/s3c-hsudc.c
> @@ -1370,12 +1370,37 @@ err_res:
>  	return ret;
>  }
>  
> +static int __devexit s3c_hsudc_remove(struct platform_device *pdev)
> +{
> +	struct s3c_hsudc *hsudc = the_controller;
> +
> +	usb_del_gadget_udc(&hsudc->gadget);
> +
> +	clk_disable(hsudc->uclk);
> +	clk_put(hsudc->uclk);
> +
> +	free_irq(hsudc->irq, hsudc);
> +
> +	iounmap(hsudc->regs);
> +
> +	release_resource(hsudc->mem_rsrc);
> +	kfree(hsudc->mem_rsrc);
> +
> +	if (hsudc->transceiver)
> +		otg_put_transceiver(hsudc->transceiver);
> +
> +	the_controller = NULL;
> +	kfree(hsudc);
> +	return 0;
> +}
> +
>  static struct platform_driver s3c_hsudc_driver = {
>  	.driver		= {
>  		.owner	= THIS_MODULE,
>  		.name	= "s3c-hsudc",
>  	},
>  	.probe		= s3c_hsudc_probe,
> +	.remove		= __devexit_p(s3c_hsudc_remove),
>  };
>  
>  module_platform_driver(s3c_hsudc_driver);
> -- 
> 1.7.2.3
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 3/7] s3c-hsudc: add a remove function
  2011-12-18  8:10     ` Russell King - ARM Linux
@ 2011-12-18  9:42       ` Heiko Stübner
  -1 siblings, 0 replies; 48+ messages in thread
From: Heiko Stübner @ 2011-12-18  9:42 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: Greg KH, Felipe Balbi, Kukjin Kim, linux-samsung-soc, linux-usb,
	Thomas Abraham, linux-arm-kernel

Am Sonntag 18 Dezember 2011, 09:10:48 schrieb Russell King - ARM Linux:
> On Sat, Dec 17, 2011 at 08:26:33PM +0100, Heiko Stübner wrote:
> > As the driver is also buildable as a module it should need
> > a cleanup function for the removal of the module.
> 
> My guess is that this wasn't implemented because of the embedded struct
> device lifetime rules for the gadget - to prevent the unbinding of the
> driver.
> 
> Until the struct device lifetime gets fixed, you must not allow the module
> nor the data structure containing the struct device to be freed.
so essentially, this patch and the release stuff in 5/7 must go.

Thanks for pointing out this problem.


> > Signed-off-by: Heiko Stuebner <heiko@sntech.de>
> > ---
> > 
> >  drivers/usb/gadget/s3c-hsudc.c |   25 +++++++++++++++++++++++++
> >  1 files changed, 25 insertions(+), 0 deletions(-)
> > 
> > diff --git a/drivers/usb/gadget/s3c-hsudc.c
> > b/drivers/usb/gadget/s3c-hsudc.c index 3e5673d..7cb0850 100644
> > --- a/drivers/usb/gadget/s3c-hsudc.c
> > +++ b/drivers/usb/gadget/s3c-hsudc.c
> > 
> > @@ -1370,12 +1370,37 @@ err_res:
> >  	return ret;
> >  
> >  }
> > 
> > +static int __devexit s3c_hsudc_remove(struct platform_device *pdev)
> > +{
> > +	struct s3c_hsudc *hsudc = the_controller;
> > +
> > +	usb_del_gadget_udc(&hsudc->gadget);
> > +
> > +	clk_disable(hsudc->uclk);
> > +	clk_put(hsudc->uclk);
> > +
> > +	free_irq(hsudc->irq, hsudc);
> > +
> > +	iounmap(hsudc->regs);
> > +
> > +	release_resource(hsudc->mem_rsrc);
> > +	kfree(hsudc->mem_rsrc);
> > +
> > +	if (hsudc->transceiver)
> > +		otg_put_transceiver(hsudc->transceiver);
> > +
> > +	the_controller = NULL;
> > +	kfree(hsudc);
> > +	return 0;
> > +}
> > +
> > 
> >  static struct platform_driver s3c_hsudc_driver = {
> >  
> >  	.driver		= {
> >  	
> >  		.owner	= THIS_MODULE,
> >  		.name	= "s3c-hsudc",
> >  	
> >  	},
> >  	.probe		= s3c_hsudc_probe,
> > 
> > +	.remove		= __devexit_p(s3c_hsudc_remove),
> > 
> >  };
> >  
> >  module_platform_driver(s3c_hsudc_driver);

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

* [PATCH 3/7] s3c-hsudc: add a remove function
@ 2011-12-18  9:42       ` Heiko Stübner
  0 siblings, 0 replies; 48+ messages in thread
From: Heiko Stübner @ 2011-12-18  9:42 UTC (permalink / raw)
  To: linux-arm-kernel

Am Sonntag 18 Dezember 2011, 09:10:48 schrieb Russell King - ARM Linux:
> On Sat, Dec 17, 2011 at 08:26:33PM +0100, Heiko St?bner wrote:
> > As the driver is also buildable as a module it should need
> > a cleanup function for the removal of the module.
> 
> My guess is that this wasn't implemented because of the embedded struct
> device lifetime rules for the gadget - to prevent the unbinding of the
> driver.
> 
> Until the struct device lifetime gets fixed, you must not allow the module
> nor the data structure containing the struct device to be freed.
so essentially, this patch and the release stuff in 5/7 must go.

Thanks for pointing out this problem.


> > Signed-off-by: Heiko Stuebner <heiko@sntech.de>
> > ---
> > 
> >  drivers/usb/gadget/s3c-hsudc.c |   25 +++++++++++++++++++++++++
> >  1 files changed, 25 insertions(+), 0 deletions(-)
> > 
> > diff --git a/drivers/usb/gadget/s3c-hsudc.c
> > b/drivers/usb/gadget/s3c-hsudc.c index 3e5673d..7cb0850 100644
> > --- a/drivers/usb/gadget/s3c-hsudc.c
> > +++ b/drivers/usb/gadget/s3c-hsudc.c
> > 
> > @@ -1370,12 +1370,37 @@ err_res:
> >  	return ret;
> >  
> >  }
> > 
> > +static int __devexit s3c_hsudc_remove(struct platform_device *pdev)
> > +{
> > +	struct s3c_hsudc *hsudc = the_controller;
> > +
> > +	usb_del_gadget_udc(&hsudc->gadget);
> > +
> > +	clk_disable(hsudc->uclk);
> > +	clk_put(hsudc->uclk);
> > +
> > +	free_irq(hsudc->irq, hsudc);
> > +
> > +	iounmap(hsudc->regs);
> > +
> > +	release_resource(hsudc->mem_rsrc);
> > +	kfree(hsudc->mem_rsrc);
> > +
> > +	if (hsudc->transceiver)
> > +		otg_put_transceiver(hsudc->transceiver);
> > +
> > +	the_controller = NULL;
> > +	kfree(hsudc);
> > +	return 0;
> > +}
> > +
> > 
> >  static struct platform_driver s3c_hsudc_driver = {
> >  
> >  	.driver		= {
> >  	
> >  		.owner	= THIS_MODULE,
> >  		.name	= "s3c-hsudc",
> >  	
> >  	},
> >  	.probe		= s3c_hsudc_probe,
> > 
> > +	.remove		= __devexit_p(s3c_hsudc_remove),
> > 
> >  };
> >  
> >  module_platform_driver(s3c_hsudc_driver);

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

* Re: [PATCH 3/7] s3c-hsudc: add a remove function
  2011-12-18  8:10     ` Russell King - ARM Linux
@ 2011-12-18 13:44       ` Heiko Stübner
  -1 siblings, 0 replies; 48+ messages in thread
From: Heiko Stübner @ 2011-12-18 13:44 UTC (permalink / raw)
  To: Russell King - ARM Linux, Greg KH, Felipe Balbi
  Cc: Kukjin Kim, linux-samsung-soc, linux-usb, Thomas Abraham,
	linux-arm-kernel

Am Sonntag 18 Dezember 2011, 09:10:48 schrieb Russell King - ARM Linux:
> On Sat, Dec 17, 2011 at 08:26:33PM +0100, Heiko Stübner wrote:
> > As the driver is also buildable as a module it should need
> > a cleanup function for the removal of the module.
> 
> My guess is that this wasn't implemented because of the embedded struct
> device lifetime rules for the gadget - to prevent the unbinding of the
> driver.
> 
> Until the struct device lifetime gets fixed, you must not allow the module
> nor the data structure containing the struct device to be freed.

I understand where this problem comes from (the release method is potentially 
gone with the module before it is called) but after more reading, I have a 
hard time believing that a lot of the other gadget drivers would be wrong as 
well. Some of them since 2009 or possibly earlier.

Gadgets with embedded release methods: langwell_udc, goku_udc, fsl_qe_udc (and 
fsl_udc_core), amd5536udc, net2280, pch_udc, cil13xxx_udc, dummy_hcd, 
omap_udc, net2272, mc_udc_core

Gadgets which use the release method from its pdev->dev but also free the 
struct with the gadget in their remove method: r8a66597-udc, m66592-udc, 
fusb300_udc. (possibly before the release function is called)

On the other hand, the gets and puts of the udc->gadget.dev should be paired 
correctly and it's only an intermediate device between the udc and the gadget 
driver, so that the call to device_unregister in the remove method should put 
the refcount to 0 and thus init the cleanup (including the call to release) 
before the module is removed.

So, I am very confused :-).

Heiko


> > Signed-off-by: Heiko Stuebner <heiko@sntech.de>
> > ---
> > 
> >  drivers/usb/gadget/s3c-hsudc.c |   25 +++++++++++++++++++++++++
> >  1 files changed, 25 insertions(+), 0 deletions(-)
> > 
> > diff --git a/drivers/usb/gadget/s3c-hsudc.c
> > b/drivers/usb/gadget/s3c-hsudc.c index 3e5673d..7cb0850 100644
> > --- a/drivers/usb/gadget/s3c-hsudc.c
> > +++ b/drivers/usb/gadget/s3c-hsudc.c
> > 
> > @@ -1370,12 +1370,37 @@ err_res:
> >  	return ret;
> >  
> >  }
> > 
> > +static int __devexit s3c_hsudc_remove(struct platform_device *pdev)
> > +{
> > +	struct s3c_hsudc *hsudc = the_controller;
> > +
> > +	usb_del_gadget_udc(&hsudc->gadget);
> > +
> > +	clk_disable(hsudc->uclk);
> > +	clk_put(hsudc->uclk);
> > +
> > +	free_irq(hsudc->irq, hsudc);
> > +
> > +	iounmap(hsudc->regs);
> > +
> > +	release_resource(hsudc->mem_rsrc);
> > +	kfree(hsudc->mem_rsrc);
> > +
> > +	if (hsudc->transceiver)
> > +		otg_put_transceiver(hsudc->transceiver);
> > +
> > +	the_controller = NULL;
> > +	kfree(hsudc);
> > +	return 0;
> > +}
> > +
> > 
> >  static struct platform_driver s3c_hsudc_driver = {
> >  
> >  	.driver		= {
> >  	
> >  		.owner	= THIS_MODULE,
> >  		.name	= "s3c-hsudc",
> >  	
> >  	},
> >  	.probe		= s3c_hsudc_probe,
> > 
> > +	.remove		= __devexit_p(s3c_hsudc_remove),
> > 
> >  };
> >  
> >  module_platform_driver(s3c_hsudc_driver);

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

* [PATCH 3/7] s3c-hsudc: add a remove function
@ 2011-12-18 13:44       ` Heiko Stübner
  0 siblings, 0 replies; 48+ messages in thread
From: Heiko Stübner @ 2011-12-18 13:44 UTC (permalink / raw)
  To: linux-arm-kernel

Am Sonntag 18 Dezember 2011, 09:10:48 schrieb Russell King - ARM Linux:
> On Sat, Dec 17, 2011 at 08:26:33PM +0100, Heiko St?bner wrote:
> > As the driver is also buildable as a module it should need
> > a cleanup function for the removal of the module.
> 
> My guess is that this wasn't implemented because of the embedded struct
> device lifetime rules for the gadget - to prevent the unbinding of the
> driver.
> 
> Until the struct device lifetime gets fixed, you must not allow the module
> nor the data structure containing the struct device to be freed.

I understand where this problem comes from (the release method is potentially 
gone with the module before it is called) but after more reading, I have a 
hard time believing that a lot of the other gadget drivers would be wrong as 
well. Some of them since 2009 or possibly earlier.

Gadgets with embedded release methods: langwell_udc, goku_udc, fsl_qe_udc (and 
fsl_udc_core), amd5536udc, net2280, pch_udc, cil13xxx_udc, dummy_hcd, 
omap_udc, net2272, mc_udc_core

Gadgets which use the release method from its pdev->dev but also free the 
struct with the gadget in their remove method: r8a66597-udc, m66592-udc, 
fusb300_udc. (possibly before the release function is called)

On the other hand, the gets and puts of the udc->gadget.dev should be paired 
correctly and it's only an intermediate device between the udc and the gadget 
driver, so that the call to device_unregister in the remove method should put 
the refcount to 0 and thus init the cleanup (including the call to release) 
before the module is removed.

So, I am very confused :-).

Heiko


> > Signed-off-by: Heiko Stuebner <heiko@sntech.de>
> > ---
> > 
> >  drivers/usb/gadget/s3c-hsudc.c |   25 +++++++++++++++++++++++++
> >  1 files changed, 25 insertions(+), 0 deletions(-)
> > 
> > diff --git a/drivers/usb/gadget/s3c-hsudc.c
> > b/drivers/usb/gadget/s3c-hsudc.c index 3e5673d..7cb0850 100644
> > --- a/drivers/usb/gadget/s3c-hsudc.c
> > +++ b/drivers/usb/gadget/s3c-hsudc.c
> > 
> > @@ -1370,12 +1370,37 @@ err_res:
> >  	return ret;
> >  
> >  }
> > 
> > +static int __devexit s3c_hsudc_remove(struct platform_device *pdev)
> > +{
> > +	struct s3c_hsudc *hsudc = the_controller;
> > +
> > +	usb_del_gadget_udc(&hsudc->gadget);
> > +
> > +	clk_disable(hsudc->uclk);
> > +	clk_put(hsudc->uclk);
> > +
> > +	free_irq(hsudc->irq, hsudc);
> > +
> > +	iounmap(hsudc->regs);
> > +
> > +	release_resource(hsudc->mem_rsrc);
> > +	kfree(hsudc->mem_rsrc);
> > +
> > +	if (hsudc->transceiver)
> > +		otg_put_transceiver(hsudc->transceiver);
> > +
> > +	the_controller = NULL;
> > +	kfree(hsudc);
> > +	return 0;
> > +}
> > +
> > 
> >  static struct platform_driver s3c_hsudc_driver = {
> >  
> >  	.driver		= {
> >  	
> >  		.owner	= THIS_MODULE,
> >  		.name	= "s3c-hsudc",
> >  	
> >  	},
> >  	.probe		= s3c_hsudc_probe,
> > 
> > +	.remove		= __devexit_p(s3c_hsudc_remove),
> > 
> >  };
> >  
> >  module_platform_driver(s3c_hsudc_driver);

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

* Re: [PATCH 3/7] s3c-hsudc: add a remove function
  2011-12-18 13:44       ` Heiko Stübner
@ 2011-12-18 14:43         ` Russell King - ARM Linux
  -1 siblings, 0 replies; 48+ messages in thread
From: Russell King - ARM Linux @ 2011-12-18 14:43 UTC (permalink / raw)
  To: Heiko Stübner
  Cc: Greg KH, Felipe Balbi, Kukjin Kim, linux-samsung-soc, linux-usb,
	Thomas Abraham, linux-arm-kernel

On Sun, Dec 18, 2011 at 02:44:39PM +0100, Heiko Stübner wrote:
> Am Sonntag 18 Dezember 2011, 09:10:48 schrieb Russell King - ARM Linux:
> > On Sat, Dec 17, 2011 at 08:26:33PM +0100, Heiko Stübner wrote:
> > > As the driver is also buildable as a module it should need
> > > a cleanup function for the removal of the module.
> > 
> > My guess is that this wasn't implemented because of the embedded struct
> > device lifetime rules for the gadget - to prevent the unbinding of the
> > driver.
> > 
> > Until the struct device lifetime gets fixed, you must not allow the module
> > nor the data structure containing the struct device to be freed.
> 
> I understand where this problem comes from (the release method is potentially 
> gone with the module before it is called) but after more reading, I have a 
> hard time believing that a lot of the other gadget drivers would be wrong as 
> well. Some of them since 2009 or possibly earlier.
> 
> Gadgets with embedded release methods: langwell_udc, goku_udc, fsl_qe_udc (and 
> fsl_udc_core), amd5536udc, net2280, pch_udc, cil13xxx_udc, dummy_hcd, 
> omap_udc, net2272, mc_udc_core
> 
> Gadgets which use the release method from its pdev->dev but also free the 
> struct with the gadget in their remove method: r8a66597-udc, m66592-udc, 
> fusb300_udc. (possibly before the release function is called)
> 
> On the other hand, the gets and puts of the udc->gadget.dev should be paired 
> correctly and it's only an intermediate device between the udc and the gadget 
> driver, so that the call to device_unregister in the remove method should put 
> the refcount to 0 and thus init the cleanup (including the call to release) 
> before the module is removed.
> 
> So, I am very confused :-).

Try this patch.  If your system oopses 5 seconds after you remove the
module, you have a lifetime bug.

diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index ad81e1c..be1c97a 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -26,6 +26,9 @@
 #include <linux/kernel.h>
 #include <linux/wait.h>
 #include <linux/atomic.h>
+#include <linux/workqueue.h>
+
+#define KOBJECT_DEBUG_RELEASE
 
 #define UEVENT_HELPER_PATH_LEN		256
 #define UEVENT_NUM_ENVP			32	/* number of env pointers */
@@ -65,6 +68,9 @@ struct kobject {
 	struct kobj_type	*ktype;
 	struct sysfs_dirent	*sd;
 	struct kref		kref;
+#ifdef KOBJECT_DEBUG_RELEASE
+	struct delayed_work	release;
+#endif
 	unsigned int state_initialized:1;
 	unsigned int state_in_sysfs:1;
 	unsigned int state_add_uevent_sent:1;
diff --git a/lib/kobject.c b/lib/kobject.c
index 640bd98..fe57f3a 100644
--- a/lib/kobject.c
+++ b/lib/kobject.c
@@ -575,9 +575,23 @@ static void kobject_cleanup(struct kobject *kobj)
 	}
 }
 
+#ifdef KOBJECT_DEBUG_RELEASE
+static void kobject_delayed_cleanup(struct work_struct *work)
+{
+	kobject_cleanup(container_of(to_delayed_work(work),
+				     struct kobject, release));
+}
+#endif
+
 static void kobject_release(struct kref *kref)
 {
-	kobject_cleanup(container_of(kref, struct kobject, kref));
+	struct kobject *kobj = container_of(kref, struct kobject, kref);
+#ifdef KOBJECT_DEBUG_RELEASE
+	INIT_DELAYED_WORK(&kobj->release, kobject_delayed_cleanup);
+	schedule_delayed_work(&kobj->release, 5 * HZ);
+#else
+	kobject_cleanup(kobj);
+#endif
 }
 
 /**

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

* [PATCH 3/7] s3c-hsudc: add a remove function
@ 2011-12-18 14:43         ` Russell King - ARM Linux
  0 siblings, 0 replies; 48+ messages in thread
From: Russell King - ARM Linux @ 2011-12-18 14:43 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, Dec 18, 2011 at 02:44:39PM +0100, Heiko St?bner wrote:
> Am Sonntag 18 Dezember 2011, 09:10:48 schrieb Russell King - ARM Linux:
> > On Sat, Dec 17, 2011 at 08:26:33PM +0100, Heiko St?bner wrote:
> > > As the driver is also buildable as a module it should need
> > > a cleanup function for the removal of the module.
> > 
> > My guess is that this wasn't implemented because of the embedded struct
> > device lifetime rules for the gadget - to prevent the unbinding of the
> > driver.
> > 
> > Until the struct device lifetime gets fixed, you must not allow the module
> > nor the data structure containing the struct device to be freed.
> 
> I understand where this problem comes from (the release method is potentially 
> gone with the module before it is called) but after more reading, I have a 
> hard time believing that a lot of the other gadget drivers would be wrong as 
> well. Some of them since 2009 or possibly earlier.
> 
> Gadgets with embedded release methods: langwell_udc, goku_udc, fsl_qe_udc (and 
> fsl_udc_core), amd5536udc, net2280, pch_udc, cil13xxx_udc, dummy_hcd, 
> omap_udc, net2272, mc_udc_core
> 
> Gadgets which use the release method from its pdev->dev but also free the 
> struct with the gadget in their remove method: r8a66597-udc, m66592-udc, 
> fusb300_udc. (possibly before the release function is called)
> 
> On the other hand, the gets and puts of the udc->gadget.dev should be paired 
> correctly and it's only an intermediate device between the udc and the gadget 
> driver, so that the call to device_unregister in the remove method should put 
> the refcount to 0 and thus init the cleanup (including the call to release) 
> before the module is removed.
> 
> So, I am very confused :-).

Try this patch.  If your system oopses 5 seconds after you remove the
module, you have a lifetime bug.

diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index ad81e1c..be1c97a 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -26,6 +26,9 @@
 #include <linux/kernel.h>
 #include <linux/wait.h>
 #include <linux/atomic.h>
+#include <linux/workqueue.h>
+
+#define KOBJECT_DEBUG_RELEASE
 
 #define UEVENT_HELPER_PATH_LEN		256
 #define UEVENT_NUM_ENVP			32	/* number of env pointers */
@@ -65,6 +68,9 @@ struct kobject {
 	struct kobj_type	*ktype;
 	struct sysfs_dirent	*sd;
 	struct kref		kref;
+#ifdef KOBJECT_DEBUG_RELEASE
+	struct delayed_work	release;
+#endif
 	unsigned int state_initialized:1;
 	unsigned int state_in_sysfs:1;
 	unsigned int state_add_uevent_sent:1;
diff --git a/lib/kobject.c b/lib/kobject.c
index 640bd98..fe57f3a 100644
--- a/lib/kobject.c
+++ b/lib/kobject.c
@@ -575,9 +575,23 @@ static void kobject_cleanup(struct kobject *kobj)
 	}
 }
 
+#ifdef KOBJECT_DEBUG_RELEASE
+static void kobject_delayed_cleanup(struct work_struct *work)
+{
+	kobject_cleanup(container_of(to_delayed_work(work),
+				     struct kobject, release));
+}
+#endif
+
 static void kobject_release(struct kref *kref)
 {
-	kobject_cleanup(container_of(kref, struct kobject, kref));
+	struct kobject *kobj = container_of(kref, struct kobject, kref);
+#ifdef KOBJECT_DEBUG_RELEASE
+	INIT_DELAYED_WORK(&kobj->release, kobject_delayed_cleanup);
+	schedule_delayed_work(&kobj->release, 5 * HZ);
+#else
+	kobject_cleanup(kobj);
+#endif
 }
 
 /**

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

* Re: [PATCH 3/7] s3c-hsudc: add a remove function
  2011-12-18 14:43         ` Russell King - ARM Linux
@ 2011-12-18 18:50           ` Heiko Stübner
  -1 siblings, 0 replies; 48+ messages in thread
From: Heiko Stübner @ 2011-12-18 18:50 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: Greg KH, Felipe Balbi, Kukjin Kim, linux-samsung-soc, linux-usb,
	Thomas Abraham, linux-arm-kernel

Am Sonntag 18 Dezember 2011, 15:43:19 schrieb Russell King - ARM Linux:
> On Sun, Dec 18, 2011 at 02:44:39PM +0100, Heiko Stübner wrote:
> > Am Sonntag 18 Dezember 2011, 09:10:48 schrieb Russell King - ARM Linux:
> > > On Sat, Dec 17, 2011 at 08:26:33PM +0100, Heiko Stübner wrote:
> > > > As the driver is also buildable as a module it should need
> > > > a cleanup function for the removal of the module.
> > > 
> > > My guess is that this wasn't implemented because of the embedded struct
> > > device lifetime rules for the gadget - to prevent the unbinding of the
> > > driver.
> > > 
> > > Until the struct device lifetime gets fixed, you must not allow the
> > > module nor the data structure containing the struct device to be
> > > freed.
> > 
> > I understand where this problem comes from (the release method is
> > potentially gone with the module before it is called) but after more
> > reading, I have a hard time believing that a lot of the other gadget
> > drivers would be wrong as well. Some of them since 2009 or possibly
> > earlier.
> > 
> > Gadgets with embedded release methods: langwell_udc, goku_udc, fsl_qe_udc
> > (and fsl_udc_core), amd5536udc, net2280, pch_udc, cil13xxx_udc,
> > dummy_hcd, omap_udc, net2272, mc_udc_core
> > 
> > Gadgets which use the release method from its pdev->dev but also free the
> > struct with the gadget in their remove method: r8a66597-udc, m66592-udc,
> > fusb300_udc. (possibly before the release function is called)
> > 
> > On the other hand, the gets and puts of the udc->gadget.dev should be
> > paired correctly and it's only an intermediate device between the udc
> > and the gadget driver, so that the call to device_unregister in the
> > remove method should put the refcount to 0 and thus init the cleanup
> > (including the call to release) before the module is removed.
> > 
> > So, I am very confused :-).
> 
> Try this patch.  If your system oopses 5 seconds after you remove the
> module, you have a lifetime bug.
I didn't get this far. With your patch the Oopses already happen during the startup of
the system / the loading of the modules.

A bit of the message spew I got during testing with linux-next-20111216:

pgd = c0004000
[bf05b504] *pgd=379af811, *pte=00000000, *ppte=00000000
Internal error: Oops: 7 [#1]
Modules linked in: ohci_hcd leds_s3c24xx usbcore i2c_s3c2410 i2c_core s3c_hsudc
CPU: 0    Not tainted  (3.2.0-rc5-next-20111216+ #32)
PC is at kobject_put+0x18/0x7c
LR is at kobject_del+0x64/0x70
pc : [<c011460c>]    lr : [<c01146f4>]    psr: a0000013
sp : c70bdef0  ip : c70bdf10  fp : c70bdf0c
r10: 00000000  r9 : c0114700  r8 : c7803a00
r7 : c79257a0  r6 : c02e1de0  r5 : c79a0120  r4 : bf05b4a0
r3 : 00000001  r2 : 00000000  r1 : 00000000  r0 : bf05b4a0
Flags: NzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
Control: 0005317f  Table: 37014000  DAC: 00000017
Process kworker/0:1 (pid: 16, stack limit = 0xc70bc270)
Stack: (0xc70bdef0 to 0xc70be000)
dee0:                                     c79a0100 c79a0120 c02e1de0 c79a0100
df00: c70bdf24 c70bdf10 c01146f4 c0114604 c01365bc c79a0100 c70bdf4c c70bdf28
df20: c01147f0 c01146a0 c0136640 c0136590 c79a0120 c785fd00 00000000 00000009
df40: c70bdf84 c70bdf50 c00318fc c0114710 c02dbf00 c7803a05 c02dbf00 c785fd00
df60: c02dbf00 c785fd00 00000009 c02dbf00 c785fd10 c70bc000 c70bdfbc c70bdf88
df80: c0032570 c00316c0 c7839edc c785fd10 c0032364 c70bdfcc c7839edc c785fd00
dfa0: c0032364 00000000 00000000 00000000 c70bdff4 c70bdfc0 c0037768 c0032374
dfc0: c7839edc 00000000 c785fd00 00000000 c70bdfd0 c70bdfd0 c7839edc c00376e0
dfe0: c0021ac0 00000013 00000000 c70bdff8 c0021ac0 c00376f0 00190021 00024ea8
Backtrace: 
[<c01145f4>] (kobject_put+0x0/0x7c) from [<c01146f4>] (kobject_del+0x64/0x70)
 r4:c79a0100
[<c0114690>] (kobject_del+0x0/0x70) from [<c01147f0>] (kobject_delayed_cleanup+0xf0/0x198)
 r4:c79a0100
[<c0114700>] (kobject_delayed_cleanup+0x0/0x198) from [<c00318fc>] (process_one_work+0x24c/0x3a8)
 r7:00000009 r6:00000000 r5:c785fd00 r4:c79a0120
[<c00316b0>] (process_one_work+0x0/0x3a8) from [<c0032570>] (worker_thread+0x20c/0x428)
[<c0032364>] (worker_thread+0x0/0x428) from [<c0037768>] (kthread+0x88/0x90)
[<c00376e0>] (kthread+0x0/0x90) from [<c0021ac0>] (do_exit+0x0/0x670)
 r7:00000013 r6:c0021ac0 r5:c00376e0 r4:c7839edc
Code: e24cb004 e24dd00c e2504000 0a000013 (e5d43064) 
---[ end trace ddf7f4f6a0de23b8 ]---
Unable to handle kernel paging request at virtual address fffffffc
pgd = c0004000
[fffffffc] *pgd=37ffe831, *pte=00000000, *ppte=00000000
Internal error: Oops: 17 [#2]
Modules linked in: ohci_hcd leds_s3c24xx usbcore i2c_s3c2410 i2c_core s3c_hsudc
CPU: 0    Tainted: G      D       (3.2.0-rc5-next-20111216+ #32)
PC is at kthread_data+0x10/0x18
LR is at wq_worker_sleeping+0x18/0xbc
pc : [<c00371c4>]    lr : [<c0033974>]    psr: 20000093
sp : c70bdb58  ip : c70bdb68  fp : c70bdb64
r10: c70bc000  r9 : c70bdb90  r8 : c02dc500
r7 : c7826000  r6 : c708cb00  r5 : c708cc54  r4 : 00000000
r3 : 00000000  r2 : c02dc500  r1 : 00000000  r0 : c708cb00
Flags: nzCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment user
Control: 0005317f  Table: 37014000  DAC: 00000015
Process kworker/0:1 (pid: 16, stack limit = 0xc70bc270)
Stack: (0xc70bdb58 to 0xc70be000)
db40:                                                       c70bdb7c c70bdb68
db60: c0033974 c00371c4 c003f760 00000001 c70bdc04 c70bdb80 c0218ebc c003396c
db80: c0406680 c70b4a40 00000664 c001c678 00000168 00000000 c70bdbcc c70bdba8
dba0: c008cb78 c008b680 c0034390 c708cb00 c70b8440 00000001 00000000 c70b4a40
dbc0: c70bdbdc c70bdbd0 c001c678 c708cb00 c70bdc14 c70bdbe0 c0020db4 00000001
dbe0: c70bdc24 c708cb00 c7826000 c708cbd8 c708caf8 c708cbd8 c70bdc14 c70bdc08
dc00: c02194cc c0218dfc c70bdc3c c70bdc18 c0022100 c0219468 00000008 00000001
dc20: c70bdc3c c70bdc24 c70bdc24 c708cc20 c70bdcb4 c70bdc40 c001222c c0021ad0
dc40: c70bc270 0000000b 7269762f 00000000 65000000 62633432 20343030 64343265
dc60: 63303064 35326520 30303430 61302030 30303030 28203331 34643565 34363033
dc80: c0002029 c0217dd8 c027dcbb bf05b504 c70bdea8 00000000 00000007 00000000
dca0: 00000007 00000000 c70bdcdc c70bdcb8 c0013808 c0011f80 00000000 c02d5ccc
dcc0: a0000013 c70bdea8 bf05b504 c708cb00 c70bddf4 c70bdce0 c0013b58 c00137a8
dce0: bf01dfcc bf0200c8 00000000 00000000 c70bddc4 c70bdd00 bf01f58c 00000028
dd00: c70bdd88 00000004 00000001 c708dbb0 00000000 00000004 00000002 c7a7e5e0
dd20: c708cb30 00000000 c708dbb0 00000000 c70bdd6c c70bdd40 c0040e34 c0040b20
dd40: c003f79c c021bf08 c02dc500 c708cb00 000000c3 00000001 00000001 00000001
dd60: c70bdd8c c70bdd70 c003e080 c0040d74 c003fb2c c708db80 00000000 40000093
dd80: c70bddac bf0203b0 00000100 c706d378 c70bddc4 c70bdda0 c0118064 c0117e6c
dda0: 00000001 00000004 00000000 c706d0b0 c02dc500 c706d0b0 00000000 c708cb00
ddc0: c708cb30 00000001 c706d0b0 c02d5ccc a0000013 00000007 c70bdea8 bf05b504
dde0: c0114700 00000000 c70bdea4 c70bddf8 c0008634 c0013838 00000003 00000000
de00: c70bde2c c70bde10 c003e080 c0040d74 c003fb2c c706d080 00000000 80000093
de20: c70bde4c c70bde30 c003fbc0 c003e05c 00000002 c7a73f70 00000bd3 000003e0
de40: c70bde70 c0113dc0 c003fbf8 c7a28780 c7a28730 c031fba0 c70bde98 c70bdec8
de60: c70bde8c c70bde70 c00dda98 c008cabc c7a28780 c7a28780 00020001 c70bde94
de80: c70bdec4 c011460c a0000013 ffffffff c70bdedc c7803a00 c70bdf0c c70bdea8
dea0: c000e458 c0008608 bf05b4a0 00000000 00000000 00000001 bf05b4a0 c79a0120
dec0: c02e1de0 c79257a0 c7803a00 c0114700 00000000 c70bdf0c c70bdf10 c70bdef0
dee0: c01146f4 c011460c a0000013 ffffffff c79a0100 c79a0120 c02e1de0 c79a0100
df00: c70bdf24 c70bdf10 c01146f4 c0114604 c01365bc c79a0100 c70bdf4c c70bdf28
df20: c01147f0 c01146a0 c0136640 c0136590 c79a0120 c785fd00 00000000 00000009
df40: c70bdf84 c70bdf50 c00318fc c0114710 c02dbf00 c7803a05 c02dbf00 c785fd00
df60: c02dbf00 c785fd00 00000009 c02dbf00 c785fd10 c70bc000 c70bdfbc c70bdf88
df80: c0032570 c00316c0 c7839edc c785fd10 c0032364 c70bdfcc c7839edc c785fd00
dfa0: c0032364 00000000 00000000 00000000 c70bdff4 c70bdfc0 c0037768 c0032374
dfc0: c7839edc 00000000 c785fd00 00000001 c70bdfd0 c70bdfd0 c7839edc c00376e0
dfe0: c0021ac0 00000013 00000000 c70bdff8 c0021ac0 c00376f0 00190021 00024ea8
Backtrace: 
[<c00371b4>] (kthread_data+0x0/0x18) from [<c0033974>] (wq_worker_sleeping+0x18/0xbc)
[<c003395c>] (wq_worker_sleeping+0x0/0xbc) from [<c0218ebc>] (__schedule+0xd0/0x37c)
 r4:00000001
[<c0218dec>] (__schedule+0x0/0x37c) from [<c02194cc>] (schedule+0x74/0x78)
[<c0219458>] (schedule+0x0/0x78) from [<c0022100>] (do_exit+0x640/0x670)
[<c0021ac0>] (do_exit+0x0/0x670) from [<c001222c>] (die+0x2bc/0x2fc)
[<c0011f70>] (die+0x0/0x2fc) from [<c0013808>] (__do_kernel_fault+0x70/0x90)
[<c0013798>] (__do_kernel_fault+0x0/0x90) from [<c0013b58>] (do_page_fault+0x330/0x354)
 r8:c708cb00 r7:bf05b504 r6:c70bdea8 r5:a0000013 r4:c02d5ccc
[<c0013828>] (do_page_fault+0x0/0x354) from [<c0008634>] (do_DataAbort+0x3c/0x9c)
[<c00085f8>] (do_DataAbort+0x0/0x9c) from [<c000e458>] (__dabt_svc+0x38/0x60)
Exception stack(0xc70bdea8 to 0xc70bdef0)
dea0:                   bf05b4a0 00000000 00000000 00000001 bf05b4a0 c79a0120
dec0: c02e1de0 c79257a0 c7803a00 c0114700 00000000 c70bdf0c c70bdf10 c70bdef0
dee0: c01146f4 c011460c a0000013 ffffffff
 r8:c7803a00 r7:c70bdedc r6:ffffffff r5:a0000013 r4:c011460c
[<c01145f4>] (kobject_put+0x0/0x7c) from [<c01146f4>] (kobject_del+0x64/0x70)
 r4:c79a0100
[<c0114690>] (kobject_del+0x0/0x70) from [<c01147f0>] (kobject_delayed_cleanup+0xf0/0x198)
 r4:c79a0100
[<c0114700>] (kobject_delayed_cleanup+0x0/0x198) from [<c00318fc>] (process_one_work+0x24c/0x3a8)
 r7:00000009 r6:00000000 r5:c785fd00 r4:c79a0120
[<c00316b0>] (process_one_work+0x0/0x3a8) from [<c0032570>] (worker_thread+0x20c/0x428)
[<c0032364>] (worker_thread+0x0/0x428) from [<c0037768>] (kthread+0x88/0x90)
[<c00376e0>] (kthread+0x0/0x90) from [<c0021ac0>] (do_exit+0x0/0x670)
 r7:00000013 r6:c0021ac0 r5:c00376e0 r4:c7839edc
Code: e1a0c00d e92dd800 e24cb004 e5903128 (e5130004) 
---[ end trace ddf7f4f6a0de23b9 ]---
Fixing recursive fault but reboot is needed!
Unable to handle kernel paging request at virtual address fffffffc
pgd = c0004000
[fffffffc] *pgd=37ffe831, *pte=00000000, *ppte=00000000
Internal error: Oops: 17 [#3]
Modules linked in: ohci_hcd leds_s3c24xx usbcore i2c_s3c2410 i2c_core s3c_hsudc
CPU: 0    Tainted: G      D       (3.2.0-rc5-next-20111216+ #32)
PC is at kthread_data+0x10/0x18
LR is at wq_worker_sleeping+0x18/0xbc
pc : [<c00371c4>]    lr : [<c0033974>]    psr: 20000093
sp : c70bd7c0  ip : c70bd7d0  fp : c70bd7cc
r10: c70bc000  r9 : c70bd7f8  r8 : c02dc500
r7 : c00371c8  r6 : c708cb00  r5 : c708cc54  r4 : 00000000
r3 : 00000000  r2 : c02dc500  r1 : 00000000  r0 : c708cb00
Flags: nzCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment user
Control: 0005317f  Table: 37014000  DAC: 00000015
Process kworker/0:1 (pid: 16, stack limit = 0xc70bc270)
Stack: (0xc70bd7c0 to 0xc70be000)
d7c0: c70bd7e4 c70bd7d0 c0033974 c00371c4 c003f760 0000000b c70bd86c c70bd7e8
d7e0: c0218ebc c003396c c0023cdc 60000013 ffffffff 60000013 c70bd824 c70bd808
d800: c005681c c0056718 0000001e 00000000 f6000000 c70bd894 c70bd834 c70bd828
d820: c0023e4c c00567c0 00000001 000bd838 00000004 0000000b c00371c6 c708cb00
d840: c00371c8 0000000b c00371c6 c708cb00 c00371c8 00000000 00000008 bf000000
d860: c70bd87c c70bd870 c02194cc c0218dfc c70bd8a4 c70bd880 c0021bd4 c0219468
d880: 00000008 bf000000 c70bd8a4 c70bd898 c001e49c c001e99c c70bd91c c70bd8a8
d8a0: c001222c c0021ad0 c70bc270 0000000b 028959e4 00000000 65000000 63306131
d8c0: 20643030 64323965 30303864 34326520 30306263 35652034 31333039 28203832
d8e0: 33313565 34303030 c0002029 c0217dd8 c027dcbb fffffffc c70bdb10 00000000
d900: 00000017 00000000 00000017 00000000 c70bd944 c70bd920 c0013808 c0011f80
d920: c0275aa3 c02d5ccc 20000093 c70bdb10 fffffffc c708cb00 c70bda5c c70bd948
d940: c0013b58 c00137a8 c011b37c c027a96d 00000000 00000670 c70bd9a9 0002340f
d960: c70bd994 00000028 c011a208 c0118ee8 c014b004 c03102e3 c03106b0 c03106b0
d980: c0275aa2 c03106b0 c70bda9c c70bd9a0 c011a584 c011a1d8 c011a550 ff0a0005
d9a0: ffffffff c70bd9b0 5f6f6474 74697865 3078302b 3678302f 30003037 38323478
d9c0: 00003800 31780038 00003839 c70bd9d8 c001e818 c001e70c 00001e0c 00001e0c
d9e0: c70bda1c c70bd9f0 c001f008 c003bd00 00000000 00000000 00000000 0000001f
da00: c70bda72 c03102b2 00000004 00000000 1b478423 c70bda50 c70bda24 c01198cc
da20: c01196d0 65300020 c70bda72 c03102b2 0000ffff c02d5ccc 20000093 00000017
da40: c70bdb10 fffffffc c70bdb90 c70bc000 c70bdb0c c70bda60 c0008634 c0013838
da60: c70bda84 c70bdaae c70bdb97 0000ffff 00000002 00000000 c0281b48 00000007
da80: c70bdb1c c70bda90 c0119ab8 c7826580 00000001 00000007 00000001 c78265b0
daa0: c02dc500 c78265b0 00000000 c708cb00 c708cb30 00000000 c78265b0 00000000
dac0: c70bdafc c70bdad0 c0040e5c c003e004 c003f79c c021bf08 c02dc500 c708cb00
dae0: c7826000 c02dc500 c70bdb90 c00371c4 20000093 ffffffff c70bdb44 c02dc500
db00: c70bdb64 c70bdb10 c000e458 c0008608 c708cb00 00000000 c02dc500 00000000
db20: 00000000 c708cc54 c708cb00 c7826000 c02dc500 c70bdb90 c70bc000 c70bdb64
db40: c70bdb68 c70bdb58 c0033974 c00371c4 20000093 ffffffff c70bdb7c c70bdb68
db60: c0033974 c00371c4 c003f760 00000001 c70bdc04 c70bdb80 c0218ebc c003396c
db80: c0406680 c70b4a40 00000664 c001c678 00000168 00000000 c70bdbcc c70bdba8
dba0: c008cb78 c008b680 c0034390 c708cb00 c70b8440 00000001 00000000 c70b4a40
dbc0: c70bdbdc c70bdbd0 c001c678 c708cb00 c70bdc14 c70bdbe0 c0020db4 00000001
dbe0: c70bdc24 c708cb00 c7826000 c708cbd8 c708caf8 c708cbd8 c70bdc14 c70bdc08
dc00: c02194cc c0218dfc c70bdc3c c70bdc18 c0022100 c0219468 00000008 00000001
dc20: c70bdc3c c70bdc24 c70bdc24 c708cc20 c70bdcb4 c70bdc40 c001222c c0021ad0
dc40: c70bc270 0000000b 7269762f 00000000 65000000 62633432 20343030 64343265
dc60: 63303064 35326520 30303430 61302030 30303030 28203331 34643565 34363033
dc80: c0002029 c0217dd8 c027dcbb bf05b504 c70bdea8 00000000 00000007 00000000
dca0: 00000007 00000000 c70bdcdc c70bdcb8 c0013808 c0011f80 00000000 c02d5ccc
dcc0: a0000013 c70bdea8 bf05b504 c708cb00 c70bddf4 c70bdce0 c0013b58 c00137a8
dce0: bf01dfcc bf0200c8 00000000 00000000 c70bddc4 c70bdd00 bf01f58c 00000028
dd00: c70bdd88 00000004 00000001 c708dbb0 00000000 00000004 00000002 c7a7e5e0
dd20: c708cb30 00000000 c708dbb0 00000000 c70bdd6c c70bdd40 c0040e34 c0040b20
dd40: c003f79c c021bf08 c02dc500 c708cb00 000000c3 00000001 00000001 00000001
dd60: c70bdd8c c70bdd70 c003e080 c0040d74 c003fb2c c708db80 00000000 40000093
dd80: c70bddac bf0203b0 00000100 c706d378 c70bddc4 c70bdda0 c0118064 c0117e6c
dda0: 00000001 00000004 00000000 c706d0b0 c02dc500 c706d0b0 00000000 c708cb00
ddc0: c708cb30 00000001 c706d0b0 c02d5ccc a0000013 00000007 c70bdea8 bf05b504
dde0: c0114700 00000000 c70bdea4 c70bddf8 c0008634 c0013838 00000003 00000000
de00: c70bde2c c70bde10 c003e080 c0040d74 c003fb2c c706d080 00000000 80000093
de20: c70bde4c c70bde30 c003fbc0 c003e05c 00000002 c7a73f70 00000bd3 000003e0
de40: c70bde70 c0113dc0 c003fbf8 c7a28780 c7a28730 c031fba0 c70bde98 c70bdec8
de60: c70bde8c c70bde70 c00dda98 c008cabc c7a28780 c7a28780 00020001 c70bde94
de80: c70bdec4 c011460c a0000013 ffffffff c70bdedc c7803a00 c70bdf0c c70bdea8
dea0: c000e458 c0008608 bf05b4a0 00000000 00000000 00000001 bf05b4a0 c79a0120
dec0: c02e1de0 c79257a0 c7803a00 c0114700 00000000 c70bdf0c c70bdf10 c70bdef0
dee0: c01146f4 c011460c a0000013 ffffffff c79a0100 c79a0120 c02e1de0 c79a0100
df00: c70bdf24 c70bdf10 c01146f4 c0114604 c01365bc c79a0100 c70bdf4c c70bdf28
df20: c01147f0 c01146a0 c0136640 c0136590 c79a0120 c785fd00 00000000 00000009
df40: c70bdf84 c70bdf50 c00318fc c0114710 c02dbf00 c7803a05 c02dbf00 c785fd00
df60: c02dbf00 c785fd00 00000009 c02dbf00 c785fd10 c70bc000 c70bdfbc c70bdf88
df80: c0032570 c00316c0 c7839edc c785fd10 c0032364 c70bdfcc c7839edc c785fd00
dfa0: c0032364 00000000 00000000 00000000 c70bdff4 c70bdfc0 c0037768 c0032374
dfc0: c7839edc 00000000 c785fd00 00000001 c70bdfd0 c70bdfd0 c7839edc c00376e0
dfe0: c0021ac0 00000013 00000000 c70bdff8 c0021ac0 c00376f0 00190021 00024ea8
Backtrace: 
[<c00371b4>] (kthread_data+0x0/0x18) from [<c0033974>] (wq_worker_sleeping+0x18/0xbc)
[<c003395c>] (wq_worker_sleeping+0x0/0xbc) from [<c0218ebc>] (__schedule+0xd0/0x37c)
 r4:0000000b
[<c0218dec>] (__schedule+0x0/0x37c) from [<c02194cc>] (schedule+0x74/0x78)
[<c0219458>] (schedule+0x0/0x78) from [<c0021bd4>] (do_exit+0x114/0x670)
[<c0021ac0>] (do_exit+0x0/0x670) from [<c001222c>] (die+0x2bc/0x2fc)
[<c0011f70>] (die+0x0/0x2fc) from [<c0013808>] (__do_kernel_fault+0x70/0x90)
[<c0013798>] (__do_kernel_fault+0x0/0x90) from [<c0013b58>] (do_page_fault+0x330/0x354)
 r8:c708cb00 r7:fffffffc r6:c70bdb10 r5:20000093 r4:c02d5ccc
[<c0013828>] (do_page_fault+0x0/0x354) from [<c0008634>] (do_DataAbort+0x3c/0x9c)
[<c00085f8>] (do_DataAbort+0x0/0x9c) from [<c000e458>] (__dabt_svc+0x38/0x60)
Exception stack(0xc70bdb10 to 0xc70bdb58)
db00:                                     c708cb00 00000000 c02dc500 00000000
db20: 00000000 c708cc54 c708cb00 c7826000 c02dc500 c70bdb90 c70bc000 c70bdb64
db40: c70bdb68 c70bdb58 c0033974 c00371c4 20000093 ffffffff
 r8:c02dc500 r7:c70bdb44 r6:ffffffff r5:20000093 r4:c00371c4
[<c00371b4>] (kthread_data+0x0/0x18) from [<c0033974>] (wq_worker_sleeping+0x18/0xbc)
[<c003395c>] (wq_worker_sleeping+0x0/0xbc) from [<c0218ebc>] (__schedule+0xd0/0x37c)
 r4:00000001
[<c0218dec>] (__schedule+0x0/0x37c) from [<c02194cc>] (schedule+0x74/0x78)
[<c0219458>] (schedule+0x0/0x78) from [<c0022100>] (do_exit+0x640/0x670)
[<c0021ac0>] (do_exit+0x0/0x670) from [<c001222c>] (die+0x2bc/0x2fc)
[<c0011f70>] (die+0x0/0x2fc) from [<c0013808>] (__do_kernel_fault+0x70/0x90)
[<c0013798>] (__do_kernel_fault+0x0/0x90) from [<c0013b58>] (do_page_fault+0x330/0x354)
 r8:c708cb00 r7:bf05b504 r6:c70bdea8 r5:a0000013 r4:c02d5ccc
[<c0013828>] (do_page_fault+0x0/0x354) from [<c0008634>] (do_DataAbort+0x3c/0x9c)
[<c00085f8>] (do_DataAbort+0x0/0x9c) from [<c000e458>] (__dabt_svc+0x38/0x60)
Exception stack(0xc70bdea8 to 0xc70bdef0)
dea0:                   bf05b4a0 00000000 00000000 00000001 bf05b4a0 c79a0120
dec0: c02e1de0 c79257a0 c7803a00 c0114700 00000000 c70bdf0c c70bdf10 c70bdef0
dee0: c01146f4 c011460c a0000013 ffffffff
 r8:c7803a00 r7:c70bdedc r6:ffffffff r5:a0000013 r4:c011460c
[<c01145f4>] (kobject_put+0x0/0x7c) from [<c01146f4>] (kobject_del+0x64/0x70)
 r4:c79a0100
[<c0114690>] (kobject_del+0x0/0x70) from [<c01147f0>] (kobject_delayed_cleanup+0xf0/0x198)
 r4:c79a0100
[<c0114700>] (kobject_delayed_cleanup+0x0/0x198) from [<c00318fc>] (process_one_work+0x24c/0x3a8)
 r7:00000009 r6:00000000 r5:c785fd00 r4:c79a0120
[<c00316b0>] (process_one_work+0x0/0x3a8) from [<c0032570>] (worker_thread+0x20c/0x428)
[<c0032364>] (worker_thread+0x0/0x428) from [<c0037768>] (kthread+0x88/0x90)
[<c00376e0>] (kthread+0x0/0x90) from [<c0021ac0>] (do_exit+0x0/0x670)
 r7:00000013 r6:c0021ac0 r5:c00376e0 r4:c7839edc
Code: e1a0c00d e92dd800 e24cb004 e5903128 (e5130004) 
---[ end trace ddf7f4f6a0de23ba ]---
Fixing recursive fault but reboot is needed!
Unable to handle kernel paging request at virtual address fffffffc
pgd = c0004000
[fffffffc] *pgd=37ffe831, *pte=00000000, *ppte=00000000
Internal error: Oops: 17 [#4]
Modules linked in: ohci_hcd leds_s3c24xx usbcore i2c_s3c2410 i2c_core s3c_hsudc
CPU: 0    Tainted: G      D       (3.2.0-rc5-next-20111216+ #32)
PC is at kthread_data+0x10/0x18
LR is at wq_worker_sleeping+0x18/0xbc
pc : [<c00371c4>]    lr : [<c0033974>]    psr: 20000093
sp : c70bd428  ip : c70bd438  fp : c70bd434
r10: c70bc000  r9 : c70bd460  r8 : c02dc500
r7 : c00371c8  r6 : c708cb00  r5 : c708cc54  r4 : 00000000
r3 : 00000000  r2 : c02dc500  r1 : 00000000  r0 : c708cb00
Flags: nzCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment user
Control: 0005317f  Table: 37014000  DAC: 00000015
Process kworker/0:1 (pid: 16, stack limit = 0xc70bc270)
Stack: (0xc70bd428 to 0xc70be000)
d420:                   c70bd44c c70bd438 c0033974 c00371c4 c003f760 0000000b
d440: c70bd4d4 c70bd450 c0218ebc c003396c c0023cdc 60000013 ffffffff 60000013
d460: c70bd48c c70bd470 c005681c c0056718 0000001e 00000000 f6000000 c70bd4fc
d480: c70bd49c c70bd490 c0023e4c c00567c0 00000001 000bd4a0 00000004 0000000b
d4a0: c00371c6 c708cb00 c00371c8 0000000b c00371c6 c708cb00 c00371c8 00000000
d4c0: 00000008 bf000000 c70bd4e4 c70bd4d8 c02194cc c0218dfc c70bd50c c70bd4e8
d4e0: c0021bd4 c0219468 00000008 bf000000 c70bd50c c70bd500 c001e49c c001e99c
d500: c70bd584 c70bd510 c001222c c0021ad0 c70bc270 0000000b 00003164 00000000
d520: 65000000 63306131 20643030 64323965 30303864 34326520 30306263 35652034
d540: 31333039 28203832 33313565 34303030 c0002029 c0217dd8 c027dcbb fffffffc
d560: c70bd778 00000000 00000017 00000000 00000017 00000000 c70bd5ac c70bd588
d580: c0013808 c0011f80 c0275aa3 c02d5ccc 20000093 c70bd778 fffffffc c708cb00
d5a0: c70bd6c4 c70bd5b0 c0013b58 c00137a8 c011b37c c027a96d 00000000 00000670
d5c0: c70bd611 00000030 c70bd5fc 00000028 c011a208 c0118ee8 c014b004 c03102e3
d5e0: c03106b0 c03106b0 c0275aa2 c03106b0 c70bd704 c70bd608 c011a584 c011a1d8
d600: c011a550 ff0a0005 ffffffff c70bd618 5f6f6474 74697865 3078302b 3678302f
d620: 30003037 38323478 00003800 31780038 c70bc000 00000000 005b8d80 00000000
d640: c708cb30 c70bd7cc c70bd67c c70bd658 c0040818 c00406b4 00000c00 00155555
d660: c02dfe08 c02dfd74 c70bc000 c708cb30 c70bd69c c70bd674 c70bd674 c708cb00
d680: c70bd7cc c02ddbb0 c031e888 c70bc000 00000000 c708cb00 c70bd7cc c02d5ccc
d6a0: 20000093 00000017 c70bd778 fffffffc c70bd7f8 c70bc000 c70bd774 c70bd6c8
d6c0: c0008634 c0013838 c70bd724 c70bd6d8 c0028b4c c003aa98 00000001 00000001
d6e0: c02ddbb0 c70bd6f0 c031122c c031102c c70bd6f0 c70bd6f0 00000010 00000001
d700: 00000100 c70bc000 00000004 00000001 00000001 00000100 c70bd75c 0000002c
d720: c70bd754 c70bd730 c014b004 c014dc28 c70bd75c c02e6290 00003cd6 0000002d
d740: c02daa48 c02daa50 c70bd764 c70bd758 c014e9ac c00371c4 20000093 ffffffff
d760: c70bd7ac c02dc500 c70bd7cc c70bd778 c000e458 c0008608 c708cb00 00000000
d780: c02dc500 00000000 00000000 c708cc54 c708cb00 c00371c8 c02dc500 c70bd7f8
d7a0: c70bc000 c70bd7cc c70bd7d0 c70bd7c0 c0033974 c00371c4 20000093 ffffffff
d7c0: c70bd7e4 c70bd7d0 c0033974 c00371c4 c003f760 0000000b c70bd86c c70bd7e8
d7e0: c0218ebc c003396c c0023cdc 60000013 ffffffff 60000013 c70bd824 c70bd808
d800: c005681c c0056718 0000001e 00000000 f6000000 c70bd894 c70bd834 c70bd828
d820: c0023e4c c00567c0 00000001 000bd838 00000004 0000000b c00371c6 c708cb00
d840: c00371c8 0000000b c00371c6 c708cb00 c00371c8 00000000 00000008 bf000000
d860: c70bd87c c70bd870 c02194cc c0218dfc c70bd8a4 c70bd880 c0021bd4 c0219468
d880: 00000008 bf000000 c70bd8a4 c70bd898 c001e49c c001e99c c70bd91c c70bd8a8
d8a0: c001222c c0021ad0 c70bc270 0000000b 028959e4 00000000 65000000 63306131
d8c0: 20643030 64323965 30303864 34326520 30306263 35652034 31333039 28203832
d8e0: 33313565 34303030 c0002029 c0217dd8 c027dcbb fffffffc c70bdb10 00000000
d900: 00000017 00000000 00000017 00000000 c70bd944 c70bd920 c0013808 c0011f80
d920: c0275aa3 c02d5ccc 20000093 c70bdb10 fffffffc c708cb00 c70bda5c c70bd948
d940: c0013b58 c00137a8 c011b37c c027a96d 00000000 00000670 c70bd9a9 0002340f
d960: c70bd994 00000028 c011a208 c0118ee8 c014b004 c03102e3 c03106b0 c03106b0
d980: c0275aa2 c03106b0 c70bda9c c70bd9a0 c011a584 c011a1d8 c011a550 ff0a0005
d9a0: ffffffff c70bd9b0 5f6f6474 74697865 3078302b 3678302f 30003037 38323478
d9c0: 00003800 31780038 00003839 c70bd9d8 c001e818 c001e70c 00001e0c 00001e0c
d9e0: c70bda1c c70bd9f0 c001f008 c003bd00 00000000 00000000 00000000 0000001f
da00: c70bda72 c03102b2 00000004 00000000 1b478423 c70bda50 c70bda24 c01198cc
da20: c01196d0 65300020 c70bda72 c03102b2 0000ffff c02d5ccc 20000093 00000017
da40: c70bdb10 fffffffc c70bdb90 c70bc000 c70bdb0c c70bda60 c0008634 c0013838
da60: c70bda84 c70bdaae c70bdb97 0000ffff 00000002 00000000 c0281b48 00000007
da80: c70bdb1c c70bda90 c0119ab8 c7826580 00000001 00000007 00000001 c78265b0
daa0: c02dc500 c78265b0 00000000 c708cb00 c708cb30 00000000 c78265b0 00000000
dac0: c70bdafc c70bdad0 c0040e5c c003e004 c003f79c c021bf08 c02dc500 c708cb00
dae0: c7826000 c02dc500 c70bdb90 c00371c4 20000093 ffffffff c70bdb44 c02dc500
db00: c70bdb64 c70bdb10 c000e458 c0008608 c708cb00 00000000 c02dc500 00000000
db20: 00000000 c708cc54 c708cb00 c7826000 c02dc500 c70bdb90 c70bc000 c70bdb64
db40: c70bdb68 c70bdb58 c0033974 c00371c4 20000093 ffffffff c70bdb7c c70bdb68
db60: c0033974 c00371c4 c003f760 00000001 c70bdc04 c70bdb80 c0218ebc c003396c
db80: c0406680 c70b4a40 00000664 c001c678 00000168 00000000 c70bdbcc c70bdba8
dba0: c008cb78 c008b680 c0034390 c708cb00 c70b8440 00000001 00000000 c70b4a40
dbc0: c70bdbdc c70bdbd0 c001c678 c708cb00 c70bdc14 c70bdbe0 c0020db4 00000001
dbe0: c70bdc24 c708cb00 c7826000 c708cbd8 c708caf8 c708cbd8 c70bdc14 c70bdc08
dc00: c02194cc c0218dfc c70bdc3c c70bdc18 c0022100 c0219468 00000008 00000001
dc20: c70bdc3c c70bdc24 c70bdc24 c708cc20 c70bdcb4 c70bdc40 c001222c c0021ad0
dc40: c70bc270 0000000b 7269762f 00000000 65000000 62633432 20343030 64343265
dc60: 63303064 35326520 30303430 61302030 30303030 28203331 34643565 34363033
dc80: c0002029 c0217dd8 c027dcbb bf05b504 c70bdea8 00000000 00000007 00000000
dca0: 00000007 00000000 c70bdcdc c70bdcb8 c0013808 c0011f80 00000000 c02d5ccc
dcc0: a0000013 c70bdea8 bf05b504 c708cb00 c70bddf4 c70bdce0 c0013b58 c00137a8
dce0: bf01dfcc bf0200c8 00000000 00000000 c70bddc4 c70bdd00 bf01f58c 00000028
dd00: c70bdd88 00000004 00000001 c708dbb0 00000000 00000004 00000002 c7a7e5e0
dd20: c708cb30 00000000 c708dbb0 00000000 c70bdd6c c70bdd40 c0040e34 c0040b20
dd40: c003f79c c021bf08 c02dc500 c708cb00 000000c3 00000001 00000001 00000001
dd60: c70bdd8c c70bdd70 c003e080 c0040d74 c003fb2c c708db80 00000000 40000093
dd80: c70bddac bf0203b0 00000100 c706d378 c70bddc4 c70bdda0 c0118064 c0117e6c
dda0: 00000001 00000004 00000000 c706d0b0 c02dc500 c706d0b0 00000000 c708cb00
ddc0: c708cb30 00000001 c706d0b0 c02d5ccc a0000013 00000007 c70bdea8 bf05b504
dde0: c0114700 00000000 c70bdea4 c70bddf8 c0008634 c0013838 00000003 00000000
de00: c70bde2c c70bde10 c003e080 c0040d74 c003fb2c c706d080 00000000 80000093
de20: c70bde4c c70bde30 c003fbc0 c003e05c 00000002 c7a73f70 00000bd3 000003e0
de40: c70bde70 c0113dc0 c003fbf8 c7a28780 c7a28730 c031fba0 c70bde98 c70bdec8
de60: c70bde8c c70bde70 c00dda98 c008cabc c7a28780 c7a28780 00020001 c70bde94
de80: c70bdec4 c011460c a0000013 ffffffff c70bdedc c7803a00 c70bdf0c c70bdea8
dea0: c000e458 c0008608 bf05b4a0 00000000 00000000 00000001 bf05b4a0 c79a0120
dec0: c02e1de0 c79257a0 c7803a00 c0114700 00000000 c70bdf0c c70bdf10 c70bdef0
dee0: c01146f4 c011460c a0000013 ffffffff c79a0100 c79a0120 c02e1de0 c79a0100
df00: c70bdf24 c70bdf10 c01146f4 c0114604 c01365bc c79a0100 c70bdf4c c70bdf28
df20: c01147f0 c01146a0 c0136640 c0136590 c79a0120 c785fd00 00000000 00000009
df40: c70bdf84 c70bdf50 c00318fc c0114710 c02dbf00 c7803a05 c02dbf00 c785fd00
df60: c02dbf00 c785fd00 00000009 c02dbf00 c785fd10 c70bc000 c70bdfbc c70bdf88
df80: c0032570 c00316c0 c7839edc c785fd10 c0032364 c70bdfcc c7839edc c785fd00
dfa0: c0032364 00000000 00000000 00000000 c70bdff4 c70bdfc0 c0037768 c0032374
dfc0: c7839edc 00000000 c785fd00 00000001 c70bdfd0 c70bdfd0 c7839edc c00376e0
dfe0: c0021ac0 00000013 00000000 c70bdff8 c0021ac0 c00376f0 00190021 00024ea8
Backtrace: 
[<c00371b4>] (kthread_data+0x0/0x18) from [<c0033974>] (wq_worker_sleeping+0x18/0xbc)
[<c003395c>] (wq_worker_sleeping+0x0/0xbc) from [<c0218ebc>] (__schedule+0xd0/0x37c)
 r4:0000000b
[<c0218dec>] (__schedule+0x0/0x37c) from [<c02194cc>] (schedule+0x74/0x78)
[<c0219458>] (schedule+0x0/0x78) from [<c0021bd4>] (do_exit+0x114/0x670)
[<c0021ac0>] (do_exit+0x0/0x670) from [<c001222c>] (die+0x2bc/0x2fc)
[<c0011f70>] (die+0x0/0x2fc) from [<c0013808>] (__do_kernel_fault+0x70/0x90)
[<c0013798>] (__do_kernel_fault+0x0/0x90) from [<c0013b58>] (do_page_fault+0x330/0x354)
 r8:c708cb00 r7:fffffffc r6:c70bd778 r5:20000093 r4:c02d5ccc
[<c0013828>] (do_page_fault+0x0/0x354) from [<c0008634>] (do_DataAbort+0x3c/0x9c)
[<c00085f8>] (do_DataAbort+0x0/0x9c) from [<c000e458>] (__dabt_svc+0x38/0x60)
Exception stack(0xc70bd778 to 0xc70bd7c0)
d760:                                                       c708cb00 00000000
d780: c02dc500 00000000 00000000 c708cc54 c708cb00 c00371c8 c02dc500 c70bd7f8
d7a0: c70bc000 c70bd7cc c70bd7d0 c70bd7c0 c0033974 c00371c4 20000093 ffffffff
 r8:c02dc500 r7:c70bd7ac r6:ffffffff r5:20000093 r4:c00371c4
[<c00371b4>] (kthread_data+0x0/0x18) from [<c0033974>] (wq_worker_sleeping+0x18/0xbc)
[<c003395c>] (wq_worker_sleeping+0x0/0xbc) from [<c0218ebc>] (__schedule+0xd0/0x37c)
 r4:0000000b
[<c0218dec>] (__schedule+0x0/0x37c) from [<c02194cc>] (schedule+0x74/0x78)
[<c0219458>] (schedule+0x0/0x78) from [<c0021bd4>] (do_exit+0x114/0x670)
[<c0021ac0>] (do_exit+0x0/0x670) from [<c001222c>] (die+0x2bc/0x2fc)
[<c0011f70>] (die+0x0/0x2fc) from [<c0013808>] (__do_kernel_fault+0x70/0x90)
[<c0013798>] (__do_kernel_fault+0x0/0x90) from [<c0013b58>] (do_page_fault+0x330/0x354)
 r8:c708cb00 r7:fffffffc r6:c70bdb10 r5:20000093 r4:c02d5ccc
[<c0013828>] (do_page_fault+0x0/0x354) from [<c0008634>] (do_DataAbort+0x3c/0x9c)
[<c00085f8>] (do_DataAbort+0x0/0x9c) from [<c000e458>] (__dabt_svc+0x38/0x60)
Exception stack(0xc70bdb10 to 0xc70bdb58)
db00:                                     c708cb00 00000000 c02dc500 00000000
db20: 00000000 c708cc54 c708cb00 c7826000 c02dc500 c70bdb90 c70bc000 c70bdb64
db40: c70bdb68 c70bdb58 c0033974 c00371c4 20000093 ffffffff
 r8:c02dc500 r7:c70bdb44 r6:ffffffff r5:20000093 r4:c00371c4
[<c00371b4>] (kthread_data+0x0/0x18) from [<c0033974>] (wq_worker_sleeping+0x18/0xbc)
[<c003395c>] (wq_worker_sleeping+0x0/0xbc) from [<c0218ebc>] (__schedule+0xd0/0x37c)
 r4:00000001
[<c0218dec>] (__schedule+0x0/0x37c) from [<c02194cc>] (schedule+0x74/0x78)
[<c0219458>] (schedule+0x0/0x78) from [<c0022100>] (do_exit+0x640/0x670)
[<c0021ac0>] (do_exit+0x0/0x670) from [<c001222c>] (die+0x2bc/0x2fc)
[<c0011f70>] (die+0x0/0x2fc) from [<c0013808>] (__do_kernel_fault+0x70/0x90)
[<c0013798>] (__do_kernel_fault+0x0/0x90) from [<c0013b58>] (do_page_fault+0x330/0x354)
 r8:c708cb00 r7:bf05b504 r6:c70bdea8 r5:a0000013 r4:c02d5ccc
[<c0013828>] (do_page_fault+0x0/0x354) from [<c0008634>] (do_DataAbort+0x3c/0x9c)
[<c00085f8>] (do_DataAbort+0x0/0x9c) from [<c000e458>] (__dabt_svc+0x38/0x60)
Exception stack(0xc70bdea8 to 0xc70bdef0)
dea0:                   bf05b4a0 00000000 00000000 00000001 bf05b4a0 c79a0120
dec0: c02e1de0 c79257a0 c7803a00 c0114700 00000000 c70bdf0c c70bdf10 c70bdef0
dee0: c01146f4 c011460c a0000013 ffffffff
 r8:c7803a00 r7:c70bdedc r6:ffffffff r5:a0000013 r4:c011460c
[<c01145f4>] (kobject_put+0x0/0x7c) from [<c01146f4>] (kobject_del+0x64/0x70)
 r4:c79a0100
[<c0114690>] (kobject_del+0x0/0x70) from [<c01147f0>] (kobject_delayed_cleanup+0xf0/0x198)
 r4:c79a0100
[<c0114700>] (kobject_delayed_cleanup+0x0/0x198) from [<c00318fc>] (process_one_work+0x24c/0x3a8)
 r7:00000009 r6:00000000 r5:c785fd00 r4:c79a0120
[<c00316b0>] (process_one_work+0x0/0x3a8) from [<c0032570>] (worker_thread+0x20c/0x428)
[<c0032364>] (worker_thread+0x0/0x428) from [<c0037768>] (kthread+0x88/0x90)
[<c00376e0>] (kthread+0x0/0x90) from [<c0021ac0>] (do_exit+0x0/0x670)
 r7:00000013 r6:c0021ac0 r5:c00376e0 r4:c7839edc
Code: e1a0c00d e92dd800 e24cb004 e5903128 (e5130004) 
---[ end trace ddf7f4f6a0de23bb ]---

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

* [PATCH 3/7] s3c-hsudc: add a remove function
@ 2011-12-18 18:50           ` Heiko Stübner
  0 siblings, 0 replies; 48+ messages in thread
From: Heiko Stübner @ 2011-12-18 18:50 UTC (permalink / raw)
  To: linux-arm-kernel

Am Sonntag 18 Dezember 2011, 15:43:19 schrieb Russell King - ARM Linux:
> On Sun, Dec 18, 2011 at 02:44:39PM +0100, Heiko St?bner wrote:
> > Am Sonntag 18 Dezember 2011, 09:10:48 schrieb Russell King - ARM Linux:
> > > On Sat, Dec 17, 2011 at 08:26:33PM +0100, Heiko St?bner wrote:
> > > > As the driver is also buildable as a module it should need
> > > > a cleanup function for the removal of the module.
> > > 
> > > My guess is that this wasn't implemented because of the embedded struct
> > > device lifetime rules for the gadget - to prevent the unbinding of the
> > > driver.
> > > 
> > > Until the struct device lifetime gets fixed, you must not allow the
> > > module nor the data structure containing the struct device to be
> > > freed.
> > 
> > I understand where this problem comes from (the release method is
> > potentially gone with the module before it is called) but after more
> > reading, I have a hard time believing that a lot of the other gadget
> > drivers would be wrong as well. Some of them since 2009 or possibly
> > earlier.
> > 
> > Gadgets with embedded release methods: langwell_udc, goku_udc, fsl_qe_udc
> > (and fsl_udc_core), amd5536udc, net2280, pch_udc, cil13xxx_udc,
> > dummy_hcd, omap_udc, net2272, mc_udc_core
> > 
> > Gadgets which use the release method from its pdev->dev but also free the
> > struct with the gadget in their remove method: r8a66597-udc, m66592-udc,
> > fusb300_udc. (possibly before the release function is called)
> > 
> > On the other hand, the gets and puts of the udc->gadget.dev should be
> > paired correctly and it's only an intermediate device between the udc
> > and the gadget driver, so that the call to device_unregister in the
> > remove method should put the refcount to 0 and thus init the cleanup
> > (including the call to release) before the module is removed.
> > 
> > So, I am very confused :-).
> 
> Try this patch.  If your system oopses 5 seconds after you remove the
> module, you have a lifetime bug.
I didn't get this far. With your patch the Oopses already happen during the startup of
the system / the loading of the modules.

A bit of the message spew I got during testing with linux-next-20111216:

pgd = c0004000
[bf05b504] *pgd=379af811, *pte=00000000, *ppte=00000000
Internal error: Oops: 7 [#1]
Modules linked in: ohci_hcd leds_s3c24xx usbcore i2c_s3c2410 i2c_core s3c_hsudc
CPU: 0    Not tainted  (3.2.0-rc5-next-20111216+ #32)
PC is at kobject_put+0x18/0x7c
LR is at kobject_del+0x64/0x70
pc : [<c011460c>]    lr : [<c01146f4>]    psr: a0000013
sp : c70bdef0  ip : c70bdf10  fp : c70bdf0c
r10: 00000000  r9 : c0114700  r8 : c7803a00
r7 : c79257a0  r6 : c02e1de0  r5 : c79a0120  r4 : bf05b4a0
r3 : 00000001  r2 : 00000000  r1 : 00000000  r0 : bf05b4a0
Flags: NzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
Control: 0005317f  Table: 37014000  DAC: 00000017
Process kworker/0:1 (pid: 16, stack limit = 0xc70bc270)
Stack: (0xc70bdef0 to 0xc70be000)
dee0:                                     c79a0100 c79a0120 c02e1de0 c79a0100
df00: c70bdf24 c70bdf10 c01146f4 c0114604 c01365bc c79a0100 c70bdf4c c70bdf28
df20: c01147f0 c01146a0 c0136640 c0136590 c79a0120 c785fd00 00000000 00000009
df40: c70bdf84 c70bdf50 c00318fc c0114710 c02dbf00 c7803a05 c02dbf00 c785fd00
df60: c02dbf00 c785fd00 00000009 c02dbf00 c785fd10 c70bc000 c70bdfbc c70bdf88
df80: c0032570 c00316c0 c7839edc c785fd10 c0032364 c70bdfcc c7839edc c785fd00
dfa0: c0032364 00000000 00000000 00000000 c70bdff4 c70bdfc0 c0037768 c0032374
dfc0: c7839edc 00000000 c785fd00 00000000 c70bdfd0 c70bdfd0 c7839edc c00376e0
dfe0: c0021ac0 00000013 00000000 c70bdff8 c0021ac0 c00376f0 00190021 00024ea8
Backtrace: 
[<c01145f4>] (kobject_put+0x0/0x7c) from [<c01146f4>] (kobject_del+0x64/0x70)
 r4:c79a0100
[<c0114690>] (kobject_del+0x0/0x70) from [<c01147f0>] (kobject_delayed_cleanup+0xf0/0x198)
 r4:c79a0100
[<c0114700>] (kobject_delayed_cleanup+0x0/0x198) from [<c00318fc>] (process_one_work+0x24c/0x3a8)
 r7:00000009 r6:00000000 r5:c785fd00 r4:c79a0120
[<c00316b0>] (process_one_work+0x0/0x3a8) from [<c0032570>] (worker_thread+0x20c/0x428)
[<c0032364>] (worker_thread+0x0/0x428) from [<c0037768>] (kthread+0x88/0x90)
[<c00376e0>] (kthread+0x0/0x90) from [<c0021ac0>] (do_exit+0x0/0x670)
 r7:00000013 r6:c0021ac0 r5:c00376e0 r4:c7839edc
Code: e24cb004 e24dd00c e2504000 0a000013 (e5d43064) 
---[ end trace ddf7f4f6a0de23b8 ]---
Unable to handle kernel paging request at virtual address fffffffc
pgd = c0004000
[fffffffc] *pgd=37ffe831, *pte=00000000, *ppte=00000000
Internal error: Oops: 17 [#2]
Modules linked in: ohci_hcd leds_s3c24xx usbcore i2c_s3c2410 i2c_core s3c_hsudc
CPU: 0    Tainted: G      D       (3.2.0-rc5-next-20111216+ #32)
PC is at kthread_data+0x10/0x18
LR is at wq_worker_sleeping+0x18/0xbc
pc : [<c00371c4>]    lr : [<c0033974>]    psr: 20000093
sp : c70bdb58  ip : c70bdb68  fp : c70bdb64
r10: c70bc000  r9 : c70bdb90  r8 : c02dc500
r7 : c7826000  r6 : c708cb00  r5 : c708cc54  r4 : 00000000
r3 : 00000000  r2 : c02dc500  r1 : 00000000  r0 : c708cb00
Flags: nzCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment user
Control: 0005317f  Table: 37014000  DAC: 00000015
Process kworker/0:1 (pid: 16, stack limit = 0xc70bc270)
Stack: (0xc70bdb58 to 0xc70be000)
db40:                                                       c70bdb7c c70bdb68
db60: c0033974 c00371c4 c003f760 00000001 c70bdc04 c70bdb80 c0218ebc c003396c
db80: c0406680 c70b4a40 00000664 c001c678 00000168 00000000 c70bdbcc c70bdba8
dba0: c008cb78 c008b680 c0034390 c708cb00 c70b8440 00000001 00000000 c70b4a40
dbc0: c70bdbdc c70bdbd0 c001c678 c708cb00 c70bdc14 c70bdbe0 c0020db4 00000001
dbe0: c70bdc24 c708cb00 c7826000 c708cbd8 c708caf8 c708cbd8 c70bdc14 c70bdc08
dc00: c02194cc c0218dfc c70bdc3c c70bdc18 c0022100 c0219468 00000008 00000001
dc20: c70bdc3c c70bdc24 c70bdc24 c708cc20 c70bdcb4 c70bdc40 c001222c c0021ad0
dc40: c70bc270 0000000b 7269762f 00000000 65000000 62633432 20343030 64343265
dc60: 63303064 35326520 30303430 61302030 30303030 28203331 34643565 34363033
dc80: c0002029 c0217dd8 c027dcbb bf05b504 c70bdea8 00000000 00000007 00000000
dca0: 00000007 00000000 c70bdcdc c70bdcb8 c0013808 c0011f80 00000000 c02d5ccc
dcc0: a0000013 c70bdea8 bf05b504 c708cb00 c70bddf4 c70bdce0 c0013b58 c00137a8
dce0: bf01dfcc bf0200c8 00000000 00000000 c70bddc4 c70bdd00 bf01f58c 00000028
dd00: c70bdd88 00000004 00000001 c708dbb0 00000000 00000004 00000002 c7a7e5e0
dd20: c708cb30 00000000 c708dbb0 00000000 c70bdd6c c70bdd40 c0040e34 c0040b20
dd40: c003f79c c021bf08 c02dc500 c708cb00 000000c3 00000001 00000001 00000001
dd60: c70bdd8c c70bdd70 c003e080 c0040d74 c003fb2c c708db80 00000000 40000093
dd80: c70bddac bf0203b0 00000100 c706d378 c70bddc4 c70bdda0 c0118064 c0117e6c
dda0: 00000001 00000004 00000000 c706d0b0 c02dc500 c706d0b0 00000000 c708cb00
ddc0: c708cb30 00000001 c706d0b0 c02d5ccc a0000013 00000007 c70bdea8 bf05b504
dde0: c0114700 00000000 c70bdea4 c70bddf8 c0008634 c0013838 00000003 00000000
de00: c70bde2c c70bde10 c003e080 c0040d74 c003fb2c c706d080 00000000 80000093
de20: c70bde4c c70bde30 c003fbc0 c003e05c 00000002 c7a73f70 00000bd3 000003e0
de40: c70bde70 c0113dc0 c003fbf8 c7a28780 c7a28730 c031fba0 c70bde98 c70bdec8
de60: c70bde8c c70bde70 c00dda98 c008cabc c7a28780 c7a28780 00020001 c70bde94
de80: c70bdec4 c011460c a0000013 ffffffff c70bdedc c7803a00 c70bdf0c c70bdea8
dea0: c000e458 c0008608 bf05b4a0 00000000 00000000 00000001 bf05b4a0 c79a0120
dec0: c02e1de0 c79257a0 c7803a00 c0114700 00000000 c70bdf0c c70bdf10 c70bdef0
dee0: c01146f4 c011460c a0000013 ffffffff c79a0100 c79a0120 c02e1de0 c79a0100
df00: c70bdf24 c70bdf10 c01146f4 c0114604 c01365bc c79a0100 c70bdf4c c70bdf28
df20: c01147f0 c01146a0 c0136640 c0136590 c79a0120 c785fd00 00000000 00000009
df40: c70bdf84 c70bdf50 c00318fc c0114710 c02dbf00 c7803a05 c02dbf00 c785fd00
df60: c02dbf00 c785fd00 00000009 c02dbf00 c785fd10 c70bc000 c70bdfbc c70bdf88
df80: c0032570 c00316c0 c7839edc c785fd10 c0032364 c70bdfcc c7839edc c785fd00
dfa0: c0032364 00000000 00000000 00000000 c70bdff4 c70bdfc0 c0037768 c0032374
dfc0: c7839edc 00000000 c785fd00 00000001 c70bdfd0 c70bdfd0 c7839edc c00376e0
dfe0: c0021ac0 00000013 00000000 c70bdff8 c0021ac0 c00376f0 00190021 00024ea8
Backtrace: 
[<c00371b4>] (kthread_data+0x0/0x18) from [<c0033974>] (wq_worker_sleeping+0x18/0xbc)
[<c003395c>] (wq_worker_sleeping+0x0/0xbc) from [<c0218ebc>] (__schedule+0xd0/0x37c)
 r4:00000001
[<c0218dec>] (__schedule+0x0/0x37c) from [<c02194cc>] (schedule+0x74/0x78)
[<c0219458>] (schedule+0x0/0x78) from [<c0022100>] (do_exit+0x640/0x670)
[<c0021ac0>] (do_exit+0x0/0x670) from [<c001222c>] (die+0x2bc/0x2fc)
[<c0011f70>] (die+0x0/0x2fc) from [<c0013808>] (__do_kernel_fault+0x70/0x90)
[<c0013798>] (__do_kernel_fault+0x0/0x90) from [<c0013b58>] (do_page_fault+0x330/0x354)
 r8:c708cb00 r7:bf05b504 r6:c70bdea8 r5:a0000013 r4:c02d5ccc
[<c0013828>] (do_page_fault+0x0/0x354) from [<c0008634>] (do_DataAbort+0x3c/0x9c)
[<c00085f8>] (do_DataAbort+0x0/0x9c) from [<c000e458>] (__dabt_svc+0x38/0x60)
Exception stack(0xc70bdea8 to 0xc70bdef0)
dea0:                   bf05b4a0 00000000 00000000 00000001 bf05b4a0 c79a0120
dec0: c02e1de0 c79257a0 c7803a00 c0114700 00000000 c70bdf0c c70bdf10 c70bdef0
dee0: c01146f4 c011460c a0000013 ffffffff
 r8:c7803a00 r7:c70bdedc r6:ffffffff r5:a0000013 r4:c011460c
[<c01145f4>] (kobject_put+0x0/0x7c) from [<c01146f4>] (kobject_del+0x64/0x70)
 r4:c79a0100
[<c0114690>] (kobject_del+0x0/0x70) from [<c01147f0>] (kobject_delayed_cleanup+0xf0/0x198)
 r4:c79a0100
[<c0114700>] (kobject_delayed_cleanup+0x0/0x198) from [<c00318fc>] (process_one_work+0x24c/0x3a8)
 r7:00000009 r6:00000000 r5:c785fd00 r4:c79a0120
[<c00316b0>] (process_one_work+0x0/0x3a8) from [<c0032570>] (worker_thread+0x20c/0x428)
[<c0032364>] (worker_thread+0x0/0x428) from [<c0037768>] (kthread+0x88/0x90)
[<c00376e0>] (kthread+0x0/0x90) from [<c0021ac0>] (do_exit+0x0/0x670)
 r7:00000013 r6:c0021ac0 r5:c00376e0 r4:c7839edc
Code: e1a0c00d e92dd800 e24cb004 e5903128 (e5130004) 
---[ end trace ddf7f4f6a0de23b9 ]---
Fixing recursive fault but reboot is needed!
Unable to handle kernel paging request at virtual address fffffffc
pgd = c0004000
[fffffffc] *pgd=37ffe831, *pte=00000000, *ppte=00000000
Internal error: Oops: 17 [#3]
Modules linked in: ohci_hcd leds_s3c24xx usbcore i2c_s3c2410 i2c_core s3c_hsudc
CPU: 0    Tainted: G      D       (3.2.0-rc5-next-20111216+ #32)
PC is at kthread_data+0x10/0x18
LR is at wq_worker_sleeping+0x18/0xbc
pc : [<c00371c4>]    lr : [<c0033974>]    psr: 20000093
sp : c70bd7c0  ip : c70bd7d0  fp : c70bd7cc
r10: c70bc000  r9 : c70bd7f8  r8 : c02dc500
r7 : c00371c8  r6 : c708cb00  r5 : c708cc54  r4 : 00000000
r3 : 00000000  r2 : c02dc500  r1 : 00000000  r0 : c708cb00
Flags: nzCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment user
Control: 0005317f  Table: 37014000  DAC: 00000015
Process kworker/0:1 (pid: 16, stack limit = 0xc70bc270)
Stack: (0xc70bd7c0 to 0xc70be000)
d7c0: c70bd7e4 c70bd7d0 c0033974 c00371c4 c003f760 0000000b c70bd86c c70bd7e8
d7e0: c0218ebc c003396c c0023cdc 60000013 ffffffff 60000013 c70bd824 c70bd808
d800: c005681c c0056718 0000001e 00000000 f6000000 c70bd894 c70bd834 c70bd828
d820: c0023e4c c00567c0 00000001 000bd838 00000004 0000000b c00371c6 c708cb00
d840: c00371c8 0000000b c00371c6 c708cb00 c00371c8 00000000 00000008 bf000000
d860: c70bd87c c70bd870 c02194cc c0218dfc c70bd8a4 c70bd880 c0021bd4 c0219468
d880: 00000008 bf000000 c70bd8a4 c70bd898 c001e49c c001e99c c70bd91c c70bd8a8
d8a0: c001222c c0021ad0 c70bc270 0000000b 028959e4 00000000 65000000 63306131
d8c0: 20643030 64323965 30303864 34326520 30306263 35652034 31333039 28203832
d8e0: 33313565 34303030 c0002029 c0217dd8 c027dcbb fffffffc c70bdb10 00000000
d900: 00000017 00000000 00000017 00000000 c70bd944 c70bd920 c0013808 c0011f80
d920: c0275aa3 c02d5ccc 20000093 c70bdb10 fffffffc c708cb00 c70bda5c c70bd948
d940: c0013b58 c00137a8 c011b37c c027a96d 00000000 00000670 c70bd9a9 0002340f
d960: c70bd994 00000028 c011a208 c0118ee8 c014b004 c03102e3 c03106b0 c03106b0
d980: c0275aa2 c03106b0 c70bda9c c70bd9a0 c011a584 c011a1d8 c011a550 ff0a0005
d9a0: ffffffff c70bd9b0 5f6f6474 74697865 3078302b 3678302f 30003037 38323478
d9c0: 00003800 31780038 00003839 c70bd9d8 c001e818 c001e70c 00001e0c 00001e0c
d9e0: c70bda1c c70bd9f0 c001f008 c003bd00 00000000 00000000 00000000 0000001f
da00: c70bda72 c03102b2 00000004 00000000 1b478423 c70bda50 c70bda24 c01198cc
da20: c01196d0 65300020 c70bda72 c03102b2 0000ffff c02d5ccc 20000093 00000017
da40: c70bdb10 fffffffc c70bdb90 c70bc000 c70bdb0c c70bda60 c0008634 c0013838
da60: c70bda84 c70bdaae c70bdb97 0000ffff 00000002 00000000 c0281b48 00000007
da80: c70bdb1c c70bda90 c0119ab8 c7826580 00000001 00000007 00000001 c78265b0
daa0: c02dc500 c78265b0 00000000 c708cb00 c708cb30 00000000 c78265b0 00000000
dac0: c70bdafc c70bdad0 c0040e5c c003e004 c003f79c c021bf08 c02dc500 c708cb00
dae0: c7826000 c02dc500 c70bdb90 c00371c4 20000093 ffffffff c70bdb44 c02dc500
db00: c70bdb64 c70bdb10 c000e458 c0008608 c708cb00 00000000 c02dc500 00000000
db20: 00000000 c708cc54 c708cb00 c7826000 c02dc500 c70bdb90 c70bc000 c70bdb64
db40: c70bdb68 c70bdb58 c0033974 c00371c4 20000093 ffffffff c70bdb7c c70bdb68
db60: c0033974 c00371c4 c003f760 00000001 c70bdc04 c70bdb80 c0218ebc c003396c
db80: c0406680 c70b4a40 00000664 c001c678 00000168 00000000 c70bdbcc c70bdba8
dba0: c008cb78 c008b680 c0034390 c708cb00 c70b8440 00000001 00000000 c70b4a40
dbc0: c70bdbdc c70bdbd0 c001c678 c708cb00 c70bdc14 c70bdbe0 c0020db4 00000001
dbe0: c70bdc24 c708cb00 c7826000 c708cbd8 c708caf8 c708cbd8 c70bdc14 c70bdc08
dc00: c02194cc c0218dfc c70bdc3c c70bdc18 c0022100 c0219468 00000008 00000001
dc20: c70bdc3c c70bdc24 c70bdc24 c708cc20 c70bdcb4 c70bdc40 c001222c c0021ad0
dc40: c70bc270 0000000b 7269762f 00000000 65000000 62633432 20343030 64343265
dc60: 63303064 35326520 30303430 61302030 30303030 28203331 34643565 34363033
dc80: c0002029 c0217dd8 c027dcbb bf05b504 c70bdea8 00000000 00000007 00000000
dca0: 00000007 00000000 c70bdcdc c70bdcb8 c0013808 c0011f80 00000000 c02d5ccc
dcc0: a0000013 c70bdea8 bf05b504 c708cb00 c70bddf4 c70bdce0 c0013b58 c00137a8
dce0: bf01dfcc bf0200c8 00000000 00000000 c70bddc4 c70bdd00 bf01f58c 00000028
dd00: c70bdd88 00000004 00000001 c708dbb0 00000000 00000004 00000002 c7a7e5e0
dd20: c708cb30 00000000 c708dbb0 00000000 c70bdd6c c70bdd40 c0040e34 c0040b20
dd40: c003f79c c021bf08 c02dc500 c708cb00 000000c3 00000001 00000001 00000001
dd60: c70bdd8c c70bdd70 c003e080 c0040d74 c003fb2c c708db80 00000000 40000093
dd80: c70bddac bf0203b0 00000100 c706d378 c70bddc4 c70bdda0 c0118064 c0117e6c
dda0: 00000001 00000004 00000000 c706d0b0 c02dc500 c706d0b0 00000000 c708cb00
ddc0: c708cb30 00000001 c706d0b0 c02d5ccc a0000013 00000007 c70bdea8 bf05b504
dde0: c0114700 00000000 c70bdea4 c70bddf8 c0008634 c0013838 00000003 00000000
de00: c70bde2c c70bde10 c003e080 c0040d74 c003fb2c c706d080 00000000 80000093
de20: c70bde4c c70bde30 c003fbc0 c003e05c 00000002 c7a73f70 00000bd3 000003e0
de40: c70bde70 c0113dc0 c003fbf8 c7a28780 c7a28730 c031fba0 c70bde98 c70bdec8
de60: c70bde8c c70bde70 c00dda98 c008cabc c7a28780 c7a28780 00020001 c70bde94
de80: c70bdec4 c011460c a0000013 ffffffff c70bdedc c7803a00 c70bdf0c c70bdea8
dea0: c000e458 c0008608 bf05b4a0 00000000 00000000 00000001 bf05b4a0 c79a0120
dec0: c02e1de0 c79257a0 c7803a00 c0114700 00000000 c70bdf0c c70bdf10 c70bdef0
dee0: c01146f4 c011460c a0000013 ffffffff c79a0100 c79a0120 c02e1de0 c79a0100
df00: c70bdf24 c70bdf10 c01146f4 c0114604 c01365bc c79a0100 c70bdf4c c70bdf28
df20: c01147f0 c01146a0 c0136640 c0136590 c79a0120 c785fd00 00000000 00000009
df40: c70bdf84 c70bdf50 c00318fc c0114710 c02dbf00 c7803a05 c02dbf00 c785fd00
df60: c02dbf00 c785fd00 00000009 c02dbf00 c785fd10 c70bc000 c70bdfbc c70bdf88
df80: c0032570 c00316c0 c7839edc c785fd10 c0032364 c70bdfcc c7839edc c785fd00
dfa0: c0032364 00000000 00000000 00000000 c70bdff4 c70bdfc0 c0037768 c0032374
dfc0: c7839edc 00000000 c785fd00 00000001 c70bdfd0 c70bdfd0 c7839edc c00376e0
dfe0: c0021ac0 00000013 00000000 c70bdff8 c0021ac0 c00376f0 00190021 00024ea8
Backtrace: 
[<c00371b4>] (kthread_data+0x0/0x18) from [<c0033974>] (wq_worker_sleeping+0x18/0xbc)
[<c003395c>] (wq_worker_sleeping+0x0/0xbc) from [<c0218ebc>] (__schedule+0xd0/0x37c)
 r4:0000000b
[<c0218dec>] (__schedule+0x0/0x37c) from [<c02194cc>] (schedule+0x74/0x78)
[<c0219458>] (schedule+0x0/0x78) from [<c0021bd4>] (do_exit+0x114/0x670)
[<c0021ac0>] (do_exit+0x0/0x670) from [<c001222c>] (die+0x2bc/0x2fc)
[<c0011f70>] (die+0x0/0x2fc) from [<c0013808>] (__do_kernel_fault+0x70/0x90)
[<c0013798>] (__do_kernel_fault+0x0/0x90) from [<c0013b58>] (do_page_fault+0x330/0x354)
 r8:c708cb00 r7:fffffffc r6:c70bdb10 r5:20000093 r4:c02d5ccc
[<c0013828>] (do_page_fault+0x0/0x354) from [<c0008634>] (do_DataAbort+0x3c/0x9c)
[<c00085f8>] (do_DataAbort+0x0/0x9c) from [<c000e458>] (__dabt_svc+0x38/0x60)
Exception stack(0xc70bdb10 to 0xc70bdb58)
db00:                                     c708cb00 00000000 c02dc500 00000000
db20: 00000000 c708cc54 c708cb00 c7826000 c02dc500 c70bdb90 c70bc000 c70bdb64
db40: c70bdb68 c70bdb58 c0033974 c00371c4 20000093 ffffffff
 r8:c02dc500 r7:c70bdb44 r6:ffffffff r5:20000093 r4:c00371c4
[<c00371b4>] (kthread_data+0x0/0x18) from [<c0033974>] (wq_worker_sleeping+0x18/0xbc)
[<c003395c>] (wq_worker_sleeping+0x0/0xbc) from [<c0218ebc>] (__schedule+0xd0/0x37c)
 r4:00000001
[<c0218dec>] (__schedule+0x0/0x37c) from [<c02194cc>] (schedule+0x74/0x78)
[<c0219458>] (schedule+0x0/0x78) from [<c0022100>] (do_exit+0x640/0x670)
[<c0021ac0>] (do_exit+0x0/0x670) from [<c001222c>] (die+0x2bc/0x2fc)
[<c0011f70>] (die+0x0/0x2fc) from [<c0013808>] (__do_kernel_fault+0x70/0x90)
[<c0013798>] (__do_kernel_fault+0x0/0x90) from [<c0013b58>] (do_page_fault+0x330/0x354)
 r8:c708cb00 r7:bf05b504 r6:c70bdea8 r5:a0000013 r4:c02d5ccc
[<c0013828>] (do_page_fault+0x0/0x354) from [<c0008634>] (do_DataAbort+0x3c/0x9c)
[<c00085f8>] (do_DataAbort+0x0/0x9c) from [<c000e458>] (__dabt_svc+0x38/0x60)
Exception stack(0xc70bdea8 to 0xc70bdef0)
dea0:                   bf05b4a0 00000000 00000000 00000001 bf05b4a0 c79a0120
dec0: c02e1de0 c79257a0 c7803a00 c0114700 00000000 c70bdf0c c70bdf10 c70bdef0
dee0: c01146f4 c011460c a0000013 ffffffff
 r8:c7803a00 r7:c70bdedc r6:ffffffff r5:a0000013 r4:c011460c
[<c01145f4>] (kobject_put+0x0/0x7c) from [<c01146f4>] (kobject_del+0x64/0x70)
 r4:c79a0100
[<c0114690>] (kobject_del+0x0/0x70) from [<c01147f0>] (kobject_delayed_cleanup+0xf0/0x198)
 r4:c79a0100
[<c0114700>] (kobject_delayed_cleanup+0x0/0x198) from [<c00318fc>] (process_one_work+0x24c/0x3a8)
 r7:00000009 r6:00000000 r5:c785fd00 r4:c79a0120
[<c00316b0>] (process_one_work+0x0/0x3a8) from [<c0032570>] (worker_thread+0x20c/0x428)
[<c0032364>] (worker_thread+0x0/0x428) from [<c0037768>] (kthread+0x88/0x90)
[<c00376e0>] (kthread+0x0/0x90) from [<c0021ac0>] (do_exit+0x0/0x670)
 r7:00000013 r6:c0021ac0 r5:c00376e0 r4:c7839edc
Code: e1a0c00d e92dd800 e24cb004 e5903128 (e5130004) 
---[ end trace ddf7f4f6a0de23ba ]---
Fixing recursive fault but reboot is needed!
Unable to handle kernel paging request at virtual address fffffffc
pgd = c0004000
[fffffffc] *pgd=37ffe831, *pte=00000000, *ppte=00000000
Internal error: Oops: 17 [#4]
Modules linked in: ohci_hcd leds_s3c24xx usbcore i2c_s3c2410 i2c_core s3c_hsudc
CPU: 0    Tainted: G      D       (3.2.0-rc5-next-20111216+ #32)
PC is at kthread_data+0x10/0x18
LR is at wq_worker_sleeping+0x18/0xbc
pc : [<c00371c4>]    lr : [<c0033974>]    psr: 20000093
sp : c70bd428  ip : c70bd438  fp : c70bd434
r10: c70bc000  r9 : c70bd460  r8 : c02dc500
r7 : c00371c8  r6 : c708cb00  r5 : c708cc54  r4 : 00000000
r3 : 00000000  r2 : c02dc500  r1 : 00000000  r0 : c708cb00
Flags: nzCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment user
Control: 0005317f  Table: 37014000  DAC: 00000015
Process kworker/0:1 (pid: 16, stack limit = 0xc70bc270)
Stack: (0xc70bd428 to 0xc70be000)
d420:                   c70bd44c c70bd438 c0033974 c00371c4 c003f760 0000000b
d440: c70bd4d4 c70bd450 c0218ebc c003396c c0023cdc 60000013 ffffffff 60000013
d460: c70bd48c c70bd470 c005681c c0056718 0000001e 00000000 f6000000 c70bd4fc
d480: c70bd49c c70bd490 c0023e4c c00567c0 00000001 000bd4a0 00000004 0000000b
d4a0: c00371c6 c708cb00 c00371c8 0000000b c00371c6 c708cb00 c00371c8 00000000
d4c0: 00000008 bf000000 c70bd4e4 c70bd4d8 c02194cc c0218dfc c70bd50c c70bd4e8
d4e0: c0021bd4 c0219468 00000008 bf000000 c70bd50c c70bd500 c001e49c c001e99c
d500: c70bd584 c70bd510 c001222c c0021ad0 c70bc270 0000000b 00003164 00000000
d520: 65000000 63306131 20643030 64323965 30303864 34326520 30306263 35652034
d540: 31333039 28203832 33313565 34303030 c0002029 c0217dd8 c027dcbb fffffffc
d560: c70bd778 00000000 00000017 00000000 00000017 00000000 c70bd5ac c70bd588
d580: c0013808 c0011f80 c0275aa3 c02d5ccc 20000093 c70bd778 fffffffc c708cb00
d5a0: c70bd6c4 c70bd5b0 c0013b58 c00137a8 c011b37c c027a96d 00000000 00000670
d5c0: c70bd611 00000030 c70bd5fc 00000028 c011a208 c0118ee8 c014b004 c03102e3
d5e0: c03106b0 c03106b0 c0275aa2 c03106b0 c70bd704 c70bd608 c011a584 c011a1d8
d600: c011a550 ff0a0005 ffffffff c70bd618 5f6f6474 74697865 3078302b 3678302f
d620: 30003037 38323478 00003800 31780038 c70bc000 00000000 005b8d80 00000000
d640: c708cb30 c70bd7cc c70bd67c c70bd658 c0040818 c00406b4 00000c00 00155555
d660: c02dfe08 c02dfd74 c70bc000 c708cb30 c70bd69c c70bd674 c70bd674 c708cb00
d680: c70bd7cc c02ddbb0 c031e888 c70bc000 00000000 c708cb00 c70bd7cc c02d5ccc
d6a0: 20000093 00000017 c70bd778 fffffffc c70bd7f8 c70bc000 c70bd774 c70bd6c8
d6c0: c0008634 c0013838 c70bd724 c70bd6d8 c0028b4c c003aa98 00000001 00000001
d6e0: c02ddbb0 c70bd6f0 c031122c c031102c c70bd6f0 c70bd6f0 00000010 00000001
d700: 00000100 c70bc000 00000004 00000001 00000001 00000100 c70bd75c 0000002c
d720: c70bd754 c70bd730 c014b004 c014dc28 c70bd75c c02e6290 00003cd6 0000002d
d740: c02daa48 c02daa50 c70bd764 c70bd758 c014e9ac c00371c4 20000093 ffffffff
d760: c70bd7ac c02dc500 c70bd7cc c70bd778 c000e458 c0008608 c708cb00 00000000
d780: c02dc500 00000000 00000000 c708cc54 c708cb00 c00371c8 c02dc500 c70bd7f8
d7a0: c70bc000 c70bd7cc c70bd7d0 c70bd7c0 c0033974 c00371c4 20000093 ffffffff
d7c0: c70bd7e4 c70bd7d0 c0033974 c00371c4 c003f760 0000000b c70bd86c c70bd7e8
d7e0: c0218ebc c003396c c0023cdc 60000013 ffffffff 60000013 c70bd824 c70bd808
d800: c005681c c0056718 0000001e 00000000 f6000000 c70bd894 c70bd834 c70bd828
d820: c0023e4c c00567c0 00000001 000bd838 00000004 0000000b c00371c6 c708cb00
d840: c00371c8 0000000b c00371c6 c708cb00 c00371c8 00000000 00000008 bf000000
d860: c70bd87c c70bd870 c02194cc c0218dfc c70bd8a4 c70bd880 c0021bd4 c0219468
d880: 00000008 bf000000 c70bd8a4 c70bd898 c001e49c c001e99c c70bd91c c70bd8a8
d8a0: c001222c c0021ad0 c70bc270 0000000b 028959e4 00000000 65000000 63306131
d8c0: 20643030 64323965 30303864 34326520 30306263 35652034 31333039 28203832
d8e0: 33313565 34303030 c0002029 c0217dd8 c027dcbb fffffffc c70bdb10 00000000
d900: 00000017 00000000 00000017 00000000 c70bd944 c70bd920 c0013808 c0011f80
d920: c0275aa3 c02d5ccc 20000093 c70bdb10 fffffffc c708cb00 c70bda5c c70bd948
d940: c0013b58 c00137a8 c011b37c c027a96d 00000000 00000670 c70bd9a9 0002340f
d960: c70bd994 00000028 c011a208 c0118ee8 c014b004 c03102e3 c03106b0 c03106b0
d980: c0275aa2 c03106b0 c70bda9c c70bd9a0 c011a584 c011a1d8 c011a550 ff0a0005
d9a0: ffffffff c70bd9b0 5f6f6474 74697865 3078302b 3678302f 30003037 38323478
d9c0: 00003800 31780038 00003839 c70bd9d8 c001e818 c001e70c 00001e0c 00001e0c
d9e0: c70bda1c c70bd9f0 c001f008 c003bd00 00000000 00000000 00000000 0000001f
da00: c70bda72 c03102b2 00000004 00000000 1b478423 c70bda50 c70bda24 c01198cc
da20: c01196d0 65300020 c70bda72 c03102b2 0000ffff c02d5ccc 20000093 00000017
da40: c70bdb10 fffffffc c70bdb90 c70bc000 c70bdb0c c70bda60 c0008634 c0013838
da60: c70bda84 c70bdaae c70bdb97 0000ffff 00000002 00000000 c0281b48 00000007
da80: c70bdb1c c70bda90 c0119ab8 c7826580 00000001 00000007 00000001 c78265b0
daa0: c02dc500 c78265b0 00000000 c708cb00 c708cb30 00000000 c78265b0 00000000
dac0: c70bdafc c70bdad0 c0040e5c c003e004 c003f79c c021bf08 c02dc500 c708cb00
dae0: c7826000 c02dc500 c70bdb90 c00371c4 20000093 ffffffff c70bdb44 c02dc500
db00: c70bdb64 c70bdb10 c000e458 c0008608 c708cb00 00000000 c02dc500 00000000
db20: 00000000 c708cc54 c708cb00 c7826000 c02dc500 c70bdb90 c70bc000 c70bdb64
db40: c70bdb68 c70bdb58 c0033974 c00371c4 20000093 ffffffff c70bdb7c c70bdb68
db60: c0033974 c00371c4 c003f760 00000001 c70bdc04 c70bdb80 c0218ebc c003396c
db80: c0406680 c70b4a40 00000664 c001c678 00000168 00000000 c70bdbcc c70bdba8
dba0: c008cb78 c008b680 c0034390 c708cb00 c70b8440 00000001 00000000 c70b4a40
dbc0: c70bdbdc c70bdbd0 c001c678 c708cb00 c70bdc14 c70bdbe0 c0020db4 00000001
dbe0: c70bdc24 c708cb00 c7826000 c708cbd8 c708caf8 c708cbd8 c70bdc14 c70bdc08
dc00: c02194cc c0218dfc c70bdc3c c70bdc18 c0022100 c0219468 00000008 00000001
dc20: c70bdc3c c70bdc24 c70bdc24 c708cc20 c70bdcb4 c70bdc40 c001222c c0021ad0
dc40: c70bc270 0000000b 7269762f 00000000 65000000 62633432 20343030 64343265
dc60: 63303064 35326520 30303430 61302030 30303030 28203331 34643565 34363033
dc80: c0002029 c0217dd8 c027dcbb bf05b504 c70bdea8 00000000 00000007 00000000
dca0: 00000007 00000000 c70bdcdc c70bdcb8 c0013808 c0011f80 00000000 c02d5ccc
dcc0: a0000013 c70bdea8 bf05b504 c708cb00 c70bddf4 c70bdce0 c0013b58 c00137a8
dce0: bf01dfcc bf0200c8 00000000 00000000 c70bddc4 c70bdd00 bf01f58c 00000028
dd00: c70bdd88 00000004 00000001 c708dbb0 00000000 00000004 00000002 c7a7e5e0
dd20: c708cb30 00000000 c708dbb0 00000000 c70bdd6c c70bdd40 c0040e34 c0040b20
dd40: c003f79c c021bf08 c02dc500 c708cb00 000000c3 00000001 00000001 00000001
dd60: c70bdd8c c70bdd70 c003e080 c0040d74 c003fb2c c708db80 00000000 40000093
dd80: c70bddac bf0203b0 00000100 c706d378 c70bddc4 c70bdda0 c0118064 c0117e6c
dda0: 00000001 00000004 00000000 c706d0b0 c02dc500 c706d0b0 00000000 c708cb00
ddc0: c708cb30 00000001 c706d0b0 c02d5ccc a0000013 00000007 c70bdea8 bf05b504
dde0: c0114700 00000000 c70bdea4 c70bddf8 c0008634 c0013838 00000003 00000000
de00: c70bde2c c70bde10 c003e080 c0040d74 c003fb2c c706d080 00000000 80000093
de20: c70bde4c c70bde30 c003fbc0 c003e05c 00000002 c7a73f70 00000bd3 000003e0
de40: c70bde70 c0113dc0 c003fbf8 c7a28780 c7a28730 c031fba0 c70bde98 c70bdec8
de60: c70bde8c c70bde70 c00dda98 c008cabc c7a28780 c7a28780 00020001 c70bde94
de80: c70bdec4 c011460c a0000013 ffffffff c70bdedc c7803a00 c70bdf0c c70bdea8
dea0: c000e458 c0008608 bf05b4a0 00000000 00000000 00000001 bf05b4a0 c79a0120
dec0: c02e1de0 c79257a0 c7803a00 c0114700 00000000 c70bdf0c c70bdf10 c70bdef0
dee0: c01146f4 c011460c a0000013 ffffffff c79a0100 c79a0120 c02e1de0 c79a0100
df00: c70bdf24 c70bdf10 c01146f4 c0114604 c01365bc c79a0100 c70bdf4c c70bdf28
df20: c01147f0 c01146a0 c0136640 c0136590 c79a0120 c785fd00 00000000 00000009
df40: c70bdf84 c70bdf50 c00318fc c0114710 c02dbf00 c7803a05 c02dbf00 c785fd00
df60: c02dbf00 c785fd00 00000009 c02dbf00 c785fd10 c70bc000 c70bdfbc c70bdf88
df80: c0032570 c00316c0 c7839edc c785fd10 c0032364 c70bdfcc c7839edc c785fd00
dfa0: c0032364 00000000 00000000 00000000 c70bdff4 c70bdfc0 c0037768 c0032374
dfc0: c7839edc 00000000 c785fd00 00000001 c70bdfd0 c70bdfd0 c7839edc c00376e0
dfe0: c0021ac0 00000013 00000000 c70bdff8 c0021ac0 c00376f0 00190021 00024ea8
Backtrace: 
[<c00371b4>] (kthread_data+0x0/0x18) from [<c0033974>] (wq_worker_sleeping+0x18/0xbc)
[<c003395c>] (wq_worker_sleeping+0x0/0xbc) from [<c0218ebc>] (__schedule+0xd0/0x37c)
 r4:0000000b
[<c0218dec>] (__schedule+0x0/0x37c) from [<c02194cc>] (schedule+0x74/0x78)
[<c0219458>] (schedule+0x0/0x78) from [<c0021bd4>] (do_exit+0x114/0x670)
[<c0021ac0>] (do_exit+0x0/0x670) from [<c001222c>] (die+0x2bc/0x2fc)
[<c0011f70>] (die+0x0/0x2fc) from [<c0013808>] (__do_kernel_fault+0x70/0x90)
[<c0013798>] (__do_kernel_fault+0x0/0x90) from [<c0013b58>] (do_page_fault+0x330/0x354)
 r8:c708cb00 r7:fffffffc r6:c70bd778 r5:20000093 r4:c02d5ccc
[<c0013828>] (do_page_fault+0x0/0x354) from [<c0008634>] (do_DataAbort+0x3c/0x9c)
[<c00085f8>] (do_DataAbort+0x0/0x9c) from [<c000e458>] (__dabt_svc+0x38/0x60)
Exception stack(0xc70bd778 to 0xc70bd7c0)
d760:                                                       c708cb00 00000000
d780: c02dc500 00000000 00000000 c708cc54 c708cb00 c00371c8 c02dc500 c70bd7f8
d7a0: c70bc000 c70bd7cc c70bd7d0 c70bd7c0 c0033974 c00371c4 20000093 ffffffff
 r8:c02dc500 r7:c70bd7ac r6:ffffffff r5:20000093 r4:c00371c4
[<c00371b4>] (kthread_data+0x0/0x18) from [<c0033974>] (wq_worker_sleeping+0x18/0xbc)
[<c003395c>] (wq_worker_sleeping+0x0/0xbc) from [<c0218ebc>] (__schedule+0xd0/0x37c)
 r4:0000000b
[<c0218dec>] (__schedule+0x0/0x37c) from [<c02194cc>] (schedule+0x74/0x78)
[<c0219458>] (schedule+0x0/0x78) from [<c0021bd4>] (do_exit+0x114/0x670)
[<c0021ac0>] (do_exit+0x0/0x670) from [<c001222c>] (die+0x2bc/0x2fc)
[<c0011f70>] (die+0x0/0x2fc) from [<c0013808>] (__do_kernel_fault+0x70/0x90)
[<c0013798>] (__do_kernel_fault+0x0/0x90) from [<c0013b58>] (do_page_fault+0x330/0x354)
 r8:c708cb00 r7:fffffffc r6:c70bdb10 r5:20000093 r4:c02d5ccc
[<c0013828>] (do_page_fault+0x0/0x354) from [<c0008634>] (do_DataAbort+0x3c/0x9c)
[<c00085f8>] (do_DataAbort+0x0/0x9c) from [<c000e458>] (__dabt_svc+0x38/0x60)
Exception stack(0xc70bdb10 to 0xc70bdb58)
db00:                                     c708cb00 00000000 c02dc500 00000000
db20: 00000000 c708cc54 c708cb00 c7826000 c02dc500 c70bdb90 c70bc000 c70bdb64
db40: c70bdb68 c70bdb58 c0033974 c00371c4 20000093 ffffffff
 r8:c02dc500 r7:c70bdb44 r6:ffffffff r5:20000093 r4:c00371c4
[<c00371b4>] (kthread_data+0x0/0x18) from [<c0033974>] (wq_worker_sleeping+0x18/0xbc)
[<c003395c>] (wq_worker_sleeping+0x0/0xbc) from [<c0218ebc>] (__schedule+0xd0/0x37c)
 r4:00000001
[<c0218dec>] (__schedule+0x0/0x37c) from [<c02194cc>] (schedule+0x74/0x78)
[<c0219458>] (schedule+0x0/0x78) from [<c0022100>] (do_exit+0x640/0x670)
[<c0021ac0>] (do_exit+0x0/0x670) from [<c001222c>] (die+0x2bc/0x2fc)
[<c0011f70>] (die+0x0/0x2fc) from [<c0013808>] (__do_kernel_fault+0x70/0x90)
[<c0013798>] (__do_kernel_fault+0x0/0x90) from [<c0013b58>] (do_page_fault+0x330/0x354)
 r8:c708cb00 r7:bf05b504 r6:c70bdea8 r5:a0000013 r4:c02d5ccc
[<c0013828>] (do_page_fault+0x0/0x354) from [<c0008634>] (do_DataAbort+0x3c/0x9c)
[<c00085f8>] (do_DataAbort+0x0/0x9c) from [<c000e458>] (__dabt_svc+0x38/0x60)
Exception stack(0xc70bdea8 to 0xc70bdef0)
dea0:                   bf05b4a0 00000000 00000000 00000001 bf05b4a0 c79a0120
dec0: c02e1de0 c79257a0 c7803a00 c0114700 00000000 c70bdf0c c70bdf10 c70bdef0
dee0: c01146f4 c011460c a0000013 ffffffff
 r8:c7803a00 r7:c70bdedc r6:ffffffff r5:a0000013 r4:c011460c
[<c01145f4>] (kobject_put+0x0/0x7c) from [<c01146f4>] (kobject_del+0x64/0x70)
 r4:c79a0100
[<c0114690>] (kobject_del+0x0/0x70) from [<c01147f0>] (kobject_delayed_cleanup+0xf0/0x198)
 r4:c79a0100
[<c0114700>] (kobject_delayed_cleanup+0x0/0x198) from [<c00318fc>] (process_one_work+0x24c/0x3a8)
 r7:00000009 r6:00000000 r5:c785fd00 r4:c79a0120
[<c00316b0>] (process_one_work+0x0/0x3a8) from [<c0032570>] (worker_thread+0x20c/0x428)
[<c0032364>] (worker_thread+0x0/0x428) from [<c0037768>] (kthread+0x88/0x90)
[<c00376e0>] (kthread+0x0/0x90) from [<c0021ac0>] (do_exit+0x0/0x670)
 r7:00000013 r6:c0021ac0 r5:c00376e0 r4:c7839edc
Code: e1a0c00d e92dd800 e24cb004 e5903128 (e5130004) 
---[ end trace ddf7f4f6a0de23bb ]---

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

* Re: [PATCH 3/7] s3c-hsudc: add a remove function
  2011-12-18 18:50           ` Heiko Stübner
@ 2011-12-18 19:01               ` Russell King - ARM Linux
  -1 siblings, 0 replies; 48+ messages in thread
From: Russell King - ARM Linux @ 2011-12-18 19:01 UTC (permalink / raw)
  To: Heiko Stübner
  Cc: Greg KH, Felipe Balbi, Kukjin Kim,
	linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
	linux-usb-u79uwXL29TY76Z2rM5mHXA, Thomas Abraham,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Sun, Dec 18, 2011 at 07:50:37PM +0100, Heiko Stübner wrote:
> I didn't get this far. With your patch the Oopses already happen during
> the startup of the system / the loading of the modules.
> 
> A bit of the message spew I got during testing with linux-next-20111216:

In some way, this is a good thing because it's showing that there's
problems with kobject lifetime rules.

The #2 and further oops dumps are a result of corrupting the work
queues as a result of #1, so #2 onwards should be ignored.

I suspect if you avoid loading the s3c_hsudc module these will go away.

> 
> pgd = c0004000
> [bf05b504] *pgd=379af811, *pte=00000000, *ppte=00000000
> Internal error: Oops: 7 [#1]
> Modules linked in: ohci_hcd leds_s3c24xx usbcore i2c_s3c2410 i2c_core s3c_hsudc
> CPU: 0    Not tainted  (3.2.0-rc5-next-20111216+ #32)
> PC is at kobject_put+0x18/0x7c
> LR is at kobject_del+0x64/0x70
> pc : [<c011460c>]    lr : [<c01146f4>]    psr: a0000013
> sp : c70bdef0  ip : c70bdf10  fp : c70bdf0c
> r10: 00000000  r9 : c0114700  r8 : c7803a00
> r7 : c79257a0  r6 : c02e1de0  r5 : c79a0120  r4 : bf05b4a0
> r3 : 00000001  r2 : 00000000  r1 : 00000000  r0 : bf05b4a0
> Flags: NzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
> Control: 0005317f  Table: 37014000  DAC: 00000017
> Process kworker/0:1 (pid: 16, stack limit = 0xc70bc270)
> Stack: (0xc70bdef0 to 0xc70be000)
> dee0:                                     c79a0100 c79a0120 c02e1de0 c79a0100
> df00: c70bdf24 c70bdf10 c01146f4 c0114604 c01365bc c79a0100 c70bdf4c c70bdf28
> df20: c01147f0 c01146a0 c0136640 c0136590 c79a0120 c785fd00 00000000 00000009
> df40: c70bdf84 c70bdf50 c00318fc c0114710 c02dbf00 c7803a05 c02dbf00 c785fd00
> df60: c02dbf00 c785fd00 00000009 c02dbf00 c785fd10 c70bc000 c70bdfbc c70bdf88
> df80: c0032570 c00316c0 c7839edc c785fd10 c0032364 c70bdfcc c7839edc c785fd00
> dfa0: c0032364 00000000 00000000 00000000 c70bdff4 c70bdfc0 c0037768 c0032374
> dfc0: c7839edc 00000000 c785fd00 00000000 c70bdfd0 c70bdfd0 c7839edc c00376e0
> dfe0: c0021ac0 00000013 00000000 c70bdff8 c0021ac0 c00376f0 00190021 00024ea8
> Backtrace: 
> [<c01145f4>] (kobject_put+0x0/0x7c) from [<c01146f4>] (kobject_del+0x64/0x70)
>  r4:c79a0100
> [<c0114690>] (kobject_del+0x0/0x70) from [<c01147f0>] (kobject_delayed_cleanup+0xf0/0x198)
>  r4:c79a0100
> [<c0114700>] (kobject_delayed_cleanup+0x0/0x198) from [<c00318fc>] (process_one_work+0x24c/0x3a8)
>  r7:00000009 r6:00000000 r5:c785fd00 r4:c79a0120
> [<c00316b0>] (process_one_work+0x0/0x3a8) from [<c0032570>] (worker_thread+0x20c/0x428)
> [<c0032364>] (worker_thread+0x0/0x428) from [<c0037768>] (kthread+0x88/0x90)
> [<c00376e0>] (kthread+0x0/0x90) from [<c0021ac0>] (do_exit+0x0/0x670)
>  r7:00000013 r6:c0021ac0 r5:c00376e0 r4:c7839edc
> Code: e24cb004 e24dd00c e2504000 0a000013 (e5d43064) 
> ---[ end trace ddf7f4f6a0de23b8 ]---
> Unable to handle kernel paging request at virtual address fffffffc
> pgd = c0004000
> [fffffffc] *pgd=37ffe831, *pte=00000000, *ppte=00000000
> Internal error: Oops: 17 [#2]
> Modules linked in: ohci_hcd leds_s3c24xx usbcore i2c_s3c2410 i2c_core s3c_hsudc
> CPU: 0    Tainted: G      D       (3.2.0-rc5-next-20111216+ #32)
> PC is at kthread_data+0x10/0x18
> LR is at wq_worker_sleeping+0x18/0xbc
> pc : [<c00371c4>]    lr : [<c0033974>]    psr: 20000093
> sp : c70bdb58  ip : c70bdb68  fp : c70bdb64
> r10: c70bc000  r9 : c70bdb90  r8 : c02dc500
> r7 : c7826000  r6 : c708cb00  r5 : c708cc54  r4 : 00000000
> r3 : 00000000  r2 : c02dc500  r1 : 00000000  r0 : c708cb00
> Flags: nzCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment user
> Control: 0005317f  Table: 37014000  DAC: 00000015
> Process kworker/0:1 (pid: 16, stack limit = 0xc70bc270)
> Stack: (0xc70bdb58 to 0xc70be000)
> db40:                                                       c70bdb7c c70bdb68
> db60: c0033974 c00371c4 c003f760 00000001 c70bdc04 c70bdb80 c0218ebc c003396c
> db80: c0406680 c70b4a40 00000664 c001c678 00000168 00000000 c70bdbcc c70bdba8
> dba0: c008cb78 c008b680 c0034390 c708cb00 c70b8440 00000001 00000000 c70b4a40
> dbc0: c70bdbdc c70bdbd0 c001c678 c708cb00 c70bdc14 c70bdbe0 c0020db4 00000001
> dbe0: c70bdc24 c708cb00 c7826000 c708cbd8 c708caf8 c708cbd8 c70bdc14 c70bdc08
> dc00: c02194cc c0218dfc c70bdc3c c70bdc18 c0022100 c0219468 00000008 00000001
> dc20: c70bdc3c c70bdc24 c70bdc24 c708cc20 c70bdcb4 c70bdc40 c001222c c0021ad0
> dc40: c70bc270 0000000b 7269762f 00000000 65000000 62633432 20343030 64343265
> dc60: 63303064 35326520 30303430 61302030 30303030 28203331 34643565 34363033
> dc80: c0002029 c0217dd8 c027dcbb bf05b504 c70bdea8 00000000 00000007 00000000
> dca0: 00000007 00000000 c70bdcdc c70bdcb8 c0013808 c0011f80 00000000 c02d5ccc
> dcc0: a0000013 c70bdea8 bf05b504 c708cb00 c70bddf4 c70bdce0 c0013b58 c00137a8
> dce0: bf01dfcc bf0200c8 00000000 00000000 c70bddc4 c70bdd00 bf01f58c 00000028
> dd00: c70bdd88 00000004 00000001 c708dbb0 00000000 00000004 00000002 c7a7e5e0
> dd20: c708cb30 00000000 c708dbb0 00000000 c70bdd6c c70bdd40 c0040e34 c0040b20
> dd40: c003f79c c021bf08 c02dc500 c708cb00 000000c3 00000001 00000001 00000001
> dd60: c70bdd8c c70bdd70 c003e080 c0040d74 c003fb2c c708db80 00000000 40000093
> dd80: c70bddac bf0203b0 00000100 c706d378 c70bddc4 c70bdda0 c0118064 c0117e6c
> dda0: 00000001 00000004 00000000 c706d0b0 c02dc500 c706d0b0 00000000 c708cb00
> ddc0: c708cb30 00000001 c706d0b0 c02d5ccc a0000013 00000007 c70bdea8 bf05b504
> dde0: c0114700 00000000 c70bdea4 c70bddf8 c0008634 c0013838 00000003 00000000
> de00: c70bde2c c70bde10 c003e080 c0040d74 c003fb2c c706d080 00000000 80000093
> de20: c70bde4c c70bde30 c003fbc0 c003e05c 00000002 c7a73f70 00000bd3 000003e0
> de40: c70bde70 c0113dc0 c003fbf8 c7a28780 c7a28730 c031fba0 c70bde98 c70bdec8
> de60: c70bde8c c70bde70 c00dda98 c008cabc c7a28780 c7a28780 00020001 c70bde94
> de80: c70bdec4 c011460c a0000013 ffffffff c70bdedc c7803a00 c70bdf0c c70bdea8
> dea0: c000e458 c0008608 bf05b4a0 00000000 00000000 00000001 bf05b4a0 c79a0120
> dec0: c02e1de0 c79257a0 c7803a00 c0114700 00000000 c70bdf0c c70bdf10 c70bdef0
> dee0: c01146f4 c011460c a0000013 ffffffff c79a0100 c79a0120 c02e1de0 c79a0100
> df00: c70bdf24 c70bdf10 c01146f4 c0114604 c01365bc c79a0100 c70bdf4c c70bdf28
> df20: c01147f0 c01146a0 c0136640 c0136590 c79a0120 c785fd00 00000000 00000009
> df40: c70bdf84 c70bdf50 c00318fc c0114710 c02dbf00 c7803a05 c02dbf00 c785fd00
> df60: c02dbf00 c785fd00 00000009 c02dbf00 c785fd10 c70bc000 c70bdfbc c70bdf88
> df80: c0032570 c00316c0 c7839edc c785fd10 c0032364 c70bdfcc c7839edc c785fd00
> dfa0: c0032364 00000000 00000000 00000000 c70bdff4 c70bdfc0 c0037768 c0032374
> dfc0: c7839edc 00000000 c785fd00 00000001 c70bdfd0 c70bdfd0 c7839edc c00376e0
> dfe0: c0021ac0 00000013 00000000 c70bdff8 c0021ac0 c00376f0 00190021 00024ea8
> Backtrace: 
> [<c00371b4>] (kthread_data+0x0/0x18) from [<c0033974>] (wq_worker_sleeping+0x18/0xbc)
> [<c003395c>] (wq_worker_sleeping+0x0/0xbc) from [<c0218ebc>] (__schedule+0xd0/0x37c)
>  r4:00000001
> [<c0218dec>] (__schedule+0x0/0x37c) from [<c02194cc>] (schedule+0x74/0x78)
> [<c0219458>] (schedule+0x0/0x78) from [<c0022100>] (do_exit+0x640/0x670)
> [<c0021ac0>] (do_exit+0x0/0x670) from [<c001222c>] (die+0x2bc/0x2fc)
> [<c0011f70>] (die+0x0/0x2fc) from [<c0013808>] (__do_kernel_fault+0x70/0x90)
> [<c0013798>] (__do_kernel_fault+0x0/0x90) from [<c0013b58>] (do_page_fault+0x330/0x354)
>  r8:c708cb00 r7:bf05b504 r6:c70bdea8 r5:a0000013 r4:c02d5ccc
> [<c0013828>] (do_page_fault+0x0/0x354) from [<c0008634>] (do_DataAbort+0x3c/0x9c)
> [<c00085f8>] (do_DataAbort+0x0/0x9c) from [<c000e458>] (__dabt_svc+0x38/0x60)
> Exception stack(0xc70bdea8 to 0xc70bdef0)
> dea0:                   bf05b4a0 00000000 00000000 00000001 bf05b4a0 c79a0120
> dec0: c02e1de0 c79257a0 c7803a00 c0114700 00000000 c70bdf0c c70bdf10 c70bdef0
> dee0: c01146f4 c011460c a0000013 ffffffff
>  r8:c7803a00 r7:c70bdedc r6:ffffffff r5:a0000013 r4:c011460c
> [<c01145f4>] (kobject_put+0x0/0x7c) from [<c01146f4>] (kobject_del+0x64/0x70)
>  r4:c79a0100
> [<c0114690>] (kobject_del+0x0/0x70) from [<c01147f0>] (kobject_delayed_cleanup+0xf0/0x198)
>  r4:c79a0100
> [<c0114700>] (kobject_delayed_cleanup+0x0/0x198) from [<c00318fc>] (process_one_work+0x24c/0x3a8)
>  r7:00000009 r6:00000000 r5:c785fd00 r4:c79a0120
> [<c00316b0>] (process_one_work+0x0/0x3a8) from [<c0032570>] (worker_thread+0x20c/0x428)
> [<c0032364>] (worker_thread+0x0/0x428) from [<c0037768>] (kthread+0x88/0x90)
> [<c00376e0>] (kthread+0x0/0x90) from [<c0021ac0>] (do_exit+0x0/0x670)
>  r7:00000013 r6:c0021ac0 r5:c00376e0 r4:c7839edc
> Code: e1a0c00d e92dd800 e24cb004 e5903128 (e5130004) 
> ---[ end trace ddf7f4f6a0de23b9 ]---
> Fixing recursive fault but reboot is needed!
> Unable to handle kernel paging request at virtual address fffffffc
> pgd = c0004000
> [fffffffc] *pgd=37ffe831, *pte=00000000, *ppte=00000000
> Internal error: Oops: 17 [#3]
> Modules linked in: ohci_hcd leds_s3c24xx usbcore i2c_s3c2410 i2c_core s3c_hsudc
> CPU: 0    Tainted: G      D       (3.2.0-rc5-next-20111216+ #32)
> PC is at kthread_data+0x10/0x18
> LR is at wq_worker_sleeping+0x18/0xbc
> pc : [<c00371c4>]    lr : [<c0033974>]    psr: 20000093
> sp : c70bd7c0  ip : c70bd7d0  fp : c70bd7cc
> r10: c70bc000  r9 : c70bd7f8  r8 : c02dc500
> r7 : c00371c8  r6 : c708cb00  r5 : c708cc54  r4 : 00000000
> r3 : 00000000  r2 : c02dc500  r1 : 00000000  r0 : c708cb00
> Flags: nzCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment user
> Control: 0005317f  Table: 37014000  DAC: 00000015
> Process kworker/0:1 (pid: 16, stack limit = 0xc70bc270)
> Stack: (0xc70bd7c0 to 0xc70be000)
> d7c0: c70bd7e4 c70bd7d0 c0033974 c00371c4 c003f760 0000000b c70bd86c c70bd7e8
> d7e0: c0218ebc c003396c c0023cdc 60000013 ffffffff 60000013 c70bd824 c70bd808
> d800: c005681c c0056718 0000001e 00000000 f6000000 c70bd894 c70bd834 c70bd828
> d820: c0023e4c c00567c0 00000001 000bd838 00000004 0000000b c00371c6 c708cb00
> d840: c00371c8 0000000b c00371c6 c708cb00 c00371c8 00000000 00000008 bf000000
> d860: c70bd87c c70bd870 c02194cc c0218dfc c70bd8a4 c70bd880 c0021bd4 c0219468
> d880: 00000008 bf000000 c70bd8a4 c70bd898 c001e49c c001e99c c70bd91c c70bd8a8
> d8a0: c001222c c0021ad0 c70bc270 0000000b 028959e4 00000000 65000000 63306131
> d8c0: 20643030 64323965 30303864 34326520 30306263 35652034 31333039 28203832
> d8e0: 33313565 34303030 c0002029 c0217dd8 c027dcbb fffffffc c70bdb10 00000000
> d900: 00000017 00000000 00000017 00000000 c70bd944 c70bd920 c0013808 c0011f80
> d920: c0275aa3 c02d5ccc 20000093 c70bdb10 fffffffc c708cb00 c70bda5c c70bd948
> d940: c0013b58 c00137a8 c011b37c c027a96d 00000000 00000670 c70bd9a9 0002340f
> d960: c70bd994 00000028 c011a208 c0118ee8 c014b004 c03102e3 c03106b0 c03106b0
> d980: c0275aa2 c03106b0 c70bda9c c70bd9a0 c011a584 c011a1d8 c011a550 ff0a0005
> d9a0: ffffffff c70bd9b0 5f6f6474 74697865 3078302b 3678302f 30003037 38323478
> d9c0: 00003800 31780038 00003839 c70bd9d8 c001e818 c001e70c 00001e0c 00001e0c
> d9e0: c70bda1c c70bd9f0 c001f008 c003bd00 00000000 00000000 00000000 0000001f
> da00: c70bda72 c03102b2 00000004 00000000 1b478423 c70bda50 c70bda24 c01198cc
> da20: c01196d0 65300020 c70bda72 c03102b2 0000ffff c02d5ccc 20000093 00000017
> da40: c70bdb10 fffffffc c70bdb90 c70bc000 c70bdb0c c70bda60 c0008634 c0013838
> da60: c70bda84 c70bdaae c70bdb97 0000ffff 00000002 00000000 c0281b48 00000007
> da80: c70bdb1c c70bda90 c0119ab8 c7826580 00000001 00000007 00000001 c78265b0
> daa0: c02dc500 c78265b0 00000000 c708cb00 c708cb30 00000000 c78265b0 00000000
> dac0: c70bdafc c70bdad0 c0040e5c c003e004 c003f79c c021bf08 c02dc500 c708cb00
> dae0: c7826000 c02dc500 c70bdb90 c00371c4 20000093 ffffffff c70bdb44 c02dc500
> db00: c70bdb64 c70bdb10 c000e458 c0008608 c708cb00 00000000 c02dc500 00000000
> db20: 00000000 c708cc54 c708cb00 c7826000 c02dc500 c70bdb90 c70bc000 c70bdb64
> db40: c70bdb68 c70bdb58 c0033974 c00371c4 20000093 ffffffff c70bdb7c c70bdb68
> db60: c0033974 c00371c4 c003f760 00000001 c70bdc04 c70bdb80 c0218ebc c003396c
> db80: c0406680 c70b4a40 00000664 c001c678 00000168 00000000 c70bdbcc c70bdba8
> dba0: c008cb78 c008b680 c0034390 c708cb00 c70b8440 00000001 00000000 c70b4a40
> dbc0: c70bdbdc c70bdbd0 c001c678 c708cb00 c70bdc14 c70bdbe0 c0020db4 00000001
> dbe0: c70bdc24 c708cb00 c7826000 c708cbd8 c708caf8 c708cbd8 c70bdc14 c70bdc08
> dc00: c02194cc c0218dfc c70bdc3c c70bdc18 c0022100 c0219468 00000008 00000001
> dc20: c70bdc3c c70bdc24 c70bdc24 c708cc20 c70bdcb4 c70bdc40 c001222c c0021ad0
> dc40: c70bc270 0000000b 7269762f 00000000 65000000 62633432 20343030 64343265
> dc60: 63303064 35326520 30303430 61302030 30303030 28203331 34643565 34363033
> dc80: c0002029 c0217dd8 c027dcbb bf05b504 c70bdea8 00000000 00000007 00000000
> dca0: 00000007 00000000 c70bdcdc c70bdcb8 c0013808 c0011f80 00000000 c02d5ccc
> dcc0: a0000013 c70bdea8 bf05b504 c708cb00 c70bddf4 c70bdce0 c0013b58 c00137a8
> dce0: bf01dfcc bf0200c8 00000000 00000000 c70bddc4 c70bdd00 bf01f58c 00000028
> dd00: c70bdd88 00000004 00000001 c708dbb0 00000000 00000004 00000002 c7a7e5e0
> dd20: c708cb30 00000000 c708dbb0 00000000 c70bdd6c c70bdd40 c0040e34 c0040b20
> dd40: c003f79c c021bf08 c02dc500 c708cb00 000000c3 00000001 00000001 00000001
> dd60: c70bdd8c c70bdd70 c003e080 c0040d74 c003fb2c c708db80 00000000 40000093
> dd80: c70bddac bf0203b0 00000100 c706d378 c70bddc4 c70bdda0 c0118064 c0117e6c
> dda0: 00000001 00000004 00000000 c706d0b0 c02dc500 c706d0b0 00000000 c708cb00
> ddc0: c708cb30 00000001 c706d0b0 c02d5ccc a0000013 00000007 c70bdea8 bf05b504
> dde0: c0114700 00000000 c70bdea4 c70bddf8 c0008634 c0013838 00000003 00000000
> de00: c70bde2c c70bde10 c003e080 c0040d74 c003fb2c c706d080 00000000 80000093
> de20: c70bde4c c70bde30 c003fbc0 c003e05c 00000002 c7a73f70 00000bd3 000003e0
> de40: c70bde70 c0113dc0 c003fbf8 c7a28780 c7a28730 c031fba0 c70bde98 c70bdec8
> de60: c70bde8c c70bde70 c00dda98 c008cabc c7a28780 c7a28780 00020001 c70bde94
> de80: c70bdec4 c011460c a0000013 ffffffff c70bdedc c7803a00 c70bdf0c c70bdea8
> dea0: c000e458 c0008608 bf05b4a0 00000000 00000000 00000001 bf05b4a0 c79a0120
> dec0: c02e1de0 c79257a0 c7803a00 c0114700 00000000 c70bdf0c c70bdf10 c70bdef0
> dee0: c01146f4 c011460c a0000013 ffffffff c79a0100 c79a0120 c02e1de0 c79a0100
> df00: c70bdf24 c70bdf10 c01146f4 c0114604 c01365bc c79a0100 c70bdf4c c70bdf28
> df20: c01147f0 c01146a0 c0136640 c0136590 c79a0120 c785fd00 00000000 00000009
> df40: c70bdf84 c70bdf50 c00318fc c0114710 c02dbf00 c7803a05 c02dbf00 c785fd00
> df60: c02dbf00 c785fd00 00000009 c02dbf00 c785fd10 c70bc000 c70bdfbc c70bdf88
> df80: c0032570 c00316c0 c7839edc c785fd10 c0032364 c70bdfcc c7839edc c785fd00
> dfa0: c0032364 00000000 00000000 00000000 c70bdff4 c70bdfc0 c0037768 c0032374
> dfc0: c7839edc 00000000 c785fd00 00000001 c70bdfd0 c70bdfd0 c7839edc c00376e0
> dfe0: c0021ac0 00000013 00000000 c70bdff8 c0021ac0 c00376f0 00190021 00024ea8
> Backtrace: 
> [<c00371b4>] (kthread_data+0x0/0x18) from [<c0033974>] (wq_worker_sleeping+0x18/0xbc)
> [<c003395c>] (wq_worker_sleeping+0x0/0xbc) from [<c0218ebc>] (__schedule+0xd0/0x37c)
>  r4:0000000b
> [<c0218dec>] (__schedule+0x0/0x37c) from [<c02194cc>] (schedule+0x74/0x78)
> [<c0219458>] (schedule+0x0/0x78) from [<c0021bd4>] (do_exit+0x114/0x670)
> [<c0021ac0>] (do_exit+0x0/0x670) from [<c001222c>] (die+0x2bc/0x2fc)
> [<c0011f70>] (die+0x0/0x2fc) from [<c0013808>] (__do_kernel_fault+0x70/0x90)
> [<c0013798>] (__do_kernel_fault+0x0/0x90) from [<c0013b58>] (do_page_fault+0x330/0x354)
>  r8:c708cb00 r7:fffffffc r6:c70bdb10 r5:20000093 r4:c02d5ccc
> [<c0013828>] (do_page_fault+0x0/0x354) from [<c0008634>] (do_DataAbort+0x3c/0x9c)
> [<c00085f8>] (do_DataAbort+0x0/0x9c) from [<c000e458>] (__dabt_svc+0x38/0x60)
> Exception stack(0xc70bdb10 to 0xc70bdb58)
> db00:                                     c708cb00 00000000 c02dc500 00000000
> db20: 00000000 c708cc54 c708cb00 c7826000 c02dc500 c70bdb90 c70bc000 c70bdb64
> db40: c70bdb68 c70bdb58 c0033974 c00371c4 20000093 ffffffff
>  r8:c02dc500 r7:c70bdb44 r6:ffffffff r5:20000093 r4:c00371c4
> [<c00371b4>] (kthread_data+0x0/0x18) from [<c0033974>] (wq_worker_sleeping+0x18/0xbc)
> [<c003395c>] (wq_worker_sleeping+0x0/0xbc) from [<c0218ebc>] (__schedule+0xd0/0x37c)
>  r4:00000001
> [<c0218dec>] (__schedule+0x0/0x37c) from [<c02194cc>] (schedule+0x74/0x78)
> [<c0219458>] (schedule+0x0/0x78) from [<c0022100>] (do_exit+0x640/0x670)
> [<c0021ac0>] (do_exit+0x0/0x670) from [<c001222c>] (die+0x2bc/0x2fc)
> [<c0011f70>] (die+0x0/0x2fc) from [<c0013808>] (__do_kernel_fault+0x70/0x90)
> [<c0013798>] (__do_kernel_fault+0x0/0x90) from [<c0013b58>] (do_page_fault+0x330/0x354)
>  r8:c708cb00 r7:bf05b504 r6:c70bdea8 r5:a0000013 r4:c02d5ccc
> [<c0013828>] (do_page_fault+0x0/0x354) from [<c0008634>] (do_DataAbort+0x3c/0x9c)
> [<c00085f8>] (do_DataAbort+0x0/0x9c) from [<c000e458>] (__dabt_svc+0x38/0x60)
> Exception stack(0xc70bdea8 to 0xc70bdef0)
> dea0:                   bf05b4a0 00000000 00000000 00000001 bf05b4a0 c79a0120
> dec0: c02e1de0 c79257a0 c7803a00 c0114700 00000000 c70bdf0c c70bdf10 c70bdef0
> dee0: c01146f4 c011460c a0000013 ffffffff
>  r8:c7803a00 r7:c70bdedc r6:ffffffff r5:a0000013 r4:c011460c
> [<c01145f4>] (kobject_put+0x0/0x7c) from [<c01146f4>] (kobject_del+0x64/0x70)
>  r4:c79a0100
> [<c0114690>] (kobject_del+0x0/0x70) from [<c01147f0>] (kobject_delayed_cleanup+0xf0/0x198)
>  r4:c79a0100
> [<c0114700>] (kobject_delayed_cleanup+0x0/0x198) from [<c00318fc>] (process_one_work+0x24c/0x3a8)
>  r7:00000009 r6:00000000 r5:c785fd00 r4:c79a0120
> [<c00316b0>] (process_one_work+0x0/0x3a8) from [<c0032570>] (worker_thread+0x20c/0x428)
> [<c0032364>] (worker_thread+0x0/0x428) from [<c0037768>] (kthread+0x88/0x90)
> [<c00376e0>] (kthread+0x0/0x90) from [<c0021ac0>] (do_exit+0x0/0x670)
>  r7:00000013 r6:c0021ac0 r5:c00376e0 r4:c7839edc
> Code: e1a0c00d e92dd800 e24cb004 e5903128 (e5130004) 
> ---[ end trace ddf7f4f6a0de23ba ]---
> Fixing recursive fault but reboot is needed!
> Unable to handle kernel paging request at virtual address fffffffc
> pgd = c0004000
> [fffffffc] *pgd=37ffe831, *pte=00000000, *ppte=00000000
> Internal error: Oops: 17 [#4]
> Modules linked in: ohci_hcd leds_s3c24xx usbcore i2c_s3c2410 i2c_core s3c_hsudc
> CPU: 0    Tainted: G      D       (3.2.0-rc5-next-20111216+ #32)
> PC is at kthread_data+0x10/0x18
> LR is at wq_worker_sleeping+0x18/0xbc
> pc : [<c00371c4>]    lr : [<c0033974>]    psr: 20000093
> sp : c70bd428  ip : c70bd438  fp : c70bd434
> r10: c70bc000  r9 : c70bd460  r8 : c02dc500
> r7 : c00371c8  r6 : c708cb00  r5 : c708cc54  r4 : 00000000
> r3 : 00000000  r2 : c02dc500  r1 : 00000000  r0 : c708cb00
> Flags: nzCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment user
> Control: 0005317f  Table: 37014000  DAC: 00000015
> Process kworker/0:1 (pid: 16, stack limit = 0xc70bc270)
> Stack: (0xc70bd428 to 0xc70be000)
> d420:                   c70bd44c c70bd438 c0033974 c00371c4 c003f760 0000000b
> d440: c70bd4d4 c70bd450 c0218ebc c003396c c0023cdc 60000013 ffffffff 60000013
> d460: c70bd48c c70bd470 c005681c c0056718 0000001e 00000000 f6000000 c70bd4fc
> d480: c70bd49c c70bd490 c0023e4c c00567c0 00000001 000bd4a0 00000004 0000000b
> d4a0: c00371c6 c708cb00 c00371c8 0000000b c00371c6 c708cb00 c00371c8 00000000
> d4c0: 00000008 bf000000 c70bd4e4 c70bd4d8 c02194cc c0218dfc c70bd50c c70bd4e8
> d4e0: c0021bd4 c0219468 00000008 bf000000 c70bd50c c70bd500 c001e49c c001e99c
> d500: c70bd584 c70bd510 c001222c c0021ad0 c70bc270 0000000b 00003164 00000000
> d520: 65000000 63306131 20643030 64323965 30303864 34326520 30306263 35652034
> d540: 31333039 28203832 33313565 34303030 c0002029 c0217dd8 c027dcbb fffffffc
> d560: c70bd778 00000000 00000017 00000000 00000017 00000000 c70bd5ac c70bd588
> d580: c0013808 c0011f80 c0275aa3 c02d5ccc 20000093 c70bd778 fffffffc c708cb00
> d5a0: c70bd6c4 c70bd5b0 c0013b58 c00137a8 c011b37c c027a96d 00000000 00000670
> d5c0: c70bd611 00000030 c70bd5fc 00000028 c011a208 c0118ee8 c014b004 c03102e3
> d5e0: c03106b0 c03106b0 c0275aa2 c03106b0 c70bd704 c70bd608 c011a584 c011a1d8
> d600: c011a550 ff0a0005 ffffffff c70bd618 5f6f6474 74697865 3078302b 3678302f
> d620: 30003037 38323478 00003800 31780038 c70bc000 00000000 005b8d80 00000000
> d640: c708cb30 c70bd7cc c70bd67c c70bd658 c0040818 c00406b4 00000c00 00155555
> d660: c02dfe08 c02dfd74 c70bc000 c708cb30 c70bd69c c70bd674 c70bd674 c708cb00
> d680: c70bd7cc c02ddbb0 c031e888 c70bc000 00000000 c708cb00 c70bd7cc c02d5ccc
> d6a0: 20000093 00000017 c70bd778 fffffffc c70bd7f8 c70bc000 c70bd774 c70bd6c8
> d6c0: c0008634 c0013838 c70bd724 c70bd6d8 c0028b4c c003aa98 00000001 00000001
> d6e0: c02ddbb0 c70bd6f0 c031122c c031102c c70bd6f0 c70bd6f0 00000010 00000001
> d700: 00000100 c70bc000 00000004 00000001 00000001 00000100 c70bd75c 0000002c
> d720: c70bd754 c70bd730 c014b004 c014dc28 c70bd75c c02e6290 00003cd6 0000002d
> d740: c02daa48 c02daa50 c70bd764 c70bd758 c014e9ac c00371c4 20000093 ffffffff
> d760: c70bd7ac c02dc500 c70bd7cc c70bd778 c000e458 c0008608 c708cb00 00000000
> d780: c02dc500 00000000 00000000 c708cc54 c708cb00 c00371c8 c02dc500 c70bd7f8
> d7a0: c70bc000 c70bd7cc c70bd7d0 c70bd7c0 c0033974 c00371c4 20000093 ffffffff
> d7c0: c70bd7e4 c70bd7d0 c0033974 c00371c4 c003f760 0000000b c70bd86c c70bd7e8
> d7e0: c0218ebc c003396c c0023cdc 60000013 ffffffff 60000013 c70bd824 c70bd808
> d800: c005681c c0056718 0000001e 00000000 f6000000 c70bd894 c70bd834 c70bd828
> d820: c0023e4c c00567c0 00000001 000bd838 00000004 0000000b c00371c6 c708cb00
> d840: c00371c8 0000000b c00371c6 c708cb00 c00371c8 00000000 00000008 bf000000
> d860: c70bd87c c70bd870 c02194cc c0218dfc c70bd8a4 c70bd880 c0021bd4 c0219468
> d880: 00000008 bf000000 c70bd8a4 c70bd898 c001e49c c001e99c c70bd91c c70bd8a8
> d8a0: c001222c c0021ad0 c70bc270 0000000b 028959e4 00000000 65000000 63306131
> d8c0: 20643030 64323965 30303864 34326520 30306263 35652034 31333039 28203832
> d8e0: 33313565 34303030 c0002029 c0217dd8 c027dcbb fffffffc c70bdb10 00000000
> d900: 00000017 00000000 00000017 00000000 c70bd944 c70bd920 c0013808 c0011f80
> d920: c0275aa3 c02d5ccc 20000093 c70bdb10 fffffffc c708cb00 c70bda5c c70bd948
> d940: c0013b58 c00137a8 c011b37c c027a96d 00000000 00000670 c70bd9a9 0002340f
> d960: c70bd994 00000028 c011a208 c0118ee8 c014b004 c03102e3 c03106b0 c03106b0
> d980: c0275aa2 c03106b0 c70bda9c c70bd9a0 c011a584 c011a1d8 c011a550 ff0a0005
> d9a0: ffffffff c70bd9b0 5f6f6474 74697865 3078302b 3678302f 30003037 38323478
> d9c0: 00003800 31780038 00003839 c70bd9d8 c001e818 c001e70c 00001e0c 00001e0c
> d9e0: c70bda1c c70bd9f0 c001f008 c003bd00 00000000 00000000 00000000 0000001f
> da00: c70bda72 c03102b2 00000004 00000000 1b478423 c70bda50 c70bda24 c01198cc
> da20: c01196d0 65300020 c70bda72 c03102b2 0000ffff c02d5ccc 20000093 00000017
> da40: c70bdb10 fffffffc c70bdb90 c70bc000 c70bdb0c c70bda60 c0008634 c0013838
> da60: c70bda84 c70bdaae c70bdb97 0000ffff 00000002 00000000 c0281b48 00000007
> da80: c70bdb1c c70bda90 c0119ab8 c7826580 00000001 00000007 00000001 c78265b0
> daa0: c02dc500 c78265b0 00000000 c708cb00 c708cb30 00000000 c78265b0 00000000
> dac0: c70bdafc c70bdad0 c0040e5c c003e004 c003f79c c021bf08 c02dc500 c708cb00
> dae0: c7826000 c02dc500 c70bdb90 c00371c4 20000093 ffffffff c70bdb44 c02dc500
> db00: c70bdb64 c70bdb10 c000e458 c0008608 c708cb00 00000000 c02dc500 00000000
> db20: 00000000 c708cc54 c708cb00 c7826000 c02dc500 c70bdb90 c70bc000 c70bdb64
> db40: c70bdb68 c70bdb58 c0033974 c00371c4 20000093 ffffffff c70bdb7c c70bdb68
> db60: c0033974 c00371c4 c003f760 00000001 c70bdc04 c70bdb80 c0218ebc c003396c
> db80: c0406680 c70b4a40 00000664 c001c678 00000168 00000000 c70bdbcc c70bdba8
> dba0: c008cb78 c008b680 c0034390 c708cb00 c70b8440 00000001 00000000 c70b4a40
> dbc0: c70bdbdc c70bdbd0 c001c678 c708cb00 c70bdc14 c70bdbe0 c0020db4 00000001
> dbe0: c70bdc24 c708cb00 c7826000 c708cbd8 c708caf8 c708cbd8 c70bdc14 c70bdc08
> dc00: c02194cc c0218dfc c70bdc3c c70bdc18 c0022100 c0219468 00000008 00000001
> dc20: c70bdc3c c70bdc24 c70bdc24 c708cc20 c70bdcb4 c70bdc40 c001222c c0021ad0
> dc40: c70bc270 0000000b 7269762f 00000000 65000000 62633432 20343030 64343265
> dc60: 63303064 35326520 30303430 61302030 30303030 28203331 34643565 34363033
> dc80: c0002029 c0217dd8 c027dcbb bf05b504 c70bdea8 00000000 00000007 00000000
> dca0: 00000007 00000000 c70bdcdc c70bdcb8 c0013808 c0011f80 00000000 c02d5ccc
> dcc0: a0000013 c70bdea8 bf05b504 c708cb00 c70bddf4 c70bdce0 c0013b58 c00137a8
> dce0: bf01dfcc bf0200c8 00000000 00000000 c70bddc4 c70bdd00 bf01f58c 00000028
> dd00: c70bdd88 00000004 00000001 c708dbb0 00000000 00000004 00000002 c7a7e5e0
> dd20: c708cb30 00000000 c708dbb0 00000000 c70bdd6c c70bdd40 c0040e34 c0040b20
> dd40: c003f79c c021bf08 c02dc500 c708cb00 000000c3 00000001 00000001 00000001
> dd60: c70bdd8c c70bdd70 c003e080 c0040d74 c003fb2c c708db80 00000000 40000093
> dd80: c70bddac bf0203b0 00000100 c706d378 c70bddc4 c70bdda0 c0118064 c0117e6c
> dda0: 00000001 00000004 00000000 c706d0b0 c02dc500 c706d0b0 00000000 c708cb00
> ddc0: c708cb30 00000001 c706d0b0 c02d5ccc a0000013 00000007 c70bdea8 bf05b504
> dde0: c0114700 00000000 c70bdea4 c70bddf8 c0008634 c0013838 00000003 00000000
> de00: c70bde2c c70bde10 c003e080 c0040d74 c003fb2c c706d080 00000000 80000093
> de20: c70bde4c c70bde30 c003fbc0 c003e05c 00000002 c7a73f70 00000bd3 000003e0
> de40: c70bde70 c0113dc0 c003fbf8 c7a28780 c7a28730 c031fba0 c70bde98 c70bdec8
> de60: c70bde8c c70bde70 c00dda98 c008cabc c7a28780 c7a28780 00020001 c70bde94
> de80: c70bdec4 c011460c a0000013 ffffffff c70bdedc c7803a00 c70bdf0c c70bdea8
> dea0: c000e458 c0008608 bf05b4a0 00000000 00000000 00000001 bf05b4a0 c79a0120
> dec0: c02e1de0 c79257a0 c7803a00 c0114700 00000000 c70bdf0c c70bdf10 c70bdef0
> dee0: c01146f4 c011460c a0000013 ffffffff c79a0100 c79a0120 c02e1de0 c79a0100
> df00: c70bdf24 c70bdf10 c01146f4 c0114604 c01365bc c79a0100 c70bdf4c c70bdf28
> df20: c01147f0 c01146a0 c0136640 c0136590 c79a0120 c785fd00 00000000 00000009
> df40: c70bdf84 c70bdf50 c00318fc c0114710 c02dbf00 c7803a05 c02dbf00 c785fd00
> df60: c02dbf00 c785fd00 00000009 c02dbf00 c785fd10 c70bc000 c70bdfbc c70bdf88
> df80: c0032570 c00316c0 c7839edc c785fd10 c0032364 c70bdfcc c7839edc c785fd00
> dfa0: c0032364 00000000 00000000 00000000 c70bdff4 c70bdfc0 c0037768 c0032374
> dfc0: c7839edc 00000000 c785fd00 00000001 c70bdfd0 c70bdfd0 c7839edc c00376e0
> dfe0: c0021ac0 00000013 00000000 c70bdff8 c0021ac0 c00376f0 00190021 00024ea8
> Backtrace: 
> [<c00371b4>] (kthread_data+0x0/0x18) from [<c0033974>] (wq_worker_sleeping+0x18/0xbc)
> [<c003395c>] (wq_worker_sleeping+0x0/0xbc) from [<c0218ebc>] (__schedule+0xd0/0x37c)
>  r4:0000000b
> [<c0218dec>] (__schedule+0x0/0x37c) from [<c02194cc>] (schedule+0x74/0x78)
> [<c0219458>] (schedule+0x0/0x78) from [<c0021bd4>] (do_exit+0x114/0x670)
> [<c0021ac0>] (do_exit+0x0/0x670) from [<c001222c>] (die+0x2bc/0x2fc)
> [<c0011f70>] (die+0x0/0x2fc) from [<c0013808>] (__do_kernel_fault+0x70/0x90)
> [<c0013798>] (__do_kernel_fault+0x0/0x90) from [<c0013b58>] (do_page_fault+0x330/0x354)
>  r8:c708cb00 r7:fffffffc r6:c70bd778 r5:20000093 r4:c02d5ccc
> [<c0013828>] (do_page_fault+0x0/0x354) from [<c0008634>] (do_DataAbort+0x3c/0x9c)
> [<c00085f8>] (do_DataAbort+0x0/0x9c) from [<c000e458>] (__dabt_svc+0x38/0x60)
> Exception stack(0xc70bd778 to 0xc70bd7c0)
> d760:                                                       c708cb00 00000000
> d780: c02dc500 00000000 00000000 c708cc54 c708cb00 c00371c8 c02dc500 c70bd7f8
> d7a0: c70bc000 c70bd7cc c70bd7d0 c70bd7c0 c0033974 c00371c4 20000093 ffffffff
>  r8:c02dc500 r7:c70bd7ac r6:ffffffff r5:20000093 r4:c00371c4
> [<c00371b4>] (kthread_data+0x0/0x18) from [<c0033974>] (wq_worker_sleeping+0x18/0xbc)
> [<c003395c>] (wq_worker_sleeping+0x0/0xbc) from [<c0218ebc>] (__schedule+0xd0/0x37c)
>  r4:0000000b
> [<c0218dec>] (__schedule+0x0/0x37c) from [<c02194cc>] (schedule+0x74/0x78)
> [<c0219458>] (schedule+0x0/0x78) from [<c0021bd4>] (do_exit+0x114/0x670)
> [<c0021ac0>] (do_exit+0x0/0x670) from [<c001222c>] (die+0x2bc/0x2fc)
> [<c0011f70>] (die+0x0/0x2fc) from [<c0013808>] (__do_kernel_fault+0x70/0x90)
> [<c0013798>] (__do_kernel_fault+0x0/0x90) from [<c0013b58>] (do_page_fault+0x330/0x354)
>  r8:c708cb00 r7:fffffffc r6:c70bdb10 r5:20000093 r4:c02d5ccc
> [<c0013828>] (do_page_fault+0x0/0x354) from [<c0008634>] (do_DataAbort+0x3c/0x9c)
> [<c00085f8>] (do_DataAbort+0x0/0x9c) from [<c000e458>] (__dabt_svc+0x38/0x60)
> Exception stack(0xc70bdb10 to 0xc70bdb58)
> db00:                                     c708cb00 00000000 c02dc500 00000000
> db20: 00000000 c708cc54 c708cb00 c7826000 c02dc500 c70bdb90 c70bc000 c70bdb64
> db40: c70bdb68 c70bdb58 c0033974 c00371c4 20000093 ffffffff
>  r8:c02dc500 r7:c70bdb44 r6:ffffffff r5:20000093 r4:c00371c4
> [<c00371b4>] (kthread_data+0x0/0x18) from [<c0033974>] (wq_worker_sleeping+0x18/0xbc)
> [<c003395c>] (wq_worker_sleeping+0x0/0xbc) from [<c0218ebc>] (__schedule+0xd0/0x37c)
>  r4:00000001
> [<c0218dec>] (__schedule+0x0/0x37c) from [<c02194cc>] (schedule+0x74/0x78)
> [<c0219458>] (schedule+0x0/0x78) from [<c0022100>] (do_exit+0x640/0x670)
> [<c0021ac0>] (do_exit+0x0/0x670) from [<c001222c>] (die+0x2bc/0x2fc)
> [<c0011f70>] (die+0x0/0x2fc) from [<c0013808>] (__do_kernel_fault+0x70/0x90)
> [<c0013798>] (__do_kernel_fault+0x0/0x90) from [<c0013b58>] (do_page_fault+0x330/0x354)
>  r8:c708cb00 r7:bf05b504 r6:c70bdea8 r5:a0000013 r4:c02d5ccc
> [<c0013828>] (do_page_fault+0x0/0x354) from [<c0008634>] (do_DataAbort+0x3c/0x9c)
> [<c00085f8>] (do_DataAbort+0x0/0x9c) from [<c000e458>] (__dabt_svc+0x38/0x60)
> Exception stack(0xc70bdea8 to 0xc70bdef0)
> dea0:                   bf05b4a0 00000000 00000000 00000001 bf05b4a0 c79a0120
> dec0: c02e1de0 c79257a0 c7803a00 c0114700 00000000 c70bdf0c c70bdf10 c70bdef0
> dee0: c01146f4 c011460c a0000013 ffffffff
>  r8:c7803a00 r7:c70bdedc r6:ffffffff r5:a0000013 r4:c011460c
> [<c01145f4>] (kobject_put+0x0/0x7c) from [<c01146f4>] (kobject_del+0x64/0x70)
>  r4:c79a0100
> [<c0114690>] (kobject_del+0x0/0x70) from [<c01147f0>] (kobject_delayed_cleanup+0xf0/0x198)
>  r4:c79a0100
> [<c0114700>] (kobject_delayed_cleanup+0x0/0x198) from [<c00318fc>] (process_one_work+0x24c/0x3a8)
>  r7:00000009 r6:00000000 r5:c785fd00 r4:c79a0120
> [<c00316b0>] (process_one_work+0x0/0x3a8) from [<c0032570>] (worker_thread+0x20c/0x428)
> [<c0032364>] (worker_thread+0x0/0x428) from [<c0037768>] (kthread+0x88/0x90)
> [<c00376e0>] (kthread+0x0/0x90) from [<c0021ac0>] (do_exit+0x0/0x670)
>  r7:00000013 r6:c0021ac0 r5:c00376e0 r4:c7839edc
> Code: e1a0c00d e92dd800 e24cb004 e5903128 (e5130004) 
> ---[ end trace ddf7f4f6a0de23bb ]---
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH 3/7] s3c-hsudc: add a remove function
@ 2011-12-18 19:01               ` Russell King - ARM Linux
  0 siblings, 0 replies; 48+ messages in thread
From: Russell King - ARM Linux @ 2011-12-18 19:01 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, Dec 18, 2011 at 07:50:37PM +0100, Heiko St?bner wrote:
> I didn't get this far. With your patch the Oopses already happen during
> the startup of the system / the loading of the modules.
> 
> A bit of the message spew I got during testing with linux-next-20111216:

In some way, this is a good thing because it's showing that there's
problems with kobject lifetime rules.

The #2 and further oops dumps are a result of corrupting the work
queues as a result of #1, so #2 onwards should be ignored.

I suspect if you avoid loading the s3c_hsudc module these will go away.

> 
> pgd = c0004000
> [bf05b504] *pgd=379af811, *pte=00000000, *ppte=00000000
> Internal error: Oops: 7 [#1]
> Modules linked in: ohci_hcd leds_s3c24xx usbcore i2c_s3c2410 i2c_core s3c_hsudc
> CPU: 0    Not tainted  (3.2.0-rc5-next-20111216+ #32)
> PC is at kobject_put+0x18/0x7c
> LR is at kobject_del+0x64/0x70
> pc : [<c011460c>]    lr : [<c01146f4>]    psr: a0000013
> sp : c70bdef0  ip : c70bdf10  fp : c70bdf0c
> r10: 00000000  r9 : c0114700  r8 : c7803a00
> r7 : c79257a0  r6 : c02e1de0  r5 : c79a0120  r4 : bf05b4a0
> r3 : 00000001  r2 : 00000000  r1 : 00000000  r0 : bf05b4a0
> Flags: NzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
> Control: 0005317f  Table: 37014000  DAC: 00000017
> Process kworker/0:1 (pid: 16, stack limit = 0xc70bc270)
> Stack: (0xc70bdef0 to 0xc70be000)
> dee0:                                     c79a0100 c79a0120 c02e1de0 c79a0100
> df00: c70bdf24 c70bdf10 c01146f4 c0114604 c01365bc c79a0100 c70bdf4c c70bdf28
> df20: c01147f0 c01146a0 c0136640 c0136590 c79a0120 c785fd00 00000000 00000009
> df40: c70bdf84 c70bdf50 c00318fc c0114710 c02dbf00 c7803a05 c02dbf00 c785fd00
> df60: c02dbf00 c785fd00 00000009 c02dbf00 c785fd10 c70bc000 c70bdfbc c70bdf88
> df80: c0032570 c00316c0 c7839edc c785fd10 c0032364 c70bdfcc c7839edc c785fd00
> dfa0: c0032364 00000000 00000000 00000000 c70bdff4 c70bdfc0 c0037768 c0032374
> dfc0: c7839edc 00000000 c785fd00 00000000 c70bdfd0 c70bdfd0 c7839edc c00376e0
> dfe0: c0021ac0 00000013 00000000 c70bdff8 c0021ac0 c00376f0 00190021 00024ea8
> Backtrace: 
> [<c01145f4>] (kobject_put+0x0/0x7c) from [<c01146f4>] (kobject_del+0x64/0x70)
>  r4:c79a0100
> [<c0114690>] (kobject_del+0x0/0x70) from [<c01147f0>] (kobject_delayed_cleanup+0xf0/0x198)
>  r4:c79a0100
> [<c0114700>] (kobject_delayed_cleanup+0x0/0x198) from [<c00318fc>] (process_one_work+0x24c/0x3a8)
>  r7:00000009 r6:00000000 r5:c785fd00 r4:c79a0120
> [<c00316b0>] (process_one_work+0x0/0x3a8) from [<c0032570>] (worker_thread+0x20c/0x428)
> [<c0032364>] (worker_thread+0x0/0x428) from [<c0037768>] (kthread+0x88/0x90)
> [<c00376e0>] (kthread+0x0/0x90) from [<c0021ac0>] (do_exit+0x0/0x670)
>  r7:00000013 r6:c0021ac0 r5:c00376e0 r4:c7839edc
> Code: e24cb004 e24dd00c e2504000 0a000013 (e5d43064) 
> ---[ end trace ddf7f4f6a0de23b8 ]---
> Unable to handle kernel paging request at virtual address fffffffc
> pgd = c0004000
> [fffffffc] *pgd=37ffe831, *pte=00000000, *ppte=00000000
> Internal error: Oops: 17 [#2]
> Modules linked in: ohci_hcd leds_s3c24xx usbcore i2c_s3c2410 i2c_core s3c_hsudc
> CPU: 0    Tainted: G      D       (3.2.0-rc5-next-20111216+ #32)
> PC is at kthread_data+0x10/0x18
> LR is at wq_worker_sleeping+0x18/0xbc
> pc : [<c00371c4>]    lr : [<c0033974>]    psr: 20000093
> sp : c70bdb58  ip : c70bdb68  fp : c70bdb64
> r10: c70bc000  r9 : c70bdb90  r8 : c02dc500
> r7 : c7826000  r6 : c708cb00  r5 : c708cc54  r4 : 00000000
> r3 : 00000000  r2 : c02dc500  r1 : 00000000  r0 : c708cb00
> Flags: nzCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment user
> Control: 0005317f  Table: 37014000  DAC: 00000015
> Process kworker/0:1 (pid: 16, stack limit = 0xc70bc270)
> Stack: (0xc70bdb58 to 0xc70be000)
> db40:                                                       c70bdb7c c70bdb68
> db60: c0033974 c00371c4 c003f760 00000001 c70bdc04 c70bdb80 c0218ebc c003396c
> db80: c0406680 c70b4a40 00000664 c001c678 00000168 00000000 c70bdbcc c70bdba8
> dba0: c008cb78 c008b680 c0034390 c708cb00 c70b8440 00000001 00000000 c70b4a40
> dbc0: c70bdbdc c70bdbd0 c001c678 c708cb00 c70bdc14 c70bdbe0 c0020db4 00000001
> dbe0: c70bdc24 c708cb00 c7826000 c708cbd8 c708caf8 c708cbd8 c70bdc14 c70bdc08
> dc00: c02194cc c0218dfc c70bdc3c c70bdc18 c0022100 c0219468 00000008 00000001
> dc20: c70bdc3c c70bdc24 c70bdc24 c708cc20 c70bdcb4 c70bdc40 c001222c c0021ad0
> dc40: c70bc270 0000000b 7269762f 00000000 65000000 62633432 20343030 64343265
> dc60: 63303064 35326520 30303430 61302030 30303030 28203331 34643565 34363033
> dc80: c0002029 c0217dd8 c027dcbb bf05b504 c70bdea8 00000000 00000007 00000000
> dca0: 00000007 00000000 c70bdcdc c70bdcb8 c0013808 c0011f80 00000000 c02d5ccc
> dcc0: a0000013 c70bdea8 bf05b504 c708cb00 c70bddf4 c70bdce0 c0013b58 c00137a8
> dce0: bf01dfcc bf0200c8 00000000 00000000 c70bddc4 c70bdd00 bf01f58c 00000028
> dd00: c70bdd88 00000004 00000001 c708dbb0 00000000 00000004 00000002 c7a7e5e0
> dd20: c708cb30 00000000 c708dbb0 00000000 c70bdd6c c70bdd40 c0040e34 c0040b20
> dd40: c003f79c c021bf08 c02dc500 c708cb00 000000c3 00000001 00000001 00000001
> dd60: c70bdd8c c70bdd70 c003e080 c0040d74 c003fb2c c708db80 00000000 40000093
> dd80: c70bddac bf0203b0 00000100 c706d378 c70bddc4 c70bdda0 c0118064 c0117e6c
> dda0: 00000001 00000004 00000000 c706d0b0 c02dc500 c706d0b0 00000000 c708cb00
> ddc0: c708cb30 00000001 c706d0b0 c02d5ccc a0000013 00000007 c70bdea8 bf05b504
> dde0: c0114700 00000000 c70bdea4 c70bddf8 c0008634 c0013838 00000003 00000000
> de00: c70bde2c c70bde10 c003e080 c0040d74 c003fb2c c706d080 00000000 80000093
> de20: c70bde4c c70bde30 c003fbc0 c003e05c 00000002 c7a73f70 00000bd3 000003e0
> de40: c70bde70 c0113dc0 c003fbf8 c7a28780 c7a28730 c031fba0 c70bde98 c70bdec8
> de60: c70bde8c c70bde70 c00dda98 c008cabc c7a28780 c7a28780 00020001 c70bde94
> de80: c70bdec4 c011460c a0000013 ffffffff c70bdedc c7803a00 c70bdf0c c70bdea8
> dea0: c000e458 c0008608 bf05b4a0 00000000 00000000 00000001 bf05b4a0 c79a0120
> dec0: c02e1de0 c79257a0 c7803a00 c0114700 00000000 c70bdf0c c70bdf10 c70bdef0
> dee0: c01146f4 c011460c a0000013 ffffffff c79a0100 c79a0120 c02e1de0 c79a0100
> df00: c70bdf24 c70bdf10 c01146f4 c0114604 c01365bc c79a0100 c70bdf4c c70bdf28
> df20: c01147f0 c01146a0 c0136640 c0136590 c79a0120 c785fd00 00000000 00000009
> df40: c70bdf84 c70bdf50 c00318fc c0114710 c02dbf00 c7803a05 c02dbf00 c785fd00
> df60: c02dbf00 c785fd00 00000009 c02dbf00 c785fd10 c70bc000 c70bdfbc c70bdf88
> df80: c0032570 c00316c0 c7839edc c785fd10 c0032364 c70bdfcc c7839edc c785fd00
> dfa0: c0032364 00000000 00000000 00000000 c70bdff4 c70bdfc0 c0037768 c0032374
> dfc0: c7839edc 00000000 c785fd00 00000001 c70bdfd0 c70bdfd0 c7839edc c00376e0
> dfe0: c0021ac0 00000013 00000000 c70bdff8 c0021ac0 c00376f0 00190021 00024ea8
> Backtrace: 
> [<c00371b4>] (kthread_data+0x0/0x18) from [<c0033974>] (wq_worker_sleeping+0x18/0xbc)
> [<c003395c>] (wq_worker_sleeping+0x0/0xbc) from [<c0218ebc>] (__schedule+0xd0/0x37c)
>  r4:00000001
> [<c0218dec>] (__schedule+0x0/0x37c) from [<c02194cc>] (schedule+0x74/0x78)
> [<c0219458>] (schedule+0x0/0x78) from [<c0022100>] (do_exit+0x640/0x670)
> [<c0021ac0>] (do_exit+0x0/0x670) from [<c001222c>] (die+0x2bc/0x2fc)
> [<c0011f70>] (die+0x0/0x2fc) from [<c0013808>] (__do_kernel_fault+0x70/0x90)
> [<c0013798>] (__do_kernel_fault+0x0/0x90) from [<c0013b58>] (do_page_fault+0x330/0x354)
>  r8:c708cb00 r7:bf05b504 r6:c70bdea8 r5:a0000013 r4:c02d5ccc
> [<c0013828>] (do_page_fault+0x0/0x354) from [<c0008634>] (do_DataAbort+0x3c/0x9c)
> [<c00085f8>] (do_DataAbort+0x0/0x9c) from [<c000e458>] (__dabt_svc+0x38/0x60)
> Exception stack(0xc70bdea8 to 0xc70bdef0)
> dea0:                   bf05b4a0 00000000 00000000 00000001 bf05b4a0 c79a0120
> dec0: c02e1de0 c79257a0 c7803a00 c0114700 00000000 c70bdf0c c70bdf10 c70bdef0
> dee0: c01146f4 c011460c a0000013 ffffffff
>  r8:c7803a00 r7:c70bdedc r6:ffffffff r5:a0000013 r4:c011460c
> [<c01145f4>] (kobject_put+0x0/0x7c) from [<c01146f4>] (kobject_del+0x64/0x70)
>  r4:c79a0100
> [<c0114690>] (kobject_del+0x0/0x70) from [<c01147f0>] (kobject_delayed_cleanup+0xf0/0x198)
>  r4:c79a0100
> [<c0114700>] (kobject_delayed_cleanup+0x0/0x198) from [<c00318fc>] (process_one_work+0x24c/0x3a8)
>  r7:00000009 r6:00000000 r5:c785fd00 r4:c79a0120
> [<c00316b0>] (process_one_work+0x0/0x3a8) from [<c0032570>] (worker_thread+0x20c/0x428)
> [<c0032364>] (worker_thread+0x0/0x428) from [<c0037768>] (kthread+0x88/0x90)
> [<c00376e0>] (kthread+0x0/0x90) from [<c0021ac0>] (do_exit+0x0/0x670)
>  r7:00000013 r6:c0021ac0 r5:c00376e0 r4:c7839edc
> Code: e1a0c00d e92dd800 e24cb004 e5903128 (e5130004) 
> ---[ end trace ddf7f4f6a0de23b9 ]---
> Fixing recursive fault but reboot is needed!
> Unable to handle kernel paging request at virtual address fffffffc
> pgd = c0004000
> [fffffffc] *pgd=37ffe831, *pte=00000000, *ppte=00000000
> Internal error: Oops: 17 [#3]
> Modules linked in: ohci_hcd leds_s3c24xx usbcore i2c_s3c2410 i2c_core s3c_hsudc
> CPU: 0    Tainted: G      D       (3.2.0-rc5-next-20111216+ #32)
> PC is at kthread_data+0x10/0x18
> LR is at wq_worker_sleeping+0x18/0xbc
> pc : [<c00371c4>]    lr : [<c0033974>]    psr: 20000093
> sp : c70bd7c0  ip : c70bd7d0  fp : c70bd7cc
> r10: c70bc000  r9 : c70bd7f8  r8 : c02dc500
> r7 : c00371c8  r6 : c708cb00  r5 : c708cc54  r4 : 00000000
> r3 : 00000000  r2 : c02dc500  r1 : 00000000  r0 : c708cb00
> Flags: nzCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment user
> Control: 0005317f  Table: 37014000  DAC: 00000015
> Process kworker/0:1 (pid: 16, stack limit = 0xc70bc270)
> Stack: (0xc70bd7c0 to 0xc70be000)
> d7c0: c70bd7e4 c70bd7d0 c0033974 c00371c4 c003f760 0000000b c70bd86c c70bd7e8
> d7e0: c0218ebc c003396c c0023cdc 60000013 ffffffff 60000013 c70bd824 c70bd808
> d800: c005681c c0056718 0000001e 00000000 f6000000 c70bd894 c70bd834 c70bd828
> d820: c0023e4c c00567c0 00000001 000bd838 00000004 0000000b c00371c6 c708cb00
> d840: c00371c8 0000000b c00371c6 c708cb00 c00371c8 00000000 00000008 bf000000
> d860: c70bd87c c70bd870 c02194cc c0218dfc c70bd8a4 c70bd880 c0021bd4 c0219468
> d880: 00000008 bf000000 c70bd8a4 c70bd898 c001e49c c001e99c c70bd91c c70bd8a8
> d8a0: c001222c c0021ad0 c70bc270 0000000b 028959e4 00000000 65000000 63306131
> d8c0: 20643030 64323965 30303864 34326520 30306263 35652034 31333039 28203832
> d8e0: 33313565 34303030 c0002029 c0217dd8 c027dcbb fffffffc c70bdb10 00000000
> d900: 00000017 00000000 00000017 00000000 c70bd944 c70bd920 c0013808 c0011f80
> d920: c0275aa3 c02d5ccc 20000093 c70bdb10 fffffffc c708cb00 c70bda5c c70bd948
> d940: c0013b58 c00137a8 c011b37c c027a96d 00000000 00000670 c70bd9a9 0002340f
> d960: c70bd994 00000028 c011a208 c0118ee8 c014b004 c03102e3 c03106b0 c03106b0
> d980: c0275aa2 c03106b0 c70bda9c c70bd9a0 c011a584 c011a1d8 c011a550 ff0a0005
> d9a0: ffffffff c70bd9b0 5f6f6474 74697865 3078302b 3678302f 30003037 38323478
> d9c0: 00003800 31780038 00003839 c70bd9d8 c001e818 c001e70c 00001e0c 00001e0c
> d9e0: c70bda1c c70bd9f0 c001f008 c003bd00 00000000 00000000 00000000 0000001f
> da00: c70bda72 c03102b2 00000004 00000000 1b478423 c70bda50 c70bda24 c01198cc
> da20: c01196d0 65300020 c70bda72 c03102b2 0000ffff c02d5ccc 20000093 00000017
> da40: c70bdb10 fffffffc c70bdb90 c70bc000 c70bdb0c c70bda60 c0008634 c0013838
> da60: c70bda84 c70bdaae c70bdb97 0000ffff 00000002 00000000 c0281b48 00000007
> da80: c70bdb1c c70bda90 c0119ab8 c7826580 00000001 00000007 00000001 c78265b0
> daa0: c02dc500 c78265b0 00000000 c708cb00 c708cb30 00000000 c78265b0 00000000
> dac0: c70bdafc c70bdad0 c0040e5c c003e004 c003f79c c021bf08 c02dc500 c708cb00
> dae0: c7826000 c02dc500 c70bdb90 c00371c4 20000093 ffffffff c70bdb44 c02dc500
> db00: c70bdb64 c70bdb10 c000e458 c0008608 c708cb00 00000000 c02dc500 00000000
> db20: 00000000 c708cc54 c708cb00 c7826000 c02dc500 c70bdb90 c70bc000 c70bdb64
> db40: c70bdb68 c70bdb58 c0033974 c00371c4 20000093 ffffffff c70bdb7c c70bdb68
> db60: c0033974 c00371c4 c003f760 00000001 c70bdc04 c70bdb80 c0218ebc c003396c
> db80: c0406680 c70b4a40 00000664 c001c678 00000168 00000000 c70bdbcc c70bdba8
> dba0: c008cb78 c008b680 c0034390 c708cb00 c70b8440 00000001 00000000 c70b4a40
> dbc0: c70bdbdc c70bdbd0 c001c678 c708cb00 c70bdc14 c70bdbe0 c0020db4 00000001
> dbe0: c70bdc24 c708cb00 c7826000 c708cbd8 c708caf8 c708cbd8 c70bdc14 c70bdc08
> dc00: c02194cc c0218dfc c70bdc3c c70bdc18 c0022100 c0219468 00000008 00000001
> dc20: c70bdc3c c70bdc24 c70bdc24 c708cc20 c70bdcb4 c70bdc40 c001222c c0021ad0
> dc40: c70bc270 0000000b 7269762f 00000000 65000000 62633432 20343030 64343265
> dc60: 63303064 35326520 30303430 61302030 30303030 28203331 34643565 34363033
> dc80: c0002029 c0217dd8 c027dcbb bf05b504 c70bdea8 00000000 00000007 00000000
> dca0: 00000007 00000000 c70bdcdc c70bdcb8 c0013808 c0011f80 00000000 c02d5ccc
> dcc0: a0000013 c70bdea8 bf05b504 c708cb00 c70bddf4 c70bdce0 c0013b58 c00137a8
> dce0: bf01dfcc bf0200c8 00000000 00000000 c70bddc4 c70bdd00 bf01f58c 00000028
> dd00: c70bdd88 00000004 00000001 c708dbb0 00000000 00000004 00000002 c7a7e5e0
> dd20: c708cb30 00000000 c708dbb0 00000000 c70bdd6c c70bdd40 c0040e34 c0040b20
> dd40: c003f79c c021bf08 c02dc500 c708cb00 000000c3 00000001 00000001 00000001
> dd60: c70bdd8c c70bdd70 c003e080 c0040d74 c003fb2c c708db80 00000000 40000093
> dd80: c70bddac bf0203b0 00000100 c706d378 c70bddc4 c70bdda0 c0118064 c0117e6c
> dda0: 00000001 00000004 00000000 c706d0b0 c02dc500 c706d0b0 00000000 c708cb00
> ddc0: c708cb30 00000001 c706d0b0 c02d5ccc a0000013 00000007 c70bdea8 bf05b504
> dde0: c0114700 00000000 c70bdea4 c70bddf8 c0008634 c0013838 00000003 00000000
> de00: c70bde2c c70bde10 c003e080 c0040d74 c003fb2c c706d080 00000000 80000093
> de20: c70bde4c c70bde30 c003fbc0 c003e05c 00000002 c7a73f70 00000bd3 000003e0
> de40: c70bde70 c0113dc0 c003fbf8 c7a28780 c7a28730 c031fba0 c70bde98 c70bdec8
> de60: c70bde8c c70bde70 c00dda98 c008cabc c7a28780 c7a28780 00020001 c70bde94
> de80: c70bdec4 c011460c a0000013 ffffffff c70bdedc c7803a00 c70bdf0c c70bdea8
> dea0: c000e458 c0008608 bf05b4a0 00000000 00000000 00000001 bf05b4a0 c79a0120
> dec0: c02e1de0 c79257a0 c7803a00 c0114700 00000000 c70bdf0c c70bdf10 c70bdef0
> dee0: c01146f4 c011460c a0000013 ffffffff c79a0100 c79a0120 c02e1de0 c79a0100
> df00: c70bdf24 c70bdf10 c01146f4 c0114604 c01365bc c79a0100 c70bdf4c c70bdf28
> df20: c01147f0 c01146a0 c0136640 c0136590 c79a0120 c785fd00 00000000 00000009
> df40: c70bdf84 c70bdf50 c00318fc c0114710 c02dbf00 c7803a05 c02dbf00 c785fd00
> df60: c02dbf00 c785fd00 00000009 c02dbf00 c785fd10 c70bc000 c70bdfbc c70bdf88
> df80: c0032570 c00316c0 c7839edc c785fd10 c0032364 c70bdfcc c7839edc c785fd00
> dfa0: c0032364 00000000 00000000 00000000 c70bdff4 c70bdfc0 c0037768 c0032374
> dfc0: c7839edc 00000000 c785fd00 00000001 c70bdfd0 c70bdfd0 c7839edc c00376e0
> dfe0: c0021ac0 00000013 00000000 c70bdff8 c0021ac0 c00376f0 00190021 00024ea8
> Backtrace: 
> [<c00371b4>] (kthread_data+0x0/0x18) from [<c0033974>] (wq_worker_sleeping+0x18/0xbc)
> [<c003395c>] (wq_worker_sleeping+0x0/0xbc) from [<c0218ebc>] (__schedule+0xd0/0x37c)
>  r4:0000000b
> [<c0218dec>] (__schedule+0x0/0x37c) from [<c02194cc>] (schedule+0x74/0x78)
> [<c0219458>] (schedule+0x0/0x78) from [<c0021bd4>] (do_exit+0x114/0x670)
> [<c0021ac0>] (do_exit+0x0/0x670) from [<c001222c>] (die+0x2bc/0x2fc)
> [<c0011f70>] (die+0x0/0x2fc) from [<c0013808>] (__do_kernel_fault+0x70/0x90)
> [<c0013798>] (__do_kernel_fault+0x0/0x90) from [<c0013b58>] (do_page_fault+0x330/0x354)
>  r8:c708cb00 r7:fffffffc r6:c70bdb10 r5:20000093 r4:c02d5ccc
> [<c0013828>] (do_page_fault+0x0/0x354) from [<c0008634>] (do_DataAbort+0x3c/0x9c)
> [<c00085f8>] (do_DataAbort+0x0/0x9c) from [<c000e458>] (__dabt_svc+0x38/0x60)
> Exception stack(0xc70bdb10 to 0xc70bdb58)
> db00:                                     c708cb00 00000000 c02dc500 00000000
> db20: 00000000 c708cc54 c708cb00 c7826000 c02dc500 c70bdb90 c70bc000 c70bdb64
> db40: c70bdb68 c70bdb58 c0033974 c00371c4 20000093 ffffffff
>  r8:c02dc500 r7:c70bdb44 r6:ffffffff r5:20000093 r4:c00371c4
> [<c00371b4>] (kthread_data+0x0/0x18) from [<c0033974>] (wq_worker_sleeping+0x18/0xbc)
> [<c003395c>] (wq_worker_sleeping+0x0/0xbc) from [<c0218ebc>] (__schedule+0xd0/0x37c)
>  r4:00000001
> [<c0218dec>] (__schedule+0x0/0x37c) from [<c02194cc>] (schedule+0x74/0x78)
> [<c0219458>] (schedule+0x0/0x78) from [<c0022100>] (do_exit+0x640/0x670)
> [<c0021ac0>] (do_exit+0x0/0x670) from [<c001222c>] (die+0x2bc/0x2fc)
> [<c0011f70>] (die+0x0/0x2fc) from [<c0013808>] (__do_kernel_fault+0x70/0x90)
> [<c0013798>] (__do_kernel_fault+0x0/0x90) from [<c0013b58>] (do_page_fault+0x330/0x354)
>  r8:c708cb00 r7:bf05b504 r6:c70bdea8 r5:a0000013 r4:c02d5ccc
> [<c0013828>] (do_page_fault+0x0/0x354) from [<c0008634>] (do_DataAbort+0x3c/0x9c)
> [<c00085f8>] (do_DataAbort+0x0/0x9c) from [<c000e458>] (__dabt_svc+0x38/0x60)
> Exception stack(0xc70bdea8 to 0xc70bdef0)
> dea0:                   bf05b4a0 00000000 00000000 00000001 bf05b4a0 c79a0120
> dec0: c02e1de0 c79257a0 c7803a00 c0114700 00000000 c70bdf0c c70bdf10 c70bdef0
> dee0: c01146f4 c011460c a0000013 ffffffff
>  r8:c7803a00 r7:c70bdedc r6:ffffffff r5:a0000013 r4:c011460c
> [<c01145f4>] (kobject_put+0x0/0x7c) from [<c01146f4>] (kobject_del+0x64/0x70)
>  r4:c79a0100
> [<c0114690>] (kobject_del+0x0/0x70) from [<c01147f0>] (kobject_delayed_cleanup+0xf0/0x198)
>  r4:c79a0100
> [<c0114700>] (kobject_delayed_cleanup+0x0/0x198) from [<c00318fc>] (process_one_work+0x24c/0x3a8)
>  r7:00000009 r6:00000000 r5:c785fd00 r4:c79a0120
> [<c00316b0>] (process_one_work+0x0/0x3a8) from [<c0032570>] (worker_thread+0x20c/0x428)
> [<c0032364>] (worker_thread+0x0/0x428) from [<c0037768>] (kthread+0x88/0x90)
> [<c00376e0>] (kthread+0x0/0x90) from [<c0021ac0>] (do_exit+0x0/0x670)
>  r7:00000013 r6:c0021ac0 r5:c00376e0 r4:c7839edc
> Code: e1a0c00d e92dd800 e24cb004 e5903128 (e5130004) 
> ---[ end trace ddf7f4f6a0de23ba ]---
> Fixing recursive fault but reboot is needed!
> Unable to handle kernel paging request at virtual address fffffffc
> pgd = c0004000
> [fffffffc] *pgd=37ffe831, *pte=00000000, *ppte=00000000
> Internal error: Oops: 17 [#4]
> Modules linked in: ohci_hcd leds_s3c24xx usbcore i2c_s3c2410 i2c_core s3c_hsudc
> CPU: 0    Tainted: G      D       (3.2.0-rc5-next-20111216+ #32)
> PC is at kthread_data+0x10/0x18
> LR is at wq_worker_sleeping+0x18/0xbc
> pc : [<c00371c4>]    lr : [<c0033974>]    psr: 20000093
> sp : c70bd428  ip : c70bd438  fp : c70bd434
> r10: c70bc000  r9 : c70bd460  r8 : c02dc500
> r7 : c00371c8  r6 : c708cb00  r5 : c708cc54  r4 : 00000000
> r3 : 00000000  r2 : c02dc500  r1 : 00000000  r0 : c708cb00
> Flags: nzCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment user
> Control: 0005317f  Table: 37014000  DAC: 00000015
> Process kworker/0:1 (pid: 16, stack limit = 0xc70bc270)
> Stack: (0xc70bd428 to 0xc70be000)
> d420:                   c70bd44c c70bd438 c0033974 c00371c4 c003f760 0000000b
> d440: c70bd4d4 c70bd450 c0218ebc c003396c c0023cdc 60000013 ffffffff 60000013
> d460: c70bd48c c70bd470 c005681c c0056718 0000001e 00000000 f6000000 c70bd4fc
> d480: c70bd49c c70bd490 c0023e4c c00567c0 00000001 000bd4a0 00000004 0000000b
> d4a0: c00371c6 c708cb00 c00371c8 0000000b c00371c6 c708cb00 c00371c8 00000000
> d4c0: 00000008 bf000000 c70bd4e4 c70bd4d8 c02194cc c0218dfc c70bd50c c70bd4e8
> d4e0: c0021bd4 c0219468 00000008 bf000000 c70bd50c c70bd500 c001e49c c001e99c
> d500: c70bd584 c70bd510 c001222c c0021ad0 c70bc270 0000000b 00003164 00000000
> d520: 65000000 63306131 20643030 64323965 30303864 34326520 30306263 35652034
> d540: 31333039 28203832 33313565 34303030 c0002029 c0217dd8 c027dcbb fffffffc
> d560: c70bd778 00000000 00000017 00000000 00000017 00000000 c70bd5ac c70bd588
> d580: c0013808 c0011f80 c0275aa3 c02d5ccc 20000093 c70bd778 fffffffc c708cb00
> d5a0: c70bd6c4 c70bd5b0 c0013b58 c00137a8 c011b37c c027a96d 00000000 00000670
> d5c0: c70bd611 00000030 c70bd5fc 00000028 c011a208 c0118ee8 c014b004 c03102e3
> d5e0: c03106b0 c03106b0 c0275aa2 c03106b0 c70bd704 c70bd608 c011a584 c011a1d8
> d600: c011a550 ff0a0005 ffffffff c70bd618 5f6f6474 74697865 3078302b 3678302f
> d620: 30003037 38323478 00003800 31780038 c70bc000 00000000 005b8d80 00000000
> d640: c708cb30 c70bd7cc c70bd67c c70bd658 c0040818 c00406b4 00000c00 00155555
> d660: c02dfe08 c02dfd74 c70bc000 c708cb30 c70bd69c c70bd674 c70bd674 c708cb00
> d680: c70bd7cc c02ddbb0 c031e888 c70bc000 00000000 c708cb00 c70bd7cc c02d5ccc
> d6a0: 20000093 00000017 c70bd778 fffffffc c70bd7f8 c70bc000 c70bd774 c70bd6c8
> d6c0: c0008634 c0013838 c70bd724 c70bd6d8 c0028b4c c003aa98 00000001 00000001
> d6e0: c02ddbb0 c70bd6f0 c031122c c031102c c70bd6f0 c70bd6f0 00000010 00000001
> d700: 00000100 c70bc000 00000004 00000001 00000001 00000100 c70bd75c 0000002c
> d720: c70bd754 c70bd730 c014b004 c014dc28 c70bd75c c02e6290 00003cd6 0000002d
> d740: c02daa48 c02daa50 c70bd764 c70bd758 c014e9ac c00371c4 20000093 ffffffff
> d760: c70bd7ac c02dc500 c70bd7cc c70bd778 c000e458 c0008608 c708cb00 00000000
> d780: c02dc500 00000000 00000000 c708cc54 c708cb00 c00371c8 c02dc500 c70bd7f8
> d7a0: c70bc000 c70bd7cc c70bd7d0 c70bd7c0 c0033974 c00371c4 20000093 ffffffff
> d7c0: c70bd7e4 c70bd7d0 c0033974 c00371c4 c003f760 0000000b c70bd86c c70bd7e8
> d7e0: c0218ebc c003396c c0023cdc 60000013 ffffffff 60000013 c70bd824 c70bd808
> d800: c005681c c0056718 0000001e 00000000 f6000000 c70bd894 c70bd834 c70bd828
> d820: c0023e4c c00567c0 00000001 000bd838 00000004 0000000b c00371c6 c708cb00
> d840: c00371c8 0000000b c00371c6 c708cb00 c00371c8 00000000 00000008 bf000000
> d860: c70bd87c c70bd870 c02194cc c0218dfc c70bd8a4 c70bd880 c0021bd4 c0219468
> d880: 00000008 bf000000 c70bd8a4 c70bd898 c001e49c c001e99c c70bd91c c70bd8a8
> d8a0: c001222c c0021ad0 c70bc270 0000000b 028959e4 00000000 65000000 63306131
> d8c0: 20643030 64323965 30303864 34326520 30306263 35652034 31333039 28203832
> d8e0: 33313565 34303030 c0002029 c0217dd8 c027dcbb fffffffc c70bdb10 00000000
> d900: 00000017 00000000 00000017 00000000 c70bd944 c70bd920 c0013808 c0011f80
> d920: c0275aa3 c02d5ccc 20000093 c70bdb10 fffffffc c708cb00 c70bda5c c70bd948
> d940: c0013b58 c00137a8 c011b37c c027a96d 00000000 00000670 c70bd9a9 0002340f
> d960: c70bd994 00000028 c011a208 c0118ee8 c014b004 c03102e3 c03106b0 c03106b0
> d980: c0275aa2 c03106b0 c70bda9c c70bd9a0 c011a584 c011a1d8 c011a550 ff0a0005
> d9a0: ffffffff c70bd9b0 5f6f6474 74697865 3078302b 3678302f 30003037 38323478
> d9c0: 00003800 31780038 00003839 c70bd9d8 c001e818 c001e70c 00001e0c 00001e0c
> d9e0: c70bda1c c70bd9f0 c001f008 c003bd00 00000000 00000000 00000000 0000001f
> da00: c70bda72 c03102b2 00000004 00000000 1b478423 c70bda50 c70bda24 c01198cc
> da20: c01196d0 65300020 c70bda72 c03102b2 0000ffff c02d5ccc 20000093 00000017
> da40: c70bdb10 fffffffc c70bdb90 c70bc000 c70bdb0c c70bda60 c0008634 c0013838
> da60: c70bda84 c70bdaae c70bdb97 0000ffff 00000002 00000000 c0281b48 00000007
> da80: c70bdb1c c70bda90 c0119ab8 c7826580 00000001 00000007 00000001 c78265b0
> daa0: c02dc500 c78265b0 00000000 c708cb00 c708cb30 00000000 c78265b0 00000000
> dac0: c70bdafc c70bdad0 c0040e5c c003e004 c003f79c c021bf08 c02dc500 c708cb00
> dae0: c7826000 c02dc500 c70bdb90 c00371c4 20000093 ffffffff c70bdb44 c02dc500
> db00: c70bdb64 c70bdb10 c000e458 c0008608 c708cb00 00000000 c02dc500 00000000
> db20: 00000000 c708cc54 c708cb00 c7826000 c02dc500 c70bdb90 c70bc000 c70bdb64
> db40: c70bdb68 c70bdb58 c0033974 c00371c4 20000093 ffffffff c70bdb7c c70bdb68
> db60: c0033974 c00371c4 c003f760 00000001 c70bdc04 c70bdb80 c0218ebc c003396c
> db80: c0406680 c70b4a40 00000664 c001c678 00000168 00000000 c70bdbcc c70bdba8
> dba0: c008cb78 c008b680 c0034390 c708cb00 c70b8440 00000001 00000000 c70b4a40
> dbc0: c70bdbdc c70bdbd0 c001c678 c708cb00 c70bdc14 c70bdbe0 c0020db4 00000001
> dbe0: c70bdc24 c708cb00 c7826000 c708cbd8 c708caf8 c708cbd8 c70bdc14 c70bdc08
> dc00: c02194cc c0218dfc c70bdc3c c70bdc18 c0022100 c0219468 00000008 00000001
> dc20: c70bdc3c c70bdc24 c70bdc24 c708cc20 c70bdcb4 c70bdc40 c001222c c0021ad0
> dc40: c70bc270 0000000b 7269762f 00000000 65000000 62633432 20343030 64343265
> dc60: 63303064 35326520 30303430 61302030 30303030 28203331 34643565 34363033
> dc80: c0002029 c0217dd8 c027dcbb bf05b504 c70bdea8 00000000 00000007 00000000
> dca0: 00000007 00000000 c70bdcdc c70bdcb8 c0013808 c0011f80 00000000 c02d5ccc
> dcc0: a0000013 c70bdea8 bf05b504 c708cb00 c70bddf4 c70bdce0 c0013b58 c00137a8
> dce0: bf01dfcc bf0200c8 00000000 00000000 c70bddc4 c70bdd00 bf01f58c 00000028
> dd00: c70bdd88 00000004 00000001 c708dbb0 00000000 00000004 00000002 c7a7e5e0
> dd20: c708cb30 00000000 c708dbb0 00000000 c70bdd6c c70bdd40 c0040e34 c0040b20
> dd40: c003f79c c021bf08 c02dc500 c708cb00 000000c3 00000001 00000001 00000001
> dd60: c70bdd8c c70bdd70 c003e080 c0040d74 c003fb2c c708db80 00000000 40000093
> dd80: c70bddac bf0203b0 00000100 c706d378 c70bddc4 c70bdda0 c0118064 c0117e6c
> dda0: 00000001 00000004 00000000 c706d0b0 c02dc500 c706d0b0 00000000 c708cb00
> ddc0: c708cb30 00000001 c706d0b0 c02d5ccc a0000013 00000007 c70bdea8 bf05b504
> dde0: c0114700 00000000 c70bdea4 c70bddf8 c0008634 c0013838 00000003 00000000
> de00: c70bde2c c70bde10 c003e080 c0040d74 c003fb2c c706d080 00000000 80000093
> de20: c70bde4c c70bde30 c003fbc0 c003e05c 00000002 c7a73f70 00000bd3 000003e0
> de40: c70bde70 c0113dc0 c003fbf8 c7a28780 c7a28730 c031fba0 c70bde98 c70bdec8
> de60: c70bde8c c70bde70 c00dda98 c008cabc c7a28780 c7a28780 00020001 c70bde94
> de80: c70bdec4 c011460c a0000013 ffffffff c70bdedc c7803a00 c70bdf0c c70bdea8
> dea0: c000e458 c0008608 bf05b4a0 00000000 00000000 00000001 bf05b4a0 c79a0120
> dec0: c02e1de0 c79257a0 c7803a00 c0114700 00000000 c70bdf0c c70bdf10 c70bdef0
> dee0: c01146f4 c011460c a0000013 ffffffff c79a0100 c79a0120 c02e1de0 c79a0100
> df00: c70bdf24 c70bdf10 c01146f4 c0114604 c01365bc c79a0100 c70bdf4c c70bdf28
> df20: c01147f0 c01146a0 c0136640 c0136590 c79a0120 c785fd00 00000000 00000009
> df40: c70bdf84 c70bdf50 c00318fc c0114710 c02dbf00 c7803a05 c02dbf00 c785fd00
> df60: c02dbf00 c785fd00 00000009 c02dbf00 c785fd10 c70bc000 c70bdfbc c70bdf88
> df80: c0032570 c00316c0 c7839edc c785fd10 c0032364 c70bdfcc c7839edc c785fd00
> dfa0: c0032364 00000000 00000000 00000000 c70bdff4 c70bdfc0 c0037768 c0032374
> dfc0: c7839edc 00000000 c785fd00 00000001 c70bdfd0 c70bdfd0 c7839edc c00376e0
> dfe0: c0021ac0 00000013 00000000 c70bdff8 c0021ac0 c00376f0 00190021 00024ea8
> Backtrace: 
> [<c00371b4>] (kthread_data+0x0/0x18) from [<c0033974>] (wq_worker_sleeping+0x18/0xbc)
> [<c003395c>] (wq_worker_sleeping+0x0/0xbc) from [<c0218ebc>] (__schedule+0xd0/0x37c)
>  r4:0000000b
> [<c0218dec>] (__schedule+0x0/0x37c) from [<c02194cc>] (schedule+0x74/0x78)
> [<c0219458>] (schedule+0x0/0x78) from [<c0021bd4>] (do_exit+0x114/0x670)
> [<c0021ac0>] (do_exit+0x0/0x670) from [<c001222c>] (die+0x2bc/0x2fc)
> [<c0011f70>] (die+0x0/0x2fc) from [<c0013808>] (__do_kernel_fault+0x70/0x90)
> [<c0013798>] (__do_kernel_fault+0x0/0x90) from [<c0013b58>] (do_page_fault+0x330/0x354)
>  r8:c708cb00 r7:fffffffc r6:c70bd778 r5:20000093 r4:c02d5ccc
> [<c0013828>] (do_page_fault+0x0/0x354) from [<c0008634>] (do_DataAbort+0x3c/0x9c)
> [<c00085f8>] (do_DataAbort+0x0/0x9c) from [<c000e458>] (__dabt_svc+0x38/0x60)
> Exception stack(0xc70bd778 to 0xc70bd7c0)
> d760:                                                       c708cb00 00000000
> d780: c02dc500 00000000 00000000 c708cc54 c708cb00 c00371c8 c02dc500 c70bd7f8
> d7a0: c70bc000 c70bd7cc c70bd7d0 c70bd7c0 c0033974 c00371c4 20000093 ffffffff
>  r8:c02dc500 r7:c70bd7ac r6:ffffffff r5:20000093 r4:c00371c4
> [<c00371b4>] (kthread_data+0x0/0x18) from [<c0033974>] (wq_worker_sleeping+0x18/0xbc)
> [<c003395c>] (wq_worker_sleeping+0x0/0xbc) from [<c0218ebc>] (__schedule+0xd0/0x37c)
>  r4:0000000b
> [<c0218dec>] (__schedule+0x0/0x37c) from [<c02194cc>] (schedule+0x74/0x78)
> [<c0219458>] (schedule+0x0/0x78) from [<c0021bd4>] (do_exit+0x114/0x670)
> [<c0021ac0>] (do_exit+0x0/0x670) from [<c001222c>] (die+0x2bc/0x2fc)
> [<c0011f70>] (die+0x0/0x2fc) from [<c0013808>] (__do_kernel_fault+0x70/0x90)
> [<c0013798>] (__do_kernel_fault+0x0/0x90) from [<c0013b58>] (do_page_fault+0x330/0x354)
>  r8:c708cb00 r7:fffffffc r6:c70bdb10 r5:20000093 r4:c02d5ccc
> [<c0013828>] (do_page_fault+0x0/0x354) from [<c0008634>] (do_DataAbort+0x3c/0x9c)
> [<c00085f8>] (do_DataAbort+0x0/0x9c) from [<c000e458>] (__dabt_svc+0x38/0x60)
> Exception stack(0xc70bdb10 to 0xc70bdb58)
> db00:                                     c708cb00 00000000 c02dc500 00000000
> db20: 00000000 c708cc54 c708cb00 c7826000 c02dc500 c70bdb90 c70bc000 c70bdb64
> db40: c70bdb68 c70bdb58 c0033974 c00371c4 20000093 ffffffff
>  r8:c02dc500 r7:c70bdb44 r6:ffffffff r5:20000093 r4:c00371c4
> [<c00371b4>] (kthread_data+0x0/0x18) from [<c0033974>] (wq_worker_sleeping+0x18/0xbc)
> [<c003395c>] (wq_worker_sleeping+0x0/0xbc) from [<c0218ebc>] (__schedule+0xd0/0x37c)
>  r4:00000001
> [<c0218dec>] (__schedule+0x0/0x37c) from [<c02194cc>] (schedule+0x74/0x78)
> [<c0219458>] (schedule+0x0/0x78) from [<c0022100>] (do_exit+0x640/0x670)
> [<c0021ac0>] (do_exit+0x0/0x670) from [<c001222c>] (die+0x2bc/0x2fc)
> [<c0011f70>] (die+0x0/0x2fc) from [<c0013808>] (__do_kernel_fault+0x70/0x90)
> [<c0013798>] (__do_kernel_fault+0x0/0x90) from [<c0013b58>] (do_page_fault+0x330/0x354)
>  r8:c708cb00 r7:bf05b504 r6:c70bdea8 r5:a0000013 r4:c02d5ccc
> [<c0013828>] (do_page_fault+0x0/0x354) from [<c0008634>] (do_DataAbort+0x3c/0x9c)
> [<c00085f8>] (do_DataAbort+0x0/0x9c) from [<c000e458>] (__dabt_svc+0x38/0x60)
> Exception stack(0xc70bdea8 to 0xc70bdef0)
> dea0:                   bf05b4a0 00000000 00000000 00000001 bf05b4a0 c79a0120
> dec0: c02e1de0 c79257a0 c7803a00 c0114700 00000000 c70bdf0c c70bdf10 c70bdef0
> dee0: c01146f4 c011460c a0000013 ffffffff
>  r8:c7803a00 r7:c70bdedc r6:ffffffff r5:a0000013 r4:c011460c
> [<c01145f4>] (kobject_put+0x0/0x7c) from [<c01146f4>] (kobject_del+0x64/0x70)
>  r4:c79a0100
> [<c0114690>] (kobject_del+0x0/0x70) from [<c01147f0>] (kobject_delayed_cleanup+0xf0/0x198)
>  r4:c79a0100
> [<c0114700>] (kobject_delayed_cleanup+0x0/0x198) from [<c00318fc>] (process_one_work+0x24c/0x3a8)
>  r7:00000009 r6:00000000 r5:c785fd00 r4:c79a0120
> [<c00316b0>] (process_one_work+0x0/0x3a8) from [<c0032570>] (worker_thread+0x20c/0x428)
> [<c0032364>] (worker_thread+0x0/0x428) from [<c0037768>] (kthread+0x88/0x90)
> [<c00376e0>] (kthread+0x0/0x90) from [<c0021ac0>] (do_exit+0x0/0x670)
>  r7:00000013 r6:c0021ac0 r5:c00376e0 r4:c7839edc
> Code: e1a0c00d e92dd800 e24cb004 e5903128 (e5130004) 
> ---[ end trace ddf7f4f6a0de23bb ]---

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

* Re: [PATCH 3/7] s3c-hsudc: add a remove function
  2011-12-18 19:01               ` Russell King - ARM Linux
@ 2011-12-18 19:33                 ` Heiko Stübner
  -1 siblings, 0 replies; 48+ messages in thread
From: Heiko Stübner @ 2011-12-18 19:33 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: Greg KH, Felipe Balbi, Kukjin Kim, linux-samsung-soc, linux-usb,
	Thomas Abraham, linux-arm-kernel

Am Sonntag 18 Dezember 2011, 20:01:02 schrieben Sie:
> On Sun, Dec 18, 2011 at 07:50:37PM +0100, Heiko Stübner wrote:
> > I didn't get this far. With your patch the Oopses already happen during
> > the startup of the system / the loading of the modules.
> 
> > A bit of the message spew I got during testing with linux-next-20111216:
> In some way, this is a good thing because it's showing that there's
> problems with kobject lifetime rules.
> 
> The #2 and further oops dumps are a result of corrupting the work
> queues as a result of #1, so #2 onwards should be ignored.
> 
> I suspect if you avoid loading the s3c_hsudc module these will go away.

nope :-), same faults happen even if s3c-hsudc is not present at all.
So it seems, this delayed cleanup poses problems for other drivers as well.



Unable to handle kernel paging request at virtual address bf055504
pgd = c0004000
[bf055504] *pgd=3703b811, *pte=00000000, *ppte=00000000
Internal error: Oops: 7 [#1]
Modules linked in: ohci_hcd leds_s3c24xx usbcore i2c_s3c2410 i2c_core
CPU: 0    Not tainted  (3.2.0-rc5-next-20111216+ #32)
PC is at kobject_put+0x18/0x7c
LR is at kobject_del+0x64/0x70
pc : [<c011460c>]    lr : [<c01146f4>]    psr: a0000013
sp : c70bdef0  ip : c70bdf10  fp : c70bdf0c
r10: 00000000  r9 : c0114700  r8 : c7803a00
r7 : c7043200  r6 : c02e1de0  r5 : c70e5d20  r4 : bf0554a0
r3 : 00000001  r2 : 00000000  r1 : 00000000  r0 : bf0554a0
Flags: NzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
Control: 0005317f  Table: 37994000  DAC: 00000017
Process kworker/0:1 (pid: 16, stack limit = 0xc70bc270)
Stack: (0xc70bdef0 to 0xc70be000)
dee0:                                     c70e5d00 c70e5d20 c02e1de0 c70e5d00
df00: c70bdf24 c70bdf10 c01146f4 c0114604 c01365bc c70e5d00 c70bdf4c c70bdf28
df20: c01147f0 c01146a0 c0427c38 c785fd00 c70e5d20 c785fd00 00000000 00000009
df40: c70bdf84 c70bdf50 c00318fc c0114710 c02dbf00 c7803a05 c02dbf00 c785fd00
df60: c02dbf00 c785fd00 00000009 c02dbf00 c785fd10 c70bc000 c70bdfbc c70bdf88
df80: c0032570 c00316c0 c7839edc c785fd10 c0032364 c70bdfcc c7839edc c785fd00
dfa0: c0032364 00000000 00000000 00000000 c70bdff4 c70bdfc0 c0037768 c0032374
dfc0: c7839edc 00000000 c785fd00 00000000 c70bdfd0 c70bdfd0 c7839edc c00376e0
dfe0: c0021ac0 00000013 00000000 c70bdff8 c0021ac0 c00376f0 00190021 00024ea8
Backtrace: 
[<c01145f4>] (kobject_put+0x0/0x7c) from [<c01146f4>] (kobject_del+0x64/0x70)
 r4:c70e5d00
[<c0114690>] (kobject_del+0x0/0x70) from [<c01147f0>] (kobject_delayed_cleanup+0xf0/0x198)
 r4:c70e5d00
[<c0114700>] (kobject_delayed_cleanup+0x0/0x198) from [<c00318fc>] (process_one_work+0x24c/0x3a8)
 r7:00000009 r6:00000000 r5:c785fd00 r4:c70e5d20
[<c00316b0>] (process_one_work+0x0/0x3a8) from [<c0032570>] (worker_thread+0x20c/0x428)
[<c0032364>] (worker_thread+0x0/0x428) from [<c0037768>] (kthread+0x88/0x90)
[<c00376e0>] (kthread+0x0/0x90) from [<c0021ac0>] (do_exit+0x0/0x670)
 r7:00000013 r6:c0021ac0 r5:c00376e0 r4:c7839edc
Code: e24cb004 e24dd00c e2504000 0a000013 (e5d43064) 
---[ end trace ddf7f4f6a0de23b8 ]---
Unable to handle kernel paging request at virtual address fffffffc
pgd = c0004000
[fffffffc] *pgd=37ffe831, *pte=00000000, *ppte=00000000
Internal error: Oops: 17 [#2]
Modules linked in: ohci_hcd leds_s3c24xx usbcore i2c_s3c2410 i2c_core
CPU: 0    Tainted: G      D       (3.2.0-rc5-next-20111216+ #32)
PC is at kthread_data+0x10/0x18
LR is at wq_worker_sleeping+0x18/0xbc
pc : [<c00371c4>]    lr : [<c0033974>]    psr: 20000093
sp : c70bdb58  ip : c70bdb68  fp : c70bdb64
r10: c70bc000  r9 : c70bdb90  r8 : c02dc500
r7 : c7826000  r6 : c708cb00  r5 : c708cc54  r4 : 00000000
r3 : 00000000  r2 : c02dc500  r1 : 00000000  r0 : c708cb00
Flags: nzCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment user
Control: 0005317f  Table: 37994000  DAC: 00000015
Process kworker/0:1 (pid: 16, stack limit = 0xc70bc270)
Stack: (0xc70bdb58 to 0xc70be000)
db40:                                                       c70bdb7c c70bdb68
db60: c0033974 c00371c4 c003f760 00000001 c70bdc04 c70bdb80 c0218ebc c003396c
db80: c0406680 c70b4a40 000005fb c001c678 00000168 00000000 c70bdbcc c70bdba8
dba0: c008cb78 c008b680 c0034390 c708cb00 c70b8440 00000001 00000000 c70b4a40
dbc0: c70bdbdc c70bdbd0 c001c678 c708cb00 c70bdc14 c70bdbe0 c0020db4 00000001
dbe0: c70bdc24 c708cb00 c7826000 c708cbd8 c708caf8 c708cbd8 c70bdc14 c70bdc08
dc00: c02194cc c0218dfc c70bdc3c c70bdc18 c0022100 c0219468 00000008 00000001
dc20: c70bdc3c c70bdc24 c70bdc24 c708cc20 c70bdcb4 c70bdc40 c001222c c0021ad0
dc40: c70bc270 0000000b 7269762f 00000000 65000000 62633432 20343030 64343265
dc60: 63303064 35326520 30303430 61302030 30303030 28203331 34643565 34363033
dc80: c0002029 c0217dd8 c027dcbb bf055504 c70bdea8 00000000 00000007 00000000
dca0: 00000007 00000000 c70bdcdc c70bdcb8 c0013808 c0011f80 00000000 c02d5ccc
dcc0: a0000013 c70bdea8 bf055504 c708cb00 c70bddf4 c70bdce0 c0013b58 c00137a8
dce0: bf017fcc bf01a0c8 00000000 00000000 c70bddc4 c70bdd00 bf01958c 00000028
dd00: c70bdd88 00000004 00000001 c708dbb0 00000000 00000004 00000002 c798e280
dd20: c708cb30 00000000 c708dbb0 00000000 c70bdd6c c70bdd40 c0040e34 c0040b20
dd40: c003f79c c021bf08 c70bc000 00000000 005b8d80 00000000 c708cb30 c70bdee4
dd60: c70bdd94 c70bdd70 c0040818 c00406b4 c02dc500 c708cb30 c02dfe08 c02dfd74
dd80: c70bc000 c708cb30 c70bddb4 c70bdd8c c70bdd8c c708cb00 c70bdee4 c02ddbb0
dda0: c031e888 c70bc000 00000000 c708cb00 c70bdee4 c02ddbb0 c031e888 00000000
ddc0: c70bddec c70bddd0 c00290cc c02d5ccc a0000013 00000007 c70bdea8 bf055504
dde0: c0114700 00000000 c70bdea4 c70bddf8 c0008634 c0013838 c02ddbb0 c70bde08
de00: c031122c 8033002f c70bde08 c70bde08 c003fb2c 00000001 00000100 c78059c0
de20: c0417760 c793beb0 00001056 c00dda98 c0114700 00000000 c70bde6c c70bde48
de40: c008cb78 c008b680 c70bde74 c793beb0 c793be60 c031fba0 c70bde98 c70bdec8
de60: c70bde8c c70bde70 c00dda98 c008cabc c793beb0 c793beb0 00020001 c70bde94
de80: c70bdec4 c011460c a0000013 ffffffff c70bdedc c7803a00 c70bdf0c c70bdea8
dea0: c000e458 c0008608 bf0554a0 00000000 00000000 00000001 bf0554a0 c70e5d20
dec0: c02e1de0 c7043200 c7803a00 c0114700 00000000 c70bdf0c c70bdf10 c70bdef0
dee0: c01146f4 c011460c a0000013 ffffffff c70e5d00 c70e5d20 c02e1de0 c70e5d00
df00: c70bdf24 c70bdf10 c01146f4 c0114604 c01365bc c70e5d00 c70bdf4c c70bdf28
df20: c01147f0 c01146a0 c0427c38 c785fd00 c70e5d20 c785fd00 00000000 00000009
df40: c70bdf84 c70bdf50 c00318fc c0114710 c02dbf00 c7803a05 c02dbf00 c785fd00
df60: c02dbf00 c785fd00 00000009 c02dbf00 c785fd10 c70bc000 c70bdfbc c70bdf88
df80: c0032570 c00316c0 c7839edc c785fd10 c0032364 c70bdfcc c7839edc c785fd00
dfa0: c0032364 00000000 00000000 00000000 c70bdff4 c70bdfc0 c0037768 c0032374
dfc0: c7839edc 00000000 c785fd00 00000001 c70bdfd0 c70bdfd0 c7839edc c00376e0
dfe0: c0021ac0 00000013 00000000 c70bdff8 c0021ac0 c00376f0 00190021 00024ea8
Backtrace: 
[<c00371b4>] (kthread_data+0x0/0x18) from [<c0033974>] (wq_worker_sleeping+0x18/0xbc)
[<c003395c>] (wq_worker_sleeping+0x0/0xbc) from [<c0218ebc>] (__schedule+0xd0/0x37c)
 r4:00000001
[<c0218dec>] (__schedule+0x0/0x37c) from [<c02194cc>] (schedule+0x74/0x78)
[<c0219458>] (schedule+0x0/0x78) from [<c0022100>] (do_exit+0x640/0x670)
[<c0021ac0>] (do_exit+0x0/0x670) from [<c001222c>] (die+0x2bc/0x2fc)
[<c0011f70>] (die+0x0/0x2fc) from [<c0013808>] (__do_kernel_fault+0x70/0x90)
[<c0013798>] (__do_kernel_fault+0x0/0x90) from [<c0013b58>] (do_page_fault+0x330/0x354)
 r8:c708cb00 r7:bf055504 r6:c70bdea8 r5:a0000013 r4:c02d5ccc
[<c0013828>] (do_page_fault+0x0/0x354) from [<c0008634>] (do_DataAbort+0x3c/0x9c)
[<c00085f8>] (do_DataAbort+0x0/0x9c) from [<c000e458>] (__dabt_svc+0x38/0x60)
Exception stack(0xc70bdea8 to 0xc70bdef0)
dea0:                   bf0554a0 00000000 00000000 00000001 bf0554a0 c70e5d20
dec0: c02e1de0 c7043200 c7803a00 c0114700 00000000 c70bdf0c c70bdf10 c70bdef0
dee0: c01146f4 c011460c a0000013 ffffffff
 r8:c7803a00 r7:c70bdedc r6:ffffffff r5:a0000013 r4:c011460c
[<c01145f4>] (kobject_put+0x0/0x7c) from [<c01146f4>] (kobject_del+0x64/0x70)
 r4:c70e5d00
[<c0114690>] (kobject_del+0x0/0x70) from [<c01147f0>] (kobject_delayed_cleanup+0xf0/0x198)
 r4:c70e5d00
[<c0114700>] (kobject_delayed_cleanup+0x0/0x198) from [<c00318fc>] (process_one_work+0x24c/0x3a8)
 r7:00000009 r6:00000000 r5:c785fd00 r4:c70e5d20
[<c00316b0>] (process_one_work+0x0/0x3a8) from [<c0032570>] (worker_thread+0x20c/0x428)
[<c0032364>] (worker_thread+0x0/0x428) from [<c0037768>] (kthread+0x88/0x90)
[<c00376e0>] (kthread+0x0/0x90) from [<c0021ac0>] (do_exit+0x0/0x670)
 r7:00000013 r6:c0021ac0 r5:c00376e0 r4:c7839edc
Code: e1a0c00d e92dd800 e24cb004 e5903128 (e5130004) 
---[ end trace ddf7f4f6a0de23b9 ]---

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

* [PATCH 3/7] s3c-hsudc: add a remove function
@ 2011-12-18 19:33                 ` Heiko Stübner
  0 siblings, 0 replies; 48+ messages in thread
From: Heiko Stübner @ 2011-12-18 19:33 UTC (permalink / raw)
  To: linux-arm-kernel

Am Sonntag 18 Dezember 2011, 20:01:02 schrieben Sie:
> On Sun, Dec 18, 2011 at 07:50:37PM +0100, Heiko St?bner wrote:
> > I didn't get this far. With your patch the Oopses already happen during
> > the startup of the system / the loading of the modules.
> 
> > A bit of the message spew I got during testing with linux-next-20111216:
> In some way, this is a good thing because it's showing that there's
> problems with kobject lifetime rules.
> 
> The #2 and further oops dumps are a result of corrupting the work
> queues as a result of #1, so #2 onwards should be ignored.
> 
> I suspect if you avoid loading the s3c_hsudc module these will go away.

nope :-), same faults happen even if s3c-hsudc is not present at all.
So it seems, this delayed cleanup poses problems for other drivers as well.



Unable to handle kernel paging request at virtual address bf055504
pgd = c0004000
[bf055504] *pgd=3703b811, *pte=00000000, *ppte=00000000
Internal error: Oops: 7 [#1]
Modules linked in: ohci_hcd leds_s3c24xx usbcore i2c_s3c2410 i2c_core
CPU: 0    Not tainted  (3.2.0-rc5-next-20111216+ #32)
PC is at kobject_put+0x18/0x7c
LR is at kobject_del+0x64/0x70
pc : [<c011460c>]    lr : [<c01146f4>]    psr: a0000013
sp : c70bdef0  ip : c70bdf10  fp : c70bdf0c
r10: 00000000  r9 : c0114700  r8 : c7803a00
r7 : c7043200  r6 : c02e1de0  r5 : c70e5d20  r4 : bf0554a0
r3 : 00000001  r2 : 00000000  r1 : 00000000  r0 : bf0554a0
Flags: NzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
Control: 0005317f  Table: 37994000  DAC: 00000017
Process kworker/0:1 (pid: 16, stack limit = 0xc70bc270)
Stack: (0xc70bdef0 to 0xc70be000)
dee0:                                     c70e5d00 c70e5d20 c02e1de0 c70e5d00
df00: c70bdf24 c70bdf10 c01146f4 c0114604 c01365bc c70e5d00 c70bdf4c c70bdf28
df20: c01147f0 c01146a0 c0427c38 c785fd00 c70e5d20 c785fd00 00000000 00000009
df40: c70bdf84 c70bdf50 c00318fc c0114710 c02dbf00 c7803a05 c02dbf00 c785fd00
df60: c02dbf00 c785fd00 00000009 c02dbf00 c785fd10 c70bc000 c70bdfbc c70bdf88
df80: c0032570 c00316c0 c7839edc c785fd10 c0032364 c70bdfcc c7839edc c785fd00
dfa0: c0032364 00000000 00000000 00000000 c70bdff4 c70bdfc0 c0037768 c0032374
dfc0: c7839edc 00000000 c785fd00 00000000 c70bdfd0 c70bdfd0 c7839edc c00376e0
dfe0: c0021ac0 00000013 00000000 c70bdff8 c0021ac0 c00376f0 00190021 00024ea8
Backtrace: 
[<c01145f4>] (kobject_put+0x0/0x7c) from [<c01146f4>] (kobject_del+0x64/0x70)
 r4:c70e5d00
[<c0114690>] (kobject_del+0x0/0x70) from [<c01147f0>] (kobject_delayed_cleanup+0xf0/0x198)
 r4:c70e5d00
[<c0114700>] (kobject_delayed_cleanup+0x0/0x198) from [<c00318fc>] (process_one_work+0x24c/0x3a8)
 r7:00000009 r6:00000000 r5:c785fd00 r4:c70e5d20
[<c00316b0>] (process_one_work+0x0/0x3a8) from [<c0032570>] (worker_thread+0x20c/0x428)
[<c0032364>] (worker_thread+0x0/0x428) from [<c0037768>] (kthread+0x88/0x90)
[<c00376e0>] (kthread+0x0/0x90) from [<c0021ac0>] (do_exit+0x0/0x670)
 r7:00000013 r6:c0021ac0 r5:c00376e0 r4:c7839edc
Code: e24cb004 e24dd00c e2504000 0a000013 (e5d43064) 
---[ end trace ddf7f4f6a0de23b8 ]---
Unable to handle kernel paging request at virtual address fffffffc
pgd = c0004000
[fffffffc] *pgd=37ffe831, *pte=00000000, *ppte=00000000
Internal error: Oops: 17 [#2]
Modules linked in: ohci_hcd leds_s3c24xx usbcore i2c_s3c2410 i2c_core
CPU: 0    Tainted: G      D       (3.2.0-rc5-next-20111216+ #32)
PC is at kthread_data+0x10/0x18
LR is at wq_worker_sleeping+0x18/0xbc
pc : [<c00371c4>]    lr : [<c0033974>]    psr: 20000093
sp : c70bdb58  ip : c70bdb68  fp : c70bdb64
r10: c70bc000  r9 : c70bdb90  r8 : c02dc500
r7 : c7826000  r6 : c708cb00  r5 : c708cc54  r4 : 00000000
r3 : 00000000  r2 : c02dc500  r1 : 00000000  r0 : c708cb00
Flags: nzCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment user
Control: 0005317f  Table: 37994000  DAC: 00000015
Process kworker/0:1 (pid: 16, stack limit = 0xc70bc270)
Stack: (0xc70bdb58 to 0xc70be000)
db40:                                                       c70bdb7c c70bdb68
db60: c0033974 c00371c4 c003f760 00000001 c70bdc04 c70bdb80 c0218ebc c003396c
db80: c0406680 c70b4a40 000005fb c001c678 00000168 00000000 c70bdbcc c70bdba8
dba0: c008cb78 c008b680 c0034390 c708cb00 c70b8440 00000001 00000000 c70b4a40
dbc0: c70bdbdc c70bdbd0 c001c678 c708cb00 c70bdc14 c70bdbe0 c0020db4 00000001
dbe0: c70bdc24 c708cb00 c7826000 c708cbd8 c708caf8 c708cbd8 c70bdc14 c70bdc08
dc00: c02194cc c0218dfc c70bdc3c c70bdc18 c0022100 c0219468 00000008 00000001
dc20: c70bdc3c c70bdc24 c70bdc24 c708cc20 c70bdcb4 c70bdc40 c001222c c0021ad0
dc40: c70bc270 0000000b 7269762f 00000000 65000000 62633432 20343030 64343265
dc60: 63303064 35326520 30303430 61302030 30303030 28203331 34643565 34363033
dc80: c0002029 c0217dd8 c027dcbb bf055504 c70bdea8 00000000 00000007 00000000
dca0: 00000007 00000000 c70bdcdc c70bdcb8 c0013808 c0011f80 00000000 c02d5ccc
dcc0: a0000013 c70bdea8 bf055504 c708cb00 c70bddf4 c70bdce0 c0013b58 c00137a8
dce0: bf017fcc bf01a0c8 00000000 00000000 c70bddc4 c70bdd00 bf01958c 00000028
dd00: c70bdd88 00000004 00000001 c708dbb0 00000000 00000004 00000002 c798e280
dd20: c708cb30 00000000 c708dbb0 00000000 c70bdd6c c70bdd40 c0040e34 c0040b20
dd40: c003f79c c021bf08 c70bc000 00000000 005b8d80 00000000 c708cb30 c70bdee4
dd60: c70bdd94 c70bdd70 c0040818 c00406b4 c02dc500 c708cb30 c02dfe08 c02dfd74
dd80: c70bc000 c708cb30 c70bddb4 c70bdd8c c70bdd8c c708cb00 c70bdee4 c02ddbb0
dda0: c031e888 c70bc000 00000000 c708cb00 c70bdee4 c02ddbb0 c031e888 00000000
ddc0: c70bddec c70bddd0 c00290cc c02d5ccc a0000013 00000007 c70bdea8 bf055504
dde0: c0114700 00000000 c70bdea4 c70bddf8 c0008634 c0013838 c02ddbb0 c70bde08
de00: c031122c 8033002f c70bde08 c70bde08 c003fb2c 00000001 00000100 c78059c0
de20: c0417760 c793beb0 00001056 c00dda98 c0114700 00000000 c70bde6c c70bde48
de40: c008cb78 c008b680 c70bde74 c793beb0 c793be60 c031fba0 c70bde98 c70bdec8
de60: c70bde8c c70bde70 c00dda98 c008cabc c793beb0 c793beb0 00020001 c70bde94
de80: c70bdec4 c011460c a0000013 ffffffff c70bdedc c7803a00 c70bdf0c c70bdea8
dea0: c000e458 c0008608 bf0554a0 00000000 00000000 00000001 bf0554a0 c70e5d20
dec0: c02e1de0 c7043200 c7803a00 c0114700 00000000 c70bdf0c c70bdf10 c70bdef0
dee0: c01146f4 c011460c a0000013 ffffffff c70e5d00 c70e5d20 c02e1de0 c70e5d00
df00: c70bdf24 c70bdf10 c01146f4 c0114604 c01365bc c70e5d00 c70bdf4c c70bdf28
df20: c01147f0 c01146a0 c0427c38 c785fd00 c70e5d20 c785fd00 00000000 00000009
df40: c70bdf84 c70bdf50 c00318fc c0114710 c02dbf00 c7803a05 c02dbf00 c785fd00
df60: c02dbf00 c785fd00 00000009 c02dbf00 c785fd10 c70bc000 c70bdfbc c70bdf88
df80: c0032570 c00316c0 c7839edc c785fd10 c0032364 c70bdfcc c7839edc c785fd00
dfa0: c0032364 00000000 00000000 00000000 c70bdff4 c70bdfc0 c0037768 c0032374
dfc0: c7839edc 00000000 c785fd00 00000001 c70bdfd0 c70bdfd0 c7839edc c00376e0
dfe0: c0021ac0 00000013 00000000 c70bdff8 c0021ac0 c00376f0 00190021 00024ea8
Backtrace: 
[<c00371b4>] (kthread_data+0x0/0x18) from [<c0033974>] (wq_worker_sleeping+0x18/0xbc)
[<c003395c>] (wq_worker_sleeping+0x0/0xbc) from [<c0218ebc>] (__schedule+0xd0/0x37c)
 r4:00000001
[<c0218dec>] (__schedule+0x0/0x37c) from [<c02194cc>] (schedule+0x74/0x78)
[<c0219458>] (schedule+0x0/0x78) from [<c0022100>] (do_exit+0x640/0x670)
[<c0021ac0>] (do_exit+0x0/0x670) from [<c001222c>] (die+0x2bc/0x2fc)
[<c0011f70>] (die+0x0/0x2fc) from [<c0013808>] (__do_kernel_fault+0x70/0x90)
[<c0013798>] (__do_kernel_fault+0x0/0x90) from [<c0013b58>] (do_page_fault+0x330/0x354)
 r8:c708cb00 r7:bf055504 r6:c70bdea8 r5:a0000013 r4:c02d5ccc
[<c0013828>] (do_page_fault+0x0/0x354) from [<c0008634>] (do_DataAbort+0x3c/0x9c)
[<c00085f8>] (do_DataAbort+0x0/0x9c) from [<c000e458>] (__dabt_svc+0x38/0x60)
Exception stack(0xc70bdea8 to 0xc70bdef0)
dea0:                   bf0554a0 00000000 00000000 00000001 bf0554a0 c70e5d20
dec0: c02e1de0 c7043200 c7803a00 c0114700 00000000 c70bdf0c c70bdf10 c70bdef0
dee0: c01146f4 c011460c a0000013 ffffffff
 r8:c7803a00 r7:c70bdedc r6:ffffffff r5:a0000013 r4:c011460c
[<c01145f4>] (kobject_put+0x0/0x7c) from [<c01146f4>] (kobject_del+0x64/0x70)
 r4:c70e5d00
[<c0114690>] (kobject_del+0x0/0x70) from [<c01147f0>] (kobject_delayed_cleanup+0xf0/0x198)
 r4:c70e5d00
[<c0114700>] (kobject_delayed_cleanup+0x0/0x198) from [<c00318fc>] (process_one_work+0x24c/0x3a8)
 r7:00000009 r6:00000000 r5:c785fd00 r4:c70e5d20
[<c00316b0>] (process_one_work+0x0/0x3a8) from [<c0032570>] (worker_thread+0x20c/0x428)
[<c0032364>] (worker_thread+0x0/0x428) from [<c0037768>] (kthread+0x88/0x90)
[<c00376e0>] (kthread+0x0/0x90) from [<c0021ac0>] (do_exit+0x0/0x670)
 r7:00000013 r6:c0021ac0 r5:c00376e0 r4:c7839edc
Code: e1a0c00d e92dd800 e24cb004 e5903128 (e5130004) 
---[ end trace ddf7f4f6a0de23b9 ]---

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

* Re: [PATCH 3/7] s3c-hsudc: add a remove function
  2011-12-18 19:33                 ` Heiko Stübner
@ 2011-12-18 19:45                   ` Russell King - ARM Linux
  -1 siblings, 0 replies; 48+ messages in thread
From: Russell King - ARM Linux @ 2011-12-18 19:45 UTC (permalink / raw)
  To: Heiko Stübner
  Cc: Greg KH, Felipe Balbi, Kukjin Kim, linux-samsung-soc, linux-usb,
	Thomas Abraham, linux-arm-kernel

On Sun, Dec 18, 2011 at 08:33:32PM +0100, Heiko Stübner wrote:
> Am Sonntag 18 Dezember 2011, 20:01:02 schrieben Sie:
> > On Sun, Dec 18, 2011 at 07:50:37PM +0100, Heiko Stübner wrote:
> > > I didn't get this far. With your patch the Oopses already happen during
> > > the startup of the system / the loading of the modules.
> > 
> > > A bit of the message spew I got during testing with linux-next-20111216:
> > In some way, this is a good thing because it's showing that there's
> > problems with kobject lifetime rules.
> > 
> > The #2 and further oops dumps are a result of corrupting the work
> > queues as a result of #1, so #2 onwards should be ignored.
> > 
> > I suspect if you avoid loading the s3c_hsudc module these will go away.
> 
> nope :-), same faults happen even if s3c-hsudc is not present at all.
> So it seems, this delayed cleanup poses problems for other drivers as well.

Okay, let's try to find out which one it is.  Please use the attached
patch - it'll be a little more noisy, reporting which kobjects are
being released at the point when they're added to the workqueue.

Thanks.

diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index ad81e1c..be1c97a 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -26,6 +26,9 @@
 #include <linux/kernel.h>
 #include <linux/wait.h>
 #include <linux/atomic.h>
+#include <linux/workqueue.h>
+
+#define KOBJECT_DEBUG_RELEASE
 
 #define UEVENT_HELPER_PATH_LEN		256
 #define UEVENT_NUM_ENVP			32	/* number of env pointers */
@@ -65,6 +68,9 @@ struct kobject {
 	struct kobj_type	*ktype;
 	struct sysfs_dirent	*sd;
 	struct kref		kref;
+#ifdef KOBJECT_DEBUG_RELEASE
+	struct delayed_work	release;
+#endif
 	unsigned int state_initialized:1;
 	unsigned int state_in_sysfs:1;
 	unsigned int state_add_uevent_sent:1;
diff --git a/lib/kobject.c b/lib/kobject.c
index 640bd98..5c01a78 100644
--- a/lib/kobject.c
+++ b/lib/kobject.c
@@ -540,7 +540,7 @@ static void kobject_cleanup(struct kobject *kobj)
 	struct kobj_type *t = get_ktype(kobj);
 	const char *name = kobj->name;
 
-	pr_debug("kobject: '%s' (%p): %s\n",
+	pr_info("kobject: '%s' (%p): %s\n",
 		 kobject_name(kobj), kobj, __func__);
 
 	if (t && !t->release)
@@ -575,9 +575,25 @@ static void kobject_cleanup(struct kobject *kobj)
 	}
 }
 
+#ifdef KOBJECT_DEBUG_RELEASE
+static void kobject_delayed_cleanup(struct work_struct *work)
+{
+	kobject_cleanup(container_of(to_delayed_work(work),
+				     struct kobject, release));
+}
+#endif
+
 static void kobject_release(struct kref *kref)
 {
-	kobject_cleanup(container_of(kref, struct kobject, kref));
+	struct kobject *kobj = container_of(kref, struct kobject, kref);
+#ifdef KOBJECT_DEBUG_RELEASE
+	pr_info("kobject: '%s' (%p): %s\n",
+		 kobject_name(kobj), kobj, __func__);
+	INIT_DELAYED_WORK(&kobj->release, kobject_delayed_cleanup);
+	schedule_delayed_work(&kobj->release, HZ);
+#else
+	kobject_cleanup(kobj);
+#endif
 }
 
 /**

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

* [PATCH 3/7] s3c-hsudc: add a remove function
@ 2011-12-18 19:45                   ` Russell King - ARM Linux
  0 siblings, 0 replies; 48+ messages in thread
From: Russell King - ARM Linux @ 2011-12-18 19:45 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, Dec 18, 2011 at 08:33:32PM +0100, Heiko St?bner wrote:
> Am Sonntag 18 Dezember 2011, 20:01:02 schrieben Sie:
> > On Sun, Dec 18, 2011 at 07:50:37PM +0100, Heiko St?bner wrote:
> > > I didn't get this far. With your patch the Oopses already happen during
> > > the startup of the system / the loading of the modules.
> > 
> > > A bit of the message spew I got during testing with linux-next-20111216:
> > In some way, this is a good thing because it's showing that there's
> > problems with kobject lifetime rules.
> > 
> > The #2 and further oops dumps are a result of corrupting the work
> > queues as a result of #1, so #2 onwards should be ignored.
> > 
> > I suspect if you avoid loading the s3c_hsudc module these will go away.
> 
> nope :-), same faults happen even if s3c-hsudc is not present at all.
> So it seems, this delayed cleanup poses problems for other drivers as well.

Okay, let's try to find out which one it is.  Please use the attached
patch - it'll be a little more noisy, reporting which kobjects are
being released at the point when they're added to the workqueue.

Thanks.

diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index ad81e1c..be1c97a 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -26,6 +26,9 @@
 #include <linux/kernel.h>
 #include <linux/wait.h>
 #include <linux/atomic.h>
+#include <linux/workqueue.h>
+
+#define KOBJECT_DEBUG_RELEASE
 
 #define UEVENT_HELPER_PATH_LEN		256
 #define UEVENT_NUM_ENVP			32	/* number of env pointers */
@@ -65,6 +68,9 @@ struct kobject {
 	struct kobj_type	*ktype;
 	struct sysfs_dirent	*sd;
 	struct kref		kref;
+#ifdef KOBJECT_DEBUG_RELEASE
+	struct delayed_work	release;
+#endif
 	unsigned int state_initialized:1;
 	unsigned int state_in_sysfs:1;
 	unsigned int state_add_uevent_sent:1;
diff --git a/lib/kobject.c b/lib/kobject.c
index 640bd98..5c01a78 100644
--- a/lib/kobject.c
+++ b/lib/kobject.c
@@ -540,7 +540,7 @@ static void kobject_cleanup(struct kobject *kobj)
 	struct kobj_type *t = get_ktype(kobj);
 	const char *name = kobj->name;
 
-	pr_debug("kobject: '%s' (%p): %s\n",
+	pr_info("kobject: '%s' (%p): %s\n",
 		 kobject_name(kobj), kobj, __func__);
 
 	if (t && !t->release)
@@ -575,9 +575,25 @@ static void kobject_cleanup(struct kobject *kobj)
 	}
 }
 
+#ifdef KOBJECT_DEBUG_RELEASE
+static void kobject_delayed_cleanup(struct work_struct *work)
+{
+	kobject_cleanup(container_of(to_delayed_work(work),
+				     struct kobject, release));
+}
+#endif
+
 static void kobject_release(struct kref *kref)
 {
-	kobject_cleanup(container_of(kref, struct kobject, kref));
+	struct kobject *kobj = container_of(kref, struct kobject, kref);
+#ifdef KOBJECT_DEBUG_RELEASE
+	pr_info("kobject: '%s' (%p): %s\n",
+		 kobject_name(kobj), kobj, __func__);
+	INIT_DELAYED_WORK(&kobj->release, kobject_delayed_cleanup);
+	schedule_delayed_work(&kobj->release, HZ);
+#else
+	kobject_cleanup(kobj);
+#endif
 }
 
 /**

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

* Re: [PATCH 3/7] s3c-hsudc: add a remove function
  2011-12-18 19:45                   ` Russell King - ARM Linux
@ 2011-12-18 20:24                     ` Heiko Stübner
  -1 siblings, 0 replies; 48+ messages in thread
From: Heiko Stübner @ 2011-12-18 20:24 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: Greg KH, Felipe Balbi, Kukjin Kim, linux-samsung-soc, linux-usb,
	Thomas Abraham, linux-arm-kernel

Am Sonntag 18 Dezember 2011, 20:45:18 schrieb Russell King - ARM Linux:
> On Sun, Dec 18, 2011 at 08:33:32PM +0100, Heiko Stübner wrote:
> > Am Sonntag 18 Dezember 2011, 20:01:02 schrieben Sie:
> > > On Sun, Dec 18, 2011 at 07:50:37PM +0100, Heiko Stübner wrote:
> > > > I didn't get this far. With your patch the Oopses already happen
> > > > during the startup of the system / the loading of the modules.
> > > 
> > > > A bit of the message spew I got during testing with linux-
next-20111216:
> > > In some way, this is a good thing because it's showing that there's
> > > problems with kobject lifetime rules.
> > > 
> > > The #2 and further oops dumps are a result of corrupting the work
> > > queues as a result of #1, so #2 onwards should be ignored.
> > > 
> > > I suspect if you avoid loading the s3c_hsudc module these will go away.
> > 
> > nope :-), same faults happen even if s3c-hsudc is not present at all.
> > So it seems, this delayed cleanup poses problems for other drivers as
> > well.
> 
> Okay, let's try to find out which one it is.  Please use the attached
> patch - it'll be a little more noisy, reporting which kobjects are
> being released at the point when they're added to the workqueue.
The cuplrit seems to be a kobject named "holders" and from what I
gathered is from kernel/module.c and handling module sysfs entries.


Partial log below:

kobject: 'bq24022' (c78a9a80): kobject_release
[...]
kobject: 'gpio-vbus' (c78a9cc0): kobject_release
[...]
kobject: 'bq24022' (c78a9a80): kobject_cleanup
kobject: 'gpio-vbus' (c78a9cc0): kobject_cleanup
[...]
Found /sbin/init, booting ...

INIT: version 2.88 booting

Starting the hotplug events dispatcher: udevdudevd[367]: starting version 172
.
Synthesizing the initial hotplug events...done.
Waiting for /dev to be fully populated...
[...]
Cleaning up ifupdown....
Loading kernel modules...
kobject: 'holders' (c7addc80): kobject_release
kobject: 'notes' (c7add080): kobject_release
done.
Activating lvm and md swap...done.
Checking file systems...fsck from util-linux 2.19.1
done.
[...]
kobject: 'holders' (c7addc80): kobject_cleanup
Unable to handle kernel paging request at virtual address bf055504
pgd = c0004000
[bf055504] *pgd=371f9811, *pte=00000000, *ppte=00000000
Internal error: Oops: 7 [#1]

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

* [PATCH 3/7] s3c-hsudc: add a remove function
@ 2011-12-18 20:24                     ` Heiko Stübner
  0 siblings, 0 replies; 48+ messages in thread
From: Heiko Stübner @ 2011-12-18 20:24 UTC (permalink / raw)
  To: linux-arm-kernel

Am Sonntag 18 Dezember 2011, 20:45:18 schrieb Russell King - ARM Linux:
> On Sun, Dec 18, 2011 at 08:33:32PM +0100, Heiko St?bner wrote:
> > Am Sonntag 18 Dezember 2011, 20:01:02 schrieben Sie:
> > > On Sun, Dec 18, 2011 at 07:50:37PM +0100, Heiko St?bner wrote:
> > > > I didn't get this far. With your patch the Oopses already happen
> > > > during the startup of the system / the loading of the modules.
> > > 
> > > > A bit of the message spew I got during testing with linux-
next-20111216:
> > > In some way, this is a good thing because it's showing that there's
> > > problems with kobject lifetime rules.
> > > 
> > > The #2 and further oops dumps are a result of corrupting the work
> > > queues as a result of #1, so #2 onwards should be ignored.
> > > 
> > > I suspect if you avoid loading the s3c_hsudc module these will go away.
> > 
> > nope :-), same faults happen even if s3c-hsudc is not present at all.
> > So it seems, this delayed cleanup poses problems for other drivers as
> > well.
> 
> Okay, let's try to find out which one it is.  Please use the attached
> patch - it'll be a little more noisy, reporting which kobjects are
> being released at the point when they're added to the workqueue.
The cuplrit seems to be a kobject named "holders" and from what I
gathered is from kernel/module.c and handling module sysfs entries.


Partial log below:

kobject: 'bq24022' (c78a9a80): kobject_release
[...]
kobject: 'gpio-vbus' (c78a9cc0): kobject_release
[...]
kobject: 'bq24022' (c78a9a80): kobject_cleanup
kobject: 'gpio-vbus' (c78a9cc0): kobject_cleanup
[...]
Found /sbin/init, booting ...

INIT: version 2.88 booting

Starting the hotplug events dispatcher: udevdudevd[367]: starting version 172
.
Synthesizing the initial hotplug events...done.
Waiting for /dev to be fully populated...
[...]
Cleaning up ifupdown....
Loading kernel modules...
kobject: 'holders' (c7addc80): kobject_release
kobject: 'notes' (c7add080): kobject_release
done.
Activating lvm and md swap...done.
Checking file systems...fsck from util-linux 2.19.1
done.
[...]
kobject: 'holders' (c7addc80): kobject_cleanup
Unable to handle kernel paging request at virtual address bf055504
pgd = c0004000
[bf055504] *pgd=371f9811, *pte=00000000, *ppte=00000000
Internal error: Oops: 7 [#1]

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

* Re: [PATCH 3/7] s3c-hsudc: add a remove function
  2011-12-18 20:24                     ` Heiko Stübner
@ 2011-12-18 20:39                         ` Russell King - ARM Linux
  -1 siblings, 0 replies; 48+ messages in thread
From: Russell King - ARM Linux @ 2011-12-18 20:39 UTC (permalink / raw)
  To: Heiko Stübner
  Cc: Greg KH, Felipe Balbi, Kukjin Kim,
	linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
	linux-usb-u79uwXL29TY76Z2rM5mHXA, Thomas Abraham,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Sun, Dec 18, 2011 at 09:24:12PM +0100, Heiko Stübner wrote:
> Am Sonntag 18 Dezember 2011, 20:45:18 schrieb Russell King - ARM Linux:
> > On Sun, Dec 18, 2011 at 08:33:32PM +0100, Heiko Stübner wrote:
> > > Am Sonntag 18 Dezember 2011, 20:01:02 schrieben Sie:
> > > > On Sun, Dec 18, 2011 at 07:50:37PM +0100, Heiko Stübner wrote:
> > > > > I didn't get this far. With your patch the Oopses already happen
> > > > > during the startup of the system / the loading of the modules.
> > > > 
> > > > > A bit of the message spew I got during testing with linux-
> next-20111216:
> > > > In some way, this is a good thing because it's showing that there's
> > > > problems with kobject lifetime rules.
> > > > 
> > > > The #2 and further oops dumps are a result of corrupting the work
> > > > queues as a result of #1, so #2 onwards should be ignored.
> > > > 
> > > > I suspect if you avoid loading the s3c_hsudc module these will go away.
> > > 
> > > nope :-), same faults happen even if s3c-hsudc is not present at all.
> > > So it seems, this delayed cleanup poses problems for other drivers as
> > > well.
> > 
> > Okay, let's try to find out which one it is.  Please use the attached
> > patch - it'll be a little more noisy, reporting which kobjects are
> > being released at the point when they're added to the workqueue.
> The cuplrit seems to be a kobject named "holders" and from what I
> gathered is from kernel/module.c and handling module sysfs entries.
> 
> 
> Partial log below:
> 
> kobject: 'bq24022' (c78a9a80): kobject_release
> [...]
> kobject: 'gpio-vbus' (c78a9cc0): kobject_release
> [...]
> kobject: 'bq24022' (c78a9a80): kobject_cleanup
> kobject: 'gpio-vbus' (c78a9cc0): kobject_cleanup
> [...]
> Found /sbin/init, booting ...
> 
> INIT: version 2.88 booting
> 
> Starting the hotplug events dispatcher: udevdudevd[367]: starting version 172
> .
> Synthesizing the initial hotplug events...done.
> Waiting for /dev to be fully populated...
> [...]
> Cleaning up ifupdown....
> Loading kernel modules...
> kobject: 'holders' (c7addc80): kobject_release
> kobject: 'notes' (c7add080): kobject_release
> done.
> Activating lvm and md swap...done.
> Checking file systems...fsck from util-linux 2.19.1
> done.
> [...]
> kobject: 'holders' (c7addc80): kobject_cleanup
> Unable to handle kernel paging request at virtual address bf055504
> pgd = c0004000
> [bf055504] *pgd=371f9811, *pte=00000000, *ppte=00000000
> Internal error: Oops: 7 [#1]

Please post the entire first oops dump for the above run - it may contain
useful information to properly track this down.

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

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

* [PATCH 3/7] s3c-hsudc: add a remove function
@ 2011-12-18 20:39                         ` Russell King - ARM Linux
  0 siblings, 0 replies; 48+ messages in thread
From: Russell King - ARM Linux @ 2011-12-18 20:39 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, Dec 18, 2011 at 09:24:12PM +0100, Heiko St?bner wrote:
> Am Sonntag 18 Dezember 2011, 20:45:18 schrieb Russell King - ARM Linux:
> > On Sun, Dec 18, 2011 at 08:33:32PM +0100, Heiko St?bner wrote:
> > > Am Sonntag 18 Dezember 2011, 20:01:02 schrieben Sie:
> > > > On Sun, Dec 18, 2011 at 07:50:37PM +0100, Heiko St?bner wrote:
> > > > > I didn't get this far. With your patch the Oopses already happen
> > > > > during the startup of the system / the loading of the modules.
> > > > 
> > > > > A bit of the message spew I got during testing with linux-
> next-20111216:
> > > > In some way, this is a good thing because it's showing that there's
> > > > problems with kobject lifetime rules.
> > > > 
> > > > The #2 and further oops dumps are a result of corrupting the work
> > > > queues as a result of #1, so #2 onwards should be ignored.
> > > > 
> > > > I suspect if you avoid loading the s3c_hsudc module these will go away.
> > > 
> > > nope :-), same faults happen even if s3c-hsudc is not present at all.
> > > So it seems, this delayed cleanup poses problems for other drivers as
> > > well.
> > 
> > Okay, let's try to find out which one it is.  Please use the attached
> > patch - it'll be a little more noisy, reporting which kobjects are
> > being released at the point when they're added to the workqueue.
> The cuplrit seems to be a kobject named "holders" and from what I
> gathered is from kernel/module.c and handling module sysfs entries.
> 
> 
> Partial log below:
> 
> kobject: 'bq24022' (c78a9a80): kobject_release
> [...]
> kobject: 'gpio-vbus' (c78a9cc0): kobject_release
> [...]
> kobject: 'bq24022' (c78a9a80): kobject_cleanup
> kobject: 'gpio-vbus' (c78a9cc0): kobject_cleanup
> [...]
> Found /sbin/init, booting ...
> 
> INIT: version 2.88 booting
> 
> Starting the hotplug events dispatcher: udevdudevd[367]: starting version 172
> .
> Synthesizing the initial hotplug events...done.
> Waiting for /dev to be fully populated...
> [...]
> Cleaning up ifupdown....
> Loading kernel modules...
> kobject: 'holders' (c7addc80): kobject_release
> kobject: 'notes' (c7add080): kobject_release
> done.
> Activating lvm and md swap...done.
> Checking file systems...fsck from util-linux 2.19.1
> done.
> [...]
> kobject: 'holders' (c7addc80): kobject_cleanup
> Unable to handle kernel paging request at virtual address bf055504
> pgd = c0004000
> [bf055504] *pgd=371f9811, *pte=00000000, *ppte=00000000
> Internal error: Oops: 7 [#1]

Please post the entire first oops dump for the above run - it may contain
useful information to properly track this down.

Thanks.

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

* Re: [PATCH 3/7] s3c-hsudc: add a remove function
  2011-12-18 20:39                         ` Russell King - ARM Linux
@ 2011-12-18 20:46                             ` Heiko Stübner
  -1 siblings, 0 replies; 48+ messages in thread
From: Heiko Stübner @ 2011-12-18 20:46 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: Greg KH, Felipe Balbi, Kukjin Kim,
	linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
	linux-usb-u79uwXL29TY76Z2rM5mHXA, Thomas Abraham,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

Am Sonntag 18 Dezember 2011, 21:39:53 schrieb Russell King - ARM Linux:
> On Sun, Dec 18, 2011 at 09:24:12PM +0100, Heiko Stübner wrote:
> > Am Sonntag 18 Dezember 2011, 20:45:18 schrieb Russell King - ARM Linux:
> > > On Sun, Dec 18, 2011 at 08:33:32PM +0100, Heiko Stübner wrote:
> > > > Am Sonntag 18 Dezember 2011, 20:01:02 schrieben Sie:
> > > > > On Sun, Dec 18, 2011 at 07:50:37PM +0100, Heiko Stübner wrote:
> > > > > > I didn't get this far. With your patch the Oopses already happen
> > > > > > during the startup of the system / the loading of the modules.
> > > > > > 
> > > > > > A bit of the message spew I got during testing with linux-
> > 
> > next-20111216:
> > > > > In some way, this is a good thing because it's showing that there's
> > > > > problems with kobject lifetime rules.
> > > > > 
> > > > > The #2 and further oops dumps are a result of corrupting the work
> > > > > queues as a result of #1, so #2 onwards should be ignored.
> > > > > 
> > > > > I suspect if you avoid loading the s3c_hsudc module these will go
> > > > > away.
> > > > 
> > > > nope :-), same faults happen even if s3c-hsudc is not present at all.
> > > > So it seems, this delayed cleanup poses problems for other drivers as
> > > > well.
> > > 
> > > Okay, let's try to find out which one it is.  Please use the attached
> > > patch - it'll be a little more noisy, reporting which kobjects are
> > > being released at the point when they're added to the workqueue.
> > 
> > The cuplrit seems to be a kobject named "holders" and from what I
> > gathered is from kernel/module.c and handling module sysfs entries.
> > 
> > 
> > Partial log below:
> > 
> > kobject: 'bq24022' (c78a9a80): kobject_release
> > [...]
> > kobject: 'gpio-vbus' (c78a9cc0): kobject_release
> > [...]
> > kobject: 'bq24022' (c78a9a80): kobject_cleanup
> > kobject: 'gpio-vbus' (c78a9cc0): kobject_cleanup
> > [...]
> > Found /sbin/init, booting ...
> > 
> > INIT: version 2.88 booting
> > 
> > Starting the hotplug events dispatcher: udevdudevd[367]: starting version
> > 172 .
> > Synthesizing the initial hotplug events...done.
> > Waiting for /dev to be fully populated...
> > [...]
> > Cleaning up ifupdown....
> > Loading kernel modules...
> > kobject: 'holders' (c7addc80): kobject_release
> > kobject: 'notes' (c7add080): kobject_release
> > done.
> > Activating lvm and md swap...done.
> > Checking file systems...fsck from util-linux 2.19.1
> > done.
> > [...]
> > kobject: 'holders' (c7addc80): kobject_cleanup
> > Unable to handle kernel paging request at virtual address bf055504
> > pgd = c0004000
> > [bf055504] *pgd=371f9811, *pte=00000000, *ppte=00000000
> > Internal error: Oops: 7 [#1]
> 
> Please post the entire first oops dump for the above run - it may contain
> useful information to properly track this down.

kobject: 'holders' (c7addc80): kobject_cleanup
Unable to handle kernel paging request at virtual address bf055504
pgd = c0004000
[bf055504] *pgd=371f9811, *pte=00000000, *ppte=00000000
Internal error: Oops: 7 [#1]
Modules linked in: ohci_hcd usbcore leds_s3c24xx i2c_s3c2410 i2c_core
CPU: 0    Not tainted  (3.2.0-rc5-next-20111216+ #33)
PC is at kobject_put+0x18/0x7c
LR is at kobject_del+0x64/0x70
pc : [<c0114624>]    lr : [<c011470c>]    psr: a0000013
sp : c70bdef8  ip : c70bdf18  fp : c70bdf14
r10: 00000000  r9 : c0114718  r8 : c7803a00
r7 : c7abd360  r6 : c02e1de0  r5 : c7addca0  r4 : bf0554a0
r3 : 00000001  r2 : 00000000  r1 : 00000000  r0 : bf0554a0
Flags: NzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
Control: 0005317f  Table: 378ac000  DAC: 00000017
Process kworker/0:1 (pid: 16, stack limit = 0xc70bc270)
Stack: (0xc70bdef8 to 0xc70be000)
dee0:                                                       c7addc80 c7addca0
df00: c02e1de0 c7addc80 c70bdf2c c70bdf18 c011470c c011461c c0114748 c7addc80
df20: c70bdf4c c70bdf30 c01147ec c01146b8 c7addca0 c785fd00 00000000 00000009
df40: c70bdf84 c70bdf50 c00318fc c0114728 c02dbf00 c7803a05 c02dbf00 c785fd00
df60: c02dbf00 c785fd00 00000009 c02dbf00 c785fd10 c70bc000 c70bdfbc c70bdf88
df80: c0032570 c00316c0 c7839edc c785fd10 c0032364 c70bdfcc c7839edc c785fd00
dfa0: c0032364 00000000 00000000 00000000 c70bdff4 c70bdfc0 c0037768 c0032374
dfc0: c7839edc 00000000 c785fd00 00000000 c70bdfd0 c70bdfd0 c7839edc c00376e0
dfe0: c0021ac0 00000013 00000000 c70bdff8 c0021ac0 c00376f0 59595959 59595959
Backtrace: 
[<c011460c>] (kobject_put+0x0/0x7c) from [<c011470c>] (kobject_del+0x64/0x70)
 r4:c7addc80
[<c01146a8>] (kobject_del+0x0/0x70) from [<c01147ec>] (kobject_delayed_cleanup+0xd4/0x174)
 r4:c7addc80
[<c0114718>] (kobject_delayed_cleanup+0x0/0x174) from [<c00318fc>] (process_one_work+0x24c/0x3a8)
 r7:00000009 r6:00000000 r5:c785fd00 r4:c7addca0
[<c00316b0>] (process_one_work+0x0/0x3a8) from [<c0032570>] (worker_thread+0x20c/0x428)
[<c0032364>] (worker_thread+0x0/0x428) from [<c0037768>] (kthread+0x88/0x90)
[<c00376e0>] (kthread+0x0/0x90) from [<c0021ac0>] (do_exit+0x0/0x670)
 r7:00000013 r6:c0021ac0 r5:c00376e0 r4:c7839edc
Code: e24cb004 e24dd00c e2504000 0a000013 (e5d43064) 
---[ end trace 9e78135e0183be43 ]---
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH 3/7] s3c-hsudc: add a remove function
@ 2011-12-18 20:46                             ` Heiko Stübner
  0 siblings, 0 replies; 48+ messages in thread
From: Heiko Stübner @ 2011-12-18 20:46 UTC (permalink / raw)
  To: linux-arm-kernel

Am Sonntag 18 Dezember 2011, 21:39:53 schrieb Russell King - ARM Linux:
> On Sun, Dec 18, 2011 at 09:24:12PM +0100, Heiko St?bner wrote:
> > Am Sonntag 18 Dezember 2011, 20:45:18 schrieb Russell King - ARM Linux:
> > > On Sun, Dec 18, 2011 at 08:33:32PM +0100, Heiko St?bner wrote:
> > > > Am Sonntag 18 Dezember 2011, 20:01:02 schrieben Sie:
> > > > > On Sun, Dec 18, 2011 at 07:50:37PM +0100, Heiko St?bner wrote:
> > > > > > I didn't get this far. With your patch the Oopses already happen
> > > > > > during the startup of the system / the loading of the modules.
> > > > > > 
> > > > > > A bit of the message spew I got during testing with linux-
> > 
> > next-20111216:
> > > > > In some way, this is a good thing because it's showing that there's
> > > > > problems with kobject lifetime rules.
> > > > > 
> > > > > The #2 and further oops dumps are a result of corrupting the work
> > > > > queues as a result of #1, so #2 onwards should be ignored.
> > > > > 
> > > > > I suspect if you avoid loading the s3c_hsudc module these will go
> > > > > away.
> > > > 
> > > > nope :-), same faults happen even if s3c-hsudc is not present at all.
> > > > So it seems, this delayed cleanup poses problems for other drivers as
> > > > well.
> > > 
> > > Okay, let's try to find out which one it is.  Please use the attached
> > > patch - it'll be a little more noisy, reporting which kobjects are
> > > being released at the point when they're added to the workqueue.
> > 
> > The cuplrit seems to be a kobject named "holders" and from what I
> > gathered is from kernel/module.c and handling module sysfs entries.
> > 
> > 
> > Partial log below:
> > 
> > kobject: 'bq24022' (c78a9a80): kobject_release
> > [...]
> > kobject: 'gpio-vbus' (c78a9cc0): kobject_release
> > [...]
> > kobject: 'bq24022' (c78a9a80): kobject_cleanup
> > kobject: 'gpio-vbus' (c78a9cc0): kobject_cleanup
> > [...]
> > Found /sbin/init, booting ...
> > 
> > INIT: version 2.88 booting
> > 
> > Starting the hotplug events dispatcher: udevdudevd[367]: starting version
> > 172 .
> > Synthesizing the initial hotplug events...done.
> > Waiting for /dev to be fully populated...
> > [...]
> > Cleaning up ifupdown....
> > Loading kernel modules...
> > kobject: 'holders' (c7addc80): kobject_release
> > kobject: 'notes' (c7add080): kobject_release
> > done.
> > Activating lvm and md swap...done.
> > Checking file systems...fsck from util-linux 2.19.1
> > done.
> > [...]
> > kobject: 'holders' (c7addc80): kobject_cleanup
> > Unable to handle kernel paging request at virtual address bf055504
> > pgd = c0004000
> > [bf055504] *pgd=371f9811, *pte=00000000, *ppte=00000000
> > Internal error: Oops: 7 [#1]
> 
> Please post the entire first oops dump for the above run - it may contain
> useful information to properly track this down.

kobject: 'holders' (c7addc80): kobject_cleanup
Unable to handle kernel paging request at virtual address bf055504
pgd = c0004000
[bf055504] *pgd=371f9811, *pte=00000000, *ppte=00000000
Internal error: Oops: 7 [#1]
Modules linked in: ohci_hcd usbcore leds_s3c24xx i2c_s3c2410 i2c_core
CPU: 0    Not tainted  (3.2.0-rc5-next-20111216+ #33)
PC is at kobject_put+0x18/0x7c
LR is at kobject_del+0x64/0x70
pc : [<c0114624>]    lr : [<c011470c>]    psr: a0000013
sp : c70bdef8  ip : c70bdf18  fp : c70bdf14
r10: 00000000  r9 : c0114718  r8 : c7803a00
r7 : c7abd360  r6 : c02e1de0  r5 : c7addca0  r4 : bf0554a0
r3 : 00000001  r2 : 00000000  r1 : 00000000  r0 : bf0554a0
Flags: NzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
Control: 0005317f  Table: 378ac000  DAC: 00000017
Process kworker/0:1 (pid: 16, stack limit = 0xc70bc270)
Stack: (0xc70bdef8 to 0xc70be000)
dee0:                                                       c7addc80 c7addca0
df00: c02e1de0 c7addc80 c70bdf2c c70bdf18 c011470c c011461c c0114748 c7addc80
df20: c70bdf4c c70bdf30 c01147ec c01146b8 c7addca0 c785fd00 00000000 00000009
df40: c70bdf84 c70bdf50 c00318fc c0114728 c02dbf00 c7803a05 c02dbf00 c785fd00
df60: c02dbf00 c785fd00 00000009 c02dbf00 c785fd10 c70bc000 c70bdfbc c70bdf88
df80: c0032570 c00316c0 c7839edc c785fd10 c0032364 c70bdfcc c7839edc c785fd00
dfa0: c0032364 00000000 00000000 00000000 c70bdff4 c70bdfc0 c0037768 c0032374
dfc0: c7839edc 00000000 c785fd00 00000000 c70bdfd0 c70bdfd0 c7839edc c00376e0
dfe0: c0021ac0 00000013 00000000 c70bdff8 c0021ac0 c00376f0 59595959 59595959
Backtrace: 
[<c011460c>] (kobject_put+0x0/0x7c) from [<c011470c>] (kobject_del+0x64/0x70)
 r4:c7addc80
[<c01146a8>] (kobject_del+0x0/0x70) from [<c01147ec>] (kobject_delayed_cleanup+0xd4/0x174)
 r4:c7addc80
[<c0114718>] (kobject_delayed_cleanup+0x0/0x174) from [<c00318fc>] (process_one_work+0x24c/0x3a8)
 r7:00000009 r6:00000000 r5:c785fd00 r4:c7addca0
[<c00316b0>] (process_one_work+0x0/0x3a8) from [<c0032570>] (worker_thread+0x20c/0x428)
[<c0032364>] (worker_thread+0x0/0x428) from [<c0037768>] (kthread+0x88/0x90)
[<c00376e0>] (kthread+0x0/0x90) from [<c0021ac0>] (do_exit+0x0/0x670)
 r7:00000013 r6:c0021ac0 r5:c00376e0 r4:c7839edc
Code: e24cb004 e24dd00c e2504000 0a000013 (e5d43064) 
---[ end trace 9e78135e0183be43 ]---

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

* Re: [PATCH 3/7] s3c-hsudc: add a remove function
  2011-12-18 20:46                             ` Heiko Stübner
@ 2011-12-18 21:37                               ` Russell King - ARM Linux
  -1 siblings, 0 replies; 48+ messages in thread
From: Russell King - ARM Linux @ 2011-12-18 21:37 UTC (permalink / raw)
  To: Heiko Stübner
  Cc: Greg KH, Felipe Balbi, Kukjin Kim, linux-samsung-soc, linux-usb,
	Thomas Abraham, linux-arm-kernel

On Sun, Dec 18, 2011 at 09:46:08PM +0100, Heiko Stübner wrote:
> > > kobject: 'holders' (c7addc80): kobject_cleanup
> > > Unable to handle kernel paging request at virtual address bf055504
> > > pgd = c0004000
> > > [bf055504] *pgd=371f9811, *pte=00000000, *ppte=00000000
> > > Internal error: Oops: 7 [#1]
> > 
> > Please post the entire first oops dump for the above run - it may contain
> > useful information to properly track this down.
> 
> kobject: 'holders' (c7addc80): kobject_cleanup
> Unable to handle kernel paging request at virtual address bf055504
> pgd = c0004000
> [bf055504] *pgd=371f9811, *pte=00000000, *ppte=00000000
> Internal error: Oops: 7 [#1]
> Modules linked in: ohci_hcd usbcore leds_s3c24xx i2c_s3c2410 i2c_core
> CPU: 0    Not tainted  (3.2.0-rc5-next-20111216+ #33)
> PC is at kobject_put+0x18/0x7c
> LR is at kobject_del+0x64/0x70
> pc : [<c0114624>]    lr : [<c011470c>]    psr: a0000013
> sp : c70bdef8  ip : c70bdf18  fp : c70bdf14
> r10: 00000000  r9 : c0114718  r8 : c7803a00
> r7 : c7abd360  r6 : c02e1de0  r5 : c7addca0  r4 : bf0554a0
> r3 : 00000001  r2 : 00000000  r1 : 00000000  r0 : bf0554a0
> Backtrace: 
> [<c011460c>] (kobject_put+0x0/0x7c) from [<c011470c>] (kobject_del+0x64/0x70)
>  r4:c7addc80
> [<c01146a8>] (kobject_del+0x0/0x70) from [<c01147ec>] (kobject_delayed_cleanup+0xd4/0x174)
>  r4:c7addc80
> [<c0114718>] (kobject_delayed_cleanup+0x0/0x174) from [<c00318fc>] (process_one_work+0x24c/0x3a8)

Right, here's what I think is happening.

You're right that 0xc7addc80 is being cleaned up.  So, we enter
kobject_cleanup() with kobj = 0xc7addc80.  We get to this:

        /* remove from sysfs if the caller did not do it */
        if (kobj->state_in_sysfs) {
                pr_debug("kobject: '%s' (%p): auto cleanup kobject_del\n",
                         kobject_name(kobj), kobj);
                kobject_del(kobj);
        }

So, we call kobject_del() on c7addc80 (which we can see in r4 in the
backtrace):

void kobject_del(struct kobject *kobj)
{
        if (!kobj)
                return;

        sysfs_remove_dir(kobj);
        kobj->state_in_sysfs = 0;
        kobj_kset_leave(kobj);
        kobject_put(kobj->parent);

And so we get to kobject_put(), and we call that with a pointer of
0xbf0554a0.  This is a pointer into struct module.  And this is where
the problem lies...

The struct module is free'd as part of the core of the module
(mod->module_core) here:

static void module_deallocate(struct module *mod, struct load_info *info)
{
        kfree(info->strmap);
        percpu_modfree(mod);
        module_free(mod, mod->module_init);
        module_free(mod, mod->module_core);
}

A struct module contains:

struct module
{
	...
        /* Sysfs stuff. */
        struct module_kobject mkobj;

which in turn is defined as:

struct module_kobject {
        struct kobject kobj;
	...
}

So, we have a struct kobject contained within a data structure which is
independently allocated and freed - and this is highly illegal.  I'm
sure GregKH will want to discuss this with Rusty...

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

* [PATCH 3/7] s3c-hsudc: add a remove function
@ 2011-12-18 21:37                               ` Russell King - ARM Linux
  0 siblings, 0 replies; 48+ messages in thread
From: Russell King - ARM Linux @ 2011-12-18 21:37 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, Dec 18, 2011 at 09:46:08PM +0100, Heiko St?bner wrote:
> > > kobject: 'holders' (c7addc80): kobject_cleanup
> > > Unable to handle kernel paging request at virtual address bf055504
> > > pgd = c0004000
> > > [bf055504] *pgd=371f9811, *pte=00000000, *ppte=00000000
> > > Internal error: Oops: 7 [#1]
> > 
> > Please post the entire first oops dump for the above run - it may contain
> > useful information to properly track this down.
> 
> kobject: 'holders' (c7addc80): kobject_cleanup
> Unable to handle kernel paging request at virtual address bf055504
> pgd = c0004000
> [bf055504] *pgd=371f9811, *pte=00000000, *ppte=00000000
> Internal error: Oops: 7 [#1]
> Modules linked in: ohci_hcd usbcore leds_s3c24xx i2c_s3c2410 i2c_core
> CPU: 0    Not tainted  (3.2.0-rc5-next-20111216+ #33)
> PC is at kobject_put+0x18/0x7c
> LR is at kobject_del+0x64/0x70
> pc : [<c0114624>]    lr : [<c011470c>]    psr: a0000013
> sp : c70bdef8  ip : c70bdf18  fp : c70bdf14
> r10: 00000000  r9 : c0114718  r8 : c7803a00
> r7 : c7abd360  r6 : c02e1de0  r5 : c7addca0  r4 : bf0554a0
> r3 : 00000001  r2 : 00000000  r1 : 00000000  r0 : bf0554a0
> Backtrace: 
> [<c011460c>] (kobject_put+0x0/0x7c) from [<c011470c>] (kobject_del+0x64/0x70)
>  r4:c7addc80
> [<c01146a8>] (kobject_del+0x0/0x70) from [<c01147ec>] (kobject_delayed_cleanup+0xd4/0x174)
>  r4:c7addc80
> [<c0114718>] (kobject_delayed_cleanup+0x0/0x174) from [<c00318fc>] (process_one_work+0x24c/0x3a8)

Right, here's what I think is happening.

You're right that 0xc7addc80 is being cleaned up.  So, we enter
kobject_cleanup() with kobj = 0xc7addc80.  We get to this:

        /* remove from sysfs if the caller did not do it */
        if (kobj->state_in_sysfs) {
                pr_debug("kobject: '%s' (%p): auto cleanup kobject_del\n",
                         kobject_name(kobj), kobj);
                kobject_del(kobj);
        }

So, we call kobject_del() on c7addc80 (which we can see in r4 in the
backtrace):

void kobject_del(struct kobject *kobj)
{
        if (!kobj)
                return;

        sysfs_remove_dir(kobj);
        kobj->state_in_sysfs = 0;
        kobj_kset_leave(kobj);
        kobject_put(kobj->parent);

And so we get to kobject_put(), and we call that with a pointer of
0xbf0554a0.  This is a pointer into struct module.  And this is where
the problem lies...

The struct module is free'd as part of the core of the module
(mod->module_core) here:

static void module_deallocate(struct module *mod, struct load_info *info)
{
        kfree(info->strmap);
        percpu_modfree(mod);
        module_free(mod, mod->module_init);
        module_free(mod, mod->module_core);
}

A struct module contains:

struct module
{
	...
        /* Sysfs stuff. */
        struct module_kobject mkobj;

which in turn is defined as:

struct module_kobject {
        struct kobject kobj;
	...
}

So, we have a struct kobject contained within a data structure which is
independently allocated and freed - and this is highly illegal.  I'm
sure GregKH will want to discuss this with Rusty...

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

* Re: [PATCH 3/7] s3c-hsudc: add a remove function
  2011-12-18 18:50           ` Heiko Stübner
@ 2011-12-20  6:07             ` Greg KH
  -1 siblings, 0 replies; 48+ messages in thread
From: Greg KH @ 2011-12-20  6:07 UTC (permalink / raw)
  To: Heiko Stübner
  Cc: Russell King - ARM Linux, Felipe Balbi, Kukjin Kim,
	linux-samsung-soc, linux-usb, Thomas Abraham, linux-arm-kernel

On Sun, Dec 18, 2011 at 07:50:37PM +0100, Heiko Stübner wrote:
> Am Sonntag 18 Dezember 2011, 15:43:19 schrieb Russell King - ARM Linux:
> > On Sun, Dec 18, 2011 at 02:44:39PM +0100, Heiko Stübner wrote:
> > > Am Sonntag 18 Dezember 2011, 09:10:48 schrieb Russell King - ARM Linux:
> > > > On Sat, Dec 17, 2011 at 08:26:33PM +0100, Heiko Stübner wrote:
> > > > > As the driver is also buildable as a module it should need
> > > > > a cleanup function for the removal of the module.
> > > > 
> > > > My guess is that this wasn't implemented because of the embedded struct
> > > > device lifetime rules for the gadget - to prevent the unbinding of the
> > > > driver.
> > > > 
> > > > Until the struct device lifetime gets fixed, you must not allow the
> > > > module nor the data structure containing the struct device to be
> > > > freed.
> > > 
> > > I understand where this problem comes from (the release method is
> > > potentially gone with the module before it is called) but after more
> > > reading, I have a hard time believing that a lot of the other gadget
> > > drivers would be wrong as well. Some of them since 2009 or possibly
> > > earlier.
> > > 
> > > Gadgets with embedded release methods: langwell_udc, goku_udc, fsl_qe_udc
> > > (and fsl_udc_core), amd5536udc, net2280, pch_udc, cil13xxx_udc,
> > > dummy_hcd, omap_udc, net2272, mc_udc_core
> > > 
> > > Gadgets which use the release method from its pdev->dev but also free the
> > > struct with the gadget in their remove method: r8a66597-udc, m66592-udc,
> > > fusb300_udc. (possibly before the release function is called)
> > > 
> > > On the other hand, the gets and puts of the udc->gadget.dev should be
> > > paired correctly and it's only an intermediate device between the udc
> > > and the gadget driver, so that the call to device_unregister in the
> > > remove method should put the refcount to 0 and thus init the cleanup
> > > (including the call to release) before the module is removed.
> > > 
> > > So, I am very confused :-).
> > 
> > Try this patch.  If your system oopses 5 seconds after you remove the
> > module, you have a lifetime bug.
> I didn't get this far. With your patch the Oopses already happen during the startup of
> the system / the loading of the modules.
> 
> A bit of the message spew I got during testing with linux-next-20111216:
> 
> pgd = c0004000
> [bf05b504] *pgd=379af811, *pte=00000000, *ppte=00000000
> Internal error: Oops: 7 [#1]
> Modules linked in: ohci_hcd leds_s3c24xx usbcore i2c_s3c2410 i2c_core s3c_hsudc
> CPU: 0    Not tainted  (3.2.0-rc5-next-20111216+ #32)
> PC is at kobject_put+0x18/0x7c

You cut out the wording right before this.

And because of that, I get to publicly mock you for going directly
against how kobjects are supposed to work (see the documentation for
why.)

Go read the documentation, and don't try to "outsmart" the kernel, do
you really think I put that warning in there just for the fun of it?

greg k-h

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

* [PATCH 3/7] s3c-hsudc: add a remove function
@ 2011-12-20  6:07             ` Greg KH
  0 siblings, 0 replies; 48+ messages in thread
From: Greg KH @ 2011-12-20  6:07 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, Dec 18, 2011 at 07:50:37PM +0100, Heiko St?bner wrote:
> Am Sonntag 18 Dezember 2011, 15:43:19 schrieb Russell King - ARM Linux:
> > On Sun, Dec 18, 2011 at 02:44:39PM +0100, Heiko St?bner wrote:
> > > Am Sonntag 18 Dezember 2011, 09:10:48 schrieb Russell King - ARM Linux:
> > > > On Sat, Dec 17, 2011 at 08:26:33PM +0100, Heiko St?bner wrote:
> > > > > As the driver is also buildable as a module it should need
> > > > > a cleanup function for the removal of the module.
> > > > 
> > > > My guess is that this wasn't implemented because of the embedded struct
> > > > device lifetime rules for the gadget - to prevent the unbinding of the
> > > > driver.
> > > > 
> > > > Until the struct device lifetime gets fixed, you must not allow the
> > > > module nor the data structure containing the struct device to be
> > > > freed.
> > > 
> > > I understand where this problem comes from (the release method is
> > > potentially gone with the module before it is called) but after more
> > > reading, I have a hard time believing that a lot of the other gadget
> > > drivers would be wrong as well. Some of them since 2009 or possibly
> > > earlier.
> > > 
> > > Gadgets with embedded release methods: langwell_udc, goku_udc, fsl_qe_udc
> > > (and fsl_udc_core), amd5536udc, net2280, pch_udc, cil13xxx_udc,
> > > dummy_hcd, omap_udc, net2272, mc_udc_core
> > > 
> > > Gadgets which use the release method from its pdev->dev but also free the
> > > struct with the gadget in their remove method: r8a66597-udc, m66592-udc,
> > > fusb300_udc. (possibly before the release function is called)
> > > 
> > > On the other hand, the gets and puts of the udc->gadget.dev should be
> > > paired correctly and it's only an intermediate device between the udc
> > > and the gadget driver, so that the call to device_unregister in the
> > > remove method should put the refcount to 0 and thus init the cleanup
> > > (including the call to release) before the module is removed.
> > > 
> > > So, I am very confused :-).
> > 
> > Try this patch.  If your system oopses 5 seconds after you remove the
> > module, you have a lifetime bug.
> I didn't get this far. With your patch the Oopses already happen during the startup of
> the system / the loading of the modules.
> 
> A bit of the message spew I got during testing with linux-next-20111216:
> 
> pgd = c0004000
> [bf05b504] *pgd=379af811, *pte=00000000, *ppte=00000000
> Internal error: Oops: 7 [#1]
> Modules linked in: ohci_hcd leds_s3c24xx usbcore i2c_s3c2410 i2c_core s3c_hsudc
> CPU: 0    Not tainted  (3.2.0-rc5-next-20111216+ #32)
> PC is at kobject_put+0x18/0x7c

You cut out the wording right before this.

And because of that, I get to publicly mock you for going directly
against how kobjects are supposed to work (see the documentation for
why.)

Go read the documentation, and don't try to "outsmart" the kernel, do
you really think I put that warning in there just for the fun of it?

greg k-h

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

* Re: [PATCH 3/7] s3c-hsudc: add a remove function
  2011-12-18 21:37                               ` Russell King - ARM Linux
@ 2011-12-20  6:08                                   ` Greg KH
  -1 siblings, 0 replies; 48+ messages in thread
From: Greg KH @ 2011-12-20  6:08 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: Heiko Stübner, Felipe Balbi, Kukjin Kim,
	linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
	linux-usb-u79uwXL29TY76Z2rM5mHXA, Thomas Abraham,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Sun, Dec 18, 2011 at 09:37:04PM +0000, Russell King - ARM Linux wrote:
> On Sun, Dec 18, 2011 at 09:46:08PM +0100, Heiko Stübner wrote:
> > > > kobject: 'holders' (c7addc80): kobject_cleanup
> > > > Unable to handle kernel paging request at virtual address bf055504
> > > > pgd = c0004000
> > > > [bf055504] *pgd=371f9811, *pte=00000000, *ppte=00000000
> > > > Internal error: Oops: 7 [#1]
> > > 
> > > Please post the entire first oops dump for the above run - it may contain
> > > useful information to properly track this down.
> > 
> > kobject: 'holders' (c7addc80): kobject_cleanup
> > Unable to handle kernel paging request at virtual address bf055504
> > pgd = c0004000
> > [bf055504] *pgd=371f9811, *pte=00000000, *ppte=00000000
> > Internal error: Oops: 7 [#1]
> > Modules linked in: ohci_hcd usbcore leds_s3c24xx i2c_s3c2410 i2c_core
> > CPU: 0    Not tainted  (3.2.0-rc5-next-20111216+ #33)
> > PC is at kobject_put+0x18/0x7c
> > LR is at kobject_del+0x64/0x70
> > pc : [<c0114624>]    lr : [<c011470c>]    psr: a0000013
> > sp : c70bdef8  ip : c70bdf18  fp : c70bdf14
> > r10: 00000000  r9 : c0114718  r8 : c7803a00
> > r7 : c7abd360  r6 : c02e1de0  r5 : c7addca0  r4 : bf0554a0
> > r3 : 00000001  r2 : 00000000  r1 : 00000000  r0 : bf0554a0
> > Backtrace: 
> > [<c011460c>] (kobject_put+0x0/0x7c) from [<c011470c>] (kobject_del+0x64/0x70)
> >  r4:c7addc80
> > [<c01146a8>] (kobject_del+0x0/0x70) from [<c01147ec>] (kobject_delayed_cleanup+0xd4/0x174)
> >  r4:c7addc80
> > [<c0114718>] (kobject_delayed_cleanup+0x0/0x174) from [<c00318fc>] (process_one_work+0x24c/0x3a8)
> 
> Right, here's what I think is happening.
> 
> You're right that 0xc7addc80 is being cleaned up.  So, we enter
> kobject_cleanup() with kobj = 0xc7addc80.  We get to this:
> 
>         /* remove from sysfs if the caller did not do it */
>         if (kobj->state_in_sysfs) {
>                 pr_debug("kobject: '%s' (%p): auto cleanup kobject_del\n",
>                          kobject_name(kobj), kobj);
>                 kobject_del(kobj);
>         }
> 
> So, we call kobject_del() on c7addc80 (which we can see in r4 in the
> backtrace):
> 
> void kobject_del(struct kobject *kobj)
> {
>         if (!kobj)
>                 return;
> 
>         sysfs_remove_dir(kobj);
>         kobj->state_in_sysfs = 0;
>         kobj_kset_leave(kobj);
>         kobject_put(kobj->parent);
> 
> And so we get to kobject_put(), and we call that with a pointer of
> 0xbf0554a0.  This is a pointer into struct module.  And this is where
> the problem lies...
> 
> The struct module is free'd as part of the core of the module
> (mod->module_core) here:
> 
> static void module_deallocate(struct module *mod, struct load_info *info)
> {
>         kfree(info->strmap);
>         percpu_modfree(mod);
>         module_free(mod, mod->module_init);
>         module_free(mod, mod->module_core);
> }
> 
> A struct module contains:
> 
> struct module
> {
> 	...
>         /* Sysfs stuff. */
>         struct module_kobject mkobj;
> 
> which in turn is defined as:
> 
> struct module_kobject {
>         struct kobject kobj;
> 	...
> }
> 
> So, we have a struct kobject contained within a data structure which is
> independently allocated and freed - and this is highly illegal.  I'm
> sure GregKH will want to discuss this with Rusty...

Ugh, that sucks, yes I'll work on this when I get back from vacation the
first week in January.

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

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

* [PATCH 3/7] s3c-hsudc: add a remove function
@ 2011-12-20  6:08                                   ` Greg KH
  0 siblings, 0 replies; 48+ messages in thread
From: Greg KH @ 2011-12-20  6:08 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, Dec 18, 2011 at 09:37:04PM +0000, Russell King - ARM Linux wrote:
> On Sun, Dec 18, 2011 at 09:46:08PM +0100, Heiko St?bner wrote:
> > > > kobject: 'holders' (c7addc80): kobject_cleanup
> > > > Unable to handle kernel paging request at virtual address bf055504
> > > > pgd = c0004000
> > > > [bf055504] *pgd=371f9811, *pte=00000000, *ppte=00000000
> > > > Internal error: Oops: 7 [#1]
> > > 
> > > Please post the entire first oops dump for the above run - it may contain
> > > useful information to properly track this down.
> > 
> > kobject: 'holders' (c7addc80): kobject_cleanup
> > Unable to handle kernel paging request at virtual address bf055504
> > pgd = c0004000
> > [bf055504] *pgd=371f9811, *pte=00000000, *ppte=00000000
> > Internal error: Oops: 7 [#1]
> > Modules linked in: ohci_hcd usbcore leds_s3c24xx i2c_s3c2410 i2c_core
> > CPU: 0    Not tainted  (3.2.0-rc5-next-20111216+ #33)
> > PC is at kobject_put+0x18/0x7c
> > LR is at kobject_del+0x64/0x70
> > pc : [<c0114624>]    lr : [<c011470c>]    psr: a0000013
> > sp : c70bdef8  ip : c70bdf18  fp : c70bdf14
> > r10: 00000000  r9 : c0114718  r8 : c7803a00
> > r7 : c7abd360  r6 : c02e1de0  r5 : c7addca0  r4 : bf0554a0
> > r3 : 00000001  r2 : 00000000  r1 : 00000000  r0 : bf0554a0
> > Backtrace: 
> > [<c011460c>] (kobject_put+0x0/0x7c) from [<c011470c>] (kobject_del+0x64/0x70)
> >  r4:c7addc80
> > [<c01146a8>] (kobject_del+0x0/0x70) from [<c01147ec>] (kobject_delayed_cleanup+0xd4/0x174)
> >  r4:c7addc80
> > [<c0114718>] (kobject_delayed_cleanup+0x0/0x174) from [<c00318fc>] (process_one_work+0x24c/0x3a8)
> 
> Right, here's what I think is happening.
> 
> You're right that 0xc7addc80 is being cleaned up.  So, we enter
> kobject_cleanup() with kobj = 0xc7addc80.  We get to this:
> 
>         /* remove from sysfs if the caller did not do it */
>         if (kobj->state_in_sysfs) {
>                 pr_debug("kobject: '%s' (%p): auto cleanup kobject_del\n",
>                          kobject_name(kobj), kobj);
>                 kobject_del(kobj);
>         }
> 
> So, we call kobject_del() on c7addc80 (which we can see in r4 in the
> backtrace):
> 
> void kobject_del(struct kobject *kobj)
> {
>         if (!kobj)
>                 return;
> 
>         sysfs_remove_dir(kobj);
>         kobj->state_in_sysfs = 0;
>         kobj_kset_leave(kobj);
>         kobject_put(kobj->parent);
> 
> And so we get to kobject_put(), and we call that with a pointer of
> 0xbf0554a0.  This is a pointer into struct module.  And this is where
> the problem lies...
> 
> The struct module is free'd as part of the core of the module
> (mod->module_core) here:
> 
> static void module_deallocate(struct module *mod, struct load_info *info)
> {
>         kfree(info->strmap);
>         percpu_modfree(mod);
>         module_free(mod, mod->module_init);
>         module_free(mod, mod->module_core);
> }
> 
> A struct module contains:
> 
> struct module
> {
> 	...
>         /* Sysfs stuff. */
>         struct module_kobject mkobj;
> 
> which in turn is defined as:
> 
> struct module_kobject {
>         struct kobject kobj;
> 	...
> }
> 
> So, we have a struct kobject contained within a data structure which is
> independently allocated and freed - and this is highly illegal.  I'm
> sure GregKH will want to discuss this with Rusty...

Ugh, that sucks, yes I'll work on this when I get back from vacation the
first week in January.

greg k-h

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

end of thread, other threads:[~2011-12-20  6:08 UTC | newest]

Thread overview: 48+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-17 19:23 [PATCH v2 0/7] s3c-hsudc: regulator handling and a lot of fixes Heiko Stübner
2011-12-17 19:23 ` Heiko Stübner
2011-12-17 19:24 ` [PATCH 1/7] s3c-hsudc: move platform_data struct to global header Heiko Stübner
2011-12-17 19:24   ` Heiko Stübner
2011-12-17 19:25 ` [PATCH 2/7] s3c-hsudc: add __devinit to probe function Heiko Stübner
2011-12-17 19:25   ` Heiko Stübner
2011-12-17 19:26 ` [PATCH 3/7] s3c-hsudc: add a remove function Heiko Stübner
2011-12-17 19:26   ` Heiko Stübner
2011-12-18  8:03   ` Russell King - ARM Linux
2011-12-18  8:03     ` Russell King - ARM Linux
2011-12-18  8:10   ` Russell King - ARM Linux
2011-12-18  8:10     ` Russell King - ARM Linux
2011-12-18  9:42     ` Heiko Stübner
2011-12-18  9:42       ` Heiko Stübner
2011-12-18 13:44     ` Heiko Stübner
2011-12-18 13:44       ` Heiko Stübner
2011-12-18 14:43       ` Russell King - ARM Linux
2011-12-18 14:43         ` Russell King - ARM Linux
2011-12-18 18:50         ` Heiko Stübner
2011-12-18 18:50           ` Heiko Stübner
     [not found]           ` <201112181950.38993.heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>
2011-12-18 19:01             ` Russell King - ARM Linux
2011-12-18 19:01               ` Russell King - ARM Linux
2011-12-18 19:33               ` Heiko Stübner
2011-12-18 19:33                 ` Heiko Stübner
2011-12-18 19:45                 ` Russell King - ARM Linux
2011-12-18 19:45                   ` Russell King - ARM Linux
2011-12-18 20:24                   ` Heiko Stübner
2011-12-18 20:24                     ` Heiko Stübner
     [not found]                     ` <201112182124.13313.heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>
2011-12-18 20:39                       ` Russell King - ARM Linux
2011-12-18 20:39                         ` Russell King - ARM Linux
     [not found]                         ` <20111218203953.GY14542-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2011-12-18 20:46                           ` Heiko Stübner
2011-12-18 20:46                             ` Heiko Stübner
2011-12-18 21:37                             ` Russell King - ARM Linux
2011-12-18 21:37                               ` Russell King - ARM Linux
     [not found]                               ` <20111218213704.GZ14542-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2011-12-20  6:08                                 ` Greg KH
2011-12-20  6:08                                   ` Greg KH
2011-12-20  6:07           ` Greg KH
2011-12-20  6:07             ` Greg KH
2011-12-17 19:27 ` [PATCH 4/7] s3c-hsudc: add missing otg_put_transceiver in probe Heiko Stübner
2011-12-17 19:27   ` Heiko Stübner
2011-12-17 19:28 ` [PATCH 5/7] s3c-hsudc: move device registration to probe and remove Heiko Stübner
2011-12-17 19:28   ` Heiko Stübner
2011-12-18  8:09   ` Russell King - ARM Linux
2011-12-18  8:09     ` Russell King - ARM Linux
     [not found] ` <201112172023.05519.heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>
2011-12-17 19:29   ` [PATCH 6/7] s3c-hsudc: use udc_start and udc_stop functions Heiko Stübner
2011-12-17 19:29     ` Heiko Stübner
2011-12-17 19:30 ` [PATCH 7/7] s3c-hsudc: Add regulator handling Heiko Stübner
2011-12-17 19:30   ` Heiko Stübner

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.