Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=eb0be47dbbdca133b1b94adc564297f25176b3ab
Commit:     eb0be47dbbdca133b1b94adc564297f25176b3ab
Parent:     7b62cc86689e721f0aae87e88cb04ca841cf6c38
Author:     Patrik Sevallius <[EMAIL PROTECTED]>
AuthorDate: Tue Nov 20 09:32:00 2007 -0800
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Fri Feb 1 14:34:52 2008 -0800

    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 <[EMAIL PROTECTED]>
    [ Same bug was in other peripheral controller drivers; fixed ]
    Signed-off-by: David Brownell <[EMAIL PROTECTED]>
    Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/gadget/amd5536udc.c  |    1 +
 drivers/usb/gadget/at91_udc.c    |    2 ++
 drivers/usb/gadget/goku_udc.c    |    1 +
 drivers/usb/gadget/lh7a40x_udc.c |    1 +
 drivers/usb/gadget/m66592-udc.c  |    1 +
 drivers/usb/gadget/pxa2xx_udc.c  |    1 +
 6 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/gadget/amd5536udc.c b/drivers/usb/gadget/amd5536udc.c
index 66e10da..b663f23 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)
        spin_unlock_irqrestore(&dev->lock, flags);
 
        driver->unbind(&dev->gadget);
+       dev->gadget.dev.driver = NULL;
        dev->driver = NULL;
 
        /* set SD */
diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c
index cd62b02..4b6ed35 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)
        local_irq_enable();
 
        driver->unbind(&udc->gadget);
+       udc->gadget.dev.driver = NULL;
+       udc->gadget.dev.driver_data = NULL;
        udc->driver = NULL;
 
        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 2ec9d19..d3e7025 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)
        spin_unlock_irqrestore(&dev->lock, flags);
 
        driver->unbind(&dev->gadget);
+       dev->gadget.dev.driver = NULL;
 
        DBG(dev, "unregistered driver '%s'\n", driver->driver.name);
        return 0;
diff --git a/drivers/usb/gadget/lh7a40x_udc.c b/drivers/usb/gadget/lh7a40x_udc.c
index 367b75c..37243ef 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)
        spin_unlock_irqrestore(&dev->lock, flags);
 
        driver->unbind(&dev->gadget);
+       dev->gadget.dev.driver = NULL;
        device_del(&dev->gadget.dev);
 
        udc_disable(dev);
diff --git a/drivers/usb/gadget/m66592-udc.c b/drivers/usb/gadget/m66592-udc.c
index 43f0218..835948f 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)
        m66592_bclr(m66592, M66592_VBSE | M66592_URST, M66592_INTENB0);
 
        driver->unbind(&m66592->gadget);
+       m66592->gadget.dev.driver = NULL;
 
        init_controller(m66592);
        disable_controller(m66592);
diff --git a/drivers/usb/gadget/pxa2xx_udc.c b/drivers/usb/gadget/pxa2xx_udc.c
index 8c139d4..4abf9d2 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)
        local_irq_enable();
 
        driver->unbind(&dev->gadget);
+       dev->gadget.dev.driver = NULL;
        dev->driver = NULL;
 
        device_del (&dev->gadget.dev);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to