Skip to contentSkip to conversation

fix bug: when no USB device is plugged into the port of EZKIT-BF548, USB OTG host mode got BUG()

PATCH In review Bryan Wu 3 participants 3 messages Nov 30, 2007 – Dec 5, 2007

Subsystems (2)
lore
Share & tools
lore

Bryan Wu

author
#0 lore raw

PATCH 1/1 fix bug: when no USB device is plugged into the port of EZKIT-BF548, USB OTG host mode got BUG()

Subject: [PATCH] [MUSB] 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

---
 drivers/usb/musb/musb_core.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
drivers/usb/musb/musb_core.c +3 -2
index 33774a6..008f42c 100644
@@ -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);
Signature · 1 line
1.5.3
#1 lore raw

RE: [PATCH] [MUSB] fix bug: when no USB device is plugged into theport of EZKIT-BF548, USB OTG host mode got BUG()

Ack. We caught this too.

Next time, I think I should send the fix as soon as we catch it :)

--Anand

Quoted 62 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Bryan Wu
Sent: Friday, November 30, 2007 3:41 PM
To: Tony Lindgren; David Brownell; linux-omap-open-source
Subject: [PATCH] [MUSB] fix bug: when no USB device is plugged into theport of EZKIT-BF548, USB OTG host mode got BUG()

Subject: [PATCH] [MUSB] 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

---
 drivers/usb/musb/musb_core.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
drivers/usb/musb/musb_core.c +3 -0
index 33774a6..008f42c 100644
@@ -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)) {
drivers/usb/musb/musb_core.c +0 -2
 		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);
Signature · 6 lines
1.5.3

_______________________________________________
Linux-omap-open-source mailing list
[email protected]
http://linux.omap.com/mailman/listinfo/linux-omap-open-source
#2 lore raw

Re: [PATCH] [MUSB] fix bug: when no USB device is plugged into theport of EZKIT-BF548, USB OTG host mode got BUG()

Quoted 30 lines · Gadiyar, Anand

Ack. We caught this too.

Next time, I think I should send the fix as soon as we catch it :)

--Anand

Quoted 23 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Bryan Wu
Sent: Friday, November 30, 2007 3:41 PM
To: Tony Lindgren; David Brownell; linux-omap-open-source
Subject: [PATCH] [MUSB] fix bug: when no USB device is plugged into theport of EZKIT-BF548, USB OTG host mode got BUG()

Subject: [PATCH] [MUSB] 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

Pushing Today.

Tony