From ac3f2360e41ad5d2a3da2e272709b4fe76e2e417 Mon Sep 17 00:00:00 2001 From: Bryan Wu Date: Fri, 30 Nov 2007 18:11:16 +0800 Subject: [PATCH] fix bug: when no USB device is plugged into the port of EZKIT-BF548, USB OTG host mode got BUG() Move IRQ workqueue init before request_irq, otherwise host SUSPEND irq will call schedule_work() and BUG_ON() will fire because musb_irq_work did not initialised. We recorded it at https://blackfin.uclinux.org/gf/project/uclinux-dist/tracker/?action=TrackerItemEdit&tracker_id=141&tracker_item_id=3740 Although the Blackfin port of MUSB is not merged, this bug should be common for other platform with MUSB Signed-off-by: Bryan Wu Acked-by: Gadiyar, Anand Signed-off-by: Tony Lindgren --- drivers/usb/musb/musb_core.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index 33774a6cc19..008f42cad82 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c @@ -1992,6 +1992,9 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) if (status < 0) goto fail2; + /* Init IRQ workqueue before request_irq */ + INIT_WORK(&musb->irq_work, musb_irq_work); + /* attach to the IRQ */ if (request_irq (nIrq, musb->isr, 0, dev->bus_id, musb)) { dev_err(dev, "request_irq %d failed!\n", nIrq); @@ -2071,8 +2074,6 @@ fail: return status; } - INIT_WORK(&musb->irq_work, musb_irq_work); - #ifdef CONFIG_SYSFS status = device_create_file(dev, &dev_attr_mode); status = device_create_file(dev, &dev_attr_vbus); -- 2.41.1