aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorMarc Pignat <marc.pignat@hevs.ch>2007-01-09 14:00:11 -0800
committerGreg Kroah-Hartman <gregkh@suse.de>2007-02-07 15:44:35 -0800
commit6dde896e4eac122f388263f0097b691acdc0396f (patch)
tree0ddf6a08407524e9b936405302c918572f9855df /drivers/usb
parentusb-storage: SCSI level fixes (diff)
downloadlinux-dev-6dde896e4eac122f388263f0097b691acdc0396f.tar.xz
linux-dev-6dde896e4eac122f388263f0097b691acdc0396f.zip
USB: ohci-at91 refcount fix for irq wake enables
The attached patch fixes the unbalanced calls to enable_irq_wake() and disable_irq_wake() in the AT91 USB Host driver. It should resolve these kernel messages: Unbalanced IRQ x wake disable BUG: warning at kernel/irq/manage.c:167/set_irq_wake() (The original code was debugged before a bug in the genirq wakeup irq logic was fixed by adding the IRQ wake enable/disable refcounting. Not all code yet uses the bugfixed model.) Signed-off-by: Andrew Victor <andrew@sanpeople.com> 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/host/ohci-at91.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c
index 53f62cf7698b..930346487278 100644
--- a/drivers/usb/host/ohci-at91.c
+++ b/drivers/usb/host/ohci-at91.c
@@ -170,7 +170,6 @@ static int usb_hcd_at91_remove(struct usb_hcd *hcd,
at91_stop_hc(pdev);
iounmap(hcd->regs);
release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
- disable_irq_wake(hcd->irq);
clk_put(fclk);
clk_put(iclk);
@@ -271,8 +270,6 @@ ohci_hcd_at91_drv_suspend(struct platform_device *pdev, pm_message_t mesg)
if (device_may_wakeup(&pdev->dev))
enable_irq_wake(hcd->irq);
- else
- disable_irq_wake(hcd->irq);
/*
* The integrated transceivers seem unable to notice disconnect,
@@ -293,6 +290,11 @@ ohci_hcd_at91_drv_suspend(struct platform_device *pdev, pm_message_t mesg)
static int ohci_hcd_at91_drv_resume(struct platform_device *pdev)
{
+ struct usb_hcd *hcd = platform_get_drvdata(pdev);
+
+ if (device_may_wakeup(&pdev->dev))
+ disable_irq_wake(hcd->irq);
+
if (!clocked) {
clk_enable(iclk);
clk_enable(fclk);