aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorPatrik Sevallius <patrik.sevallius@enea.com>2007-11-20 12:32:00 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2008-02-01 17:34:52 -0500
commiteb0be47dbbdca133b1b94adc564297f25176b3ab (patch)
tree29b36900829961e7117706a43e4217fef64edee5 /drivers/usb
parent7b62cc86689e721f0aae87e88cb04ca841cf6c38 (diff)
USB: usb peripheral controller driver oops avoidance
I'm having problem with oopses when rebooting, if I modprobe g_serial and rmmod g_serial and do a reboot I get an oops in device_shutdown(). The reason seems to be that usb_gadget_unregister_driver() doesn't do enough cleanup. With this at91_udc patch I don't get the oops. Signed-off-by: Patrik Sevallius <patrik.sevallius@enea.com> [ Same bug was in other peripheral controller drivers; fixed ] Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/gadget/amd5536udc.c1
-rw-r--r--drivers/usb/gadget/at91_udc.c2
-rw-r--r--drivers/usb/gadget/goku_udc.c1
-rw-r--r--drivers/usb/gadget/lh7a40x_udc.c1
-rw-r--r--drivers/usb/gadget/m66592-udc.c1
-rw-r--r--drivers/usb/gadget/pxa2xx_udc.c1
6 files changed, 7 insertions, 0 deletions
diff --git a/drivers/usb/gadget/amd5536udc.c b/drivers/usb/gadget/amd5536udc.c
index 66e10da8a490..b663f23f2642 100644
--- a/drivers/usb/gadget/amd5536udc.c
+++ b/drivers/usb/gadget/amd5536udc.c
@@ -2038,6 +2038,7 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
2038 spin_unlock_irqrestore(&dev->lock, flags); 2038 spin_unlock_irqrestore(&dev->lock, flags);
2039 2039
2040 driver->unbind(&dev->gadget); 2040 driver->unbind(&dev->gadget);
2041 dev->gadget.dev.driver = NULL;
2041 dev->driver = NULL; 2042 dev->driver = NULL;
2042 2043
2043 /* set SD */ 2044 /* set SD */
diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c
index cd62b029d176..4b6ed353ae36 100644
--- a/drivers/usb/gadget/at91_udc.c
+++ b/drivers/usb/gadget/at91_udc.c
@@ -1616,6 +1616,8 @@ int usb_gadget_unregister_driver (struct usb_gadget_driver *driver)
1616 local_irq_enable(); 1616 local_irq_enable();
1617 1617
1618 driver->unbind(&udc->gadget); 1618 driver->unbind(&udc->gadget);
1619 udc->gadget.dev.driver = NULL;
1620 udc->gadget.dev.driver_data = NULL;
1619 udc->driver = NULL; 1621 udc->driver = NULL;
1620 1622
1621 DBG("unbound from %s\n", driver->driver.name); 1623 DBG("unbound from %s\n", driver->driver.name);
diff --git a/drivers/usb/gadget/goku_udc.c b/drivers/usb/gadget/goku_udc.c
index 2ec9d196a8cf..d3e702576de6 100644
--- a/drivers/usb/gadget/goku_udc.c
+++ b/drivers/usb/gadget/goku_udc.c
@@ -1422,6 +1422,7 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
1422 spin_unlock_irqrestore(&dev->lock, flags); 1422 spin_unlock_irqrestore(&dev->lock, flags);
1423 1423
1424 driver->unbind(&dev->gadget); 1424 driver->unbind(&dev->gadget);
1425 dev->gadget.dev.driver = NULL;
1425 1426
1426 DBG(dev, "unregistered driver '%s'\n", driver->driver.name); 1427 DBG(dev, "unregistered driver '%s'\n", driver->driver.name);
1427 return 0; 1428 return 0;
diff --git a/drivers/usb/gadget/lh7a40x_udc.c b/drivers/usb/gadget/lh7a40x_udc.c
index 367b75c0b25b..37243ef7104e 100644
--- a/drivers/usb/gadget/lh7a40x_udc.c
+++ b/drivers/usb/gadget/lh7a40x_udc.c
@@ -474,6 +474,7 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
474 spin_unlock_irqrestore(&dev->lock, flags); 474 spin_unlock_irqrestore(&dev->lock, flags);
475 475
476 driver->unbind(&dev->gadget); 476 driver->unbind(&dev->gadget);
477 dev->gadget.dev.driver = NULL;
477 device_del(&dev->gadget.dev); 478 device_del(&dev->gadget.dev);
478 479
479 udc_disable(dev); 480 udc_disable(dev);
diff --git a/drivers/usb/gadget/m66592-udc.c b/drivers/usb/gadget/m66592-udc.c
index 43f02189dc44..835948f0715a 100644
--- a/drivers/usb/gadget/m66592-udc.c
+++ b/drivers/usb/gadget/m66592-udc.c
@@ -1508,6 +1508,7 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
1508 m66592_bclr(m66592, M66592_VBSE | M66592_URST, M66592_INTENB0); 1508 m66592_bclr(m66592, M66592_VBSE | M66592_URST, M66592_INTENB0);
1509 1509
1510 driver->unbind(&m66592->gadget); 1510 driver->unbind(&m66592->gadget);
1511 m66592->gadget.dev.driver = NULL;
1511 1512
1512 init_controller(m66592); 1513 init_controller(m66592);
1513 disable_controller(m66592); 1514 disable_controller(m66592);
diff --git a/drivers/usb/gadget/pxa2xx_udc.c b/drivers/usb/gadget/pxa2xx_udc.c
index 8c139d416ac4..4abf9d26d615 100644
--- a/drivers/usb/gadget/pxa2xx_udc.c
+++ b/drivers/usb/gadget/pxa2xx_udc.c
@@ -1345,6 +1345,7 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
1345 local_irq_enable(); 1345 local_irq_enable();
1346 1346
1347 driver->unbind(&dev->gadget); 1347 driver->unbind(&dev->gadget);
1348 dev->gadget.dev.driver = NULL;
1348 dev->driver = NULL; 1349 dev->driver = NULL;
1349 1350
1350 device_del (&dev->gadget.dev); 1351 device_del (&dev->gadget.dev);