From cdc647a9b75741659bfc6acc44a6b3a646ad53bf Mon Sep 17 00:00:00 2001 From: David Brownell Date: Wed, 2 Apr 2008 13:40:20 -0700 Subject: USB: another ehci_iaa_watchdog fix This patch, suggested by Alan Stern, fixes the hung USB issues on my notebook from suspend/resume cycles. It does so by eliminating some confusion about the internal state machine associated with unlinking from the EHCI async schedule ring, which caused a recent regression: http://bugzilla.kernel.org/show_bug.cgi?id=10345 Signed-off-by: Mark Lord Signed-off-by: David Brownell Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/ehci-hub.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'drivers/usb/host') diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c index 40e8240b785..4e065e556e4 100644 --- a/drivers/usb/host/ehci-hub.c +++ b/drivers/usb/host/ehci-hub.c @@ -135,8 +135,6 @@ static int ehci_bus_suspend (struct usb_hcd *hcd) hcd->state = HC_STATE_QUIESCING; } ehci->command = ehci_readl(ehci, &ehci->regs->command); - if (ehci->reclaim) - end_unlink_async(ehci); ehci_work(ehci); /* Unlike other USB host controller types, EHCI doesn't have @@ -180,6 +178,9 @@ static int ehci_bus_suspend (struct usb_hcd *hcd) ehci_halt (ehci); hcd->state = HC_STATE_SUSPENDED; + if (ehci->reclaim) + end_unlink_async(ehci); + /* allow remote wakeup */ mask = INTR_MASK; if (!device_may_wakeup(&hcd->self.root_hub->dev)) -- cgit v1.2.3 From 9cebcdc7fb10d478b22d7125b215cee3b9ea82f2 Mon Sep 17 00:00:00 2001 From: Richard Kennedy Date: Fri, 28 Mar 2008 14:50:30 -0700 Subject: USB: ohci: fix 2 timers to fire at jiffies + 1s Code inspection discovered in 2 places timers were being incorrectly setup using round_jiffies_relative(HZ). The timer would then fire at time (0 <= T < HZ). Fix them to use round_jiffies(jiffies + HZ); Signed-off-by: Richard Kennedy Cc: Alan Stern Cc: David Brownell Cc: Arjan van de Ven Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/ohci-hcd.c | 2 +- drivers/usb/host/ohci-q.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/usb/host') diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c index dd4798ee028..33f1c1c32ed 100644 --- a/drivers/usb/host/ohci-hcd.c +++ b/drivers/usb/host/ohci-hcd.c @@ -467,7 +467,7 @@ static void unlink_watchdog_func(unsigned long _ohci) out: kfree(seen); if (ohci->eds_scheduled) - mod_timer(&ohci->unlink_watchdog, round_jiffies_relative(HZ)); + mod_timer(&ohci->unlink_watchdog, round_jiffies(jiffies + HZ)); done: spin_unlock_irqrestore(&ohci->lock, flags); } diff --git a/drivers/usb/host/ohci-q.c b/drivers/usb/host/ohci-q.c index 51817322232..9c9f3b59186 100644 --- a/drivers/usb/host/ohci-q.c +++ b/drivers/usb/host/ohci-q.c @@ -169,7 +169,7 @@ static int ed_schedule (struct ohci_hcd *ohci, struct ed *ed) if (quirk_zfmicro(ohci) && (ed->type == PIPE_INTERRUPT) && !(ohci->eds_scheduled++)) - mod_timer(&ohci->unlink_watchdog, round_jiffies_relative(HZ)); + mod_timer(&ohci->unlink_watchdog, round_jiffies(jiffies + HZ)); wmb (); /* we care about rm_list when setting CLE/BLE in case the HC was at -- cgit v1.2.3 From f4fce61d410b96ae263b001c45f73df1863dad8d Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Thu, 10 Apr 2008 21:29:22 -0700 Subject: usb host: fix platform driver hotplug/coldplug Since 43cc71eed1250755986da4c0f9898f9a635cb3bf, the platform modalias is prefixed with "platform:". Add MODULE_ALIAS() to the hotpluggable USB HCDs, to allow re-enable auto loading. [dbrownell@users.sourceforge.net: more drivers; registration fixes] Signed-off-by: Kay Sievers Signed-off-by: David Brownell Cc: Greg KH Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/usb/host/isp116x-hcd.c | 8 ++++++-- drivers/usb/host/ohci-at91.c | 3 +-- drivers/usb/host/ohci-au1xxx.c | 1 + drivers/usb/host/ohci-ep93xx.c | 2 ++ drivers/usb/host/ohci-lh7a404.c | 1 + drivers/usb/host/ohci-omap.c | 1 + drivers/usb/host/ohci-pnx4008.c | 4 ++++ drivers/usb/host/ohci-pnx8550.c | 5 +++-- drivers/usb/host/ohci-ppc-soc.c | 1 + drivers/usb/host/ohci-pxa27x.c | 3 +++ drivers/usb/host/ohci-s3c2410.c | 1 + drivers/usb/host/ohci-sh.c | 1 + drivers/usb/host/ohci-sm501.c | 1 + drivers/usb/host/r8a66597-hcd.c | 2 ++ drivers/usb/host/sl811-hcd.c | 1 + drivers/usb/host/u132-hcd.c | 1 + 16 files changed, 30 insertions(+), 6 deletions(-) (limited to 'drivers/usb/host') diff --git a/drivers/usb/host/isp116x-hcd.c b/drivers/usb/host/isp116x-hcd.c index d7071c85575..203a3359a64 100644 --- a/drivers/usb/host/isp116x-hcd.c +++ b/drivers/usb/host/isp116x-hcd.c @@ -1684,14 +1684,18 @@ static int isp116x_resume(struct platform_device *dev) #endif +/* work with hotplug and coldplug */ +MODULE_ALIAS("platform:isp116x-hcd"); + static struct platform_driver isp116x_driver = { .probe = isp116x_probe, .remove = isp116x_remove, .suspend = isp116x_suspend, .resume = isp116x_resume, .driver = { - .name = (char *)hcd_name, - }, + .name = (char *)hcd_name, + .owner = THIS_MODULE, + }, }; /*-----------------------------------------------------------------*/ diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c index 126fcbdd640..d72dc07dda0 100644 --- a/drivers/usb/host/ohci-at91.c +++ b/drivers/usb/host/ohci-at91.c @@ -355,7 +355,7 @@ static int ohci_hcd_at91_drv_resume(struct platform_device *pdev) #define ohci_hcd_at91_drv_resume NULL #endif -MODULE_ALIAS("at91_ohci"); +MODULE_ALIAS("platform:at91_ohci"); static struct platform_driver ohci_hcd_at91_driver = { .probe = ohci_hcd_at91_drv_probe, @@ -368,4 +368,3 @@ static struct platform_driver ohci_hcd_at91_driver = { .owner = THIS_MODULE, }, }; - diff --git a/drivers/usb/host/ohci-au1xxx.c b/drivers/usb/host/ohci-au1xxx.c index 663a0600b6e..f90fe0c7373 100644 --- a/drivers/usb/host/ohci-au1xxx.c +++ b/drivers/usb/host/ohci-au1xxx.c @@ -345,3 +345,4 @@ static struct platform_driver ohci_hcd_au1xxx_driver = { }, }; +MODULE_ALIAS("platform:au1xxx-ohci"); diff --git a/drivers/usb/host/ohci-ep93xx.c b/drivers/usb/host/ohci-ep93xx.c index a68ce9d3c52..156e93a9d0d 100644 --- a/drivers/usb/host/ohci-ep93xx.c +++ b/drivers/usb/host/ohci-ep93xx.c @@ -211,6 +211,8 @@ static struct platform_driver ohci_hcd_ep93xx_driver = { #endif .driver = { .name = "ep93xx-ohci", + .owner = THIS_MODULE, }, }; +MODULE_ALIAS("platform:ep93xx-ohci"); diff --git a/drivers/usb/host/ohci-lh7a404.c b/drivers/usb/host/ohci-lh7a404.c index 4a043abd85e..13c12ed2225 100644 --- a/drivers/usb/host/ohci-lh7a404.c +++ b/drivers/usb/host/ohci-lh7a404.c @@ -251,3 +251,4 @@ static struct platform_driver ohci_hcd_lh7a404_driver = { }, }; +MODULE_ALIAS("platform:lh7a404-ohci"); diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c index 74e1f4be10b..7bfca1ed1b5 100644 --- a/drivers/usb/host/ohci-omap.c +++ b/drivers/usb/host/ohci-omap.c @@ -544,3 +544,4 @@ static struct platform_driver ohci_hcd_omap_driver = { }, }; +MODULE_ALIAS("platform:ohci"); diff --git a/drivers/usb/host/ohci-pnx4008.c b/drivers/usb/host/ohci-pnx4008.c index 6c52c66b659..28b458f20cc 100644 --- a/drivers/usb/host/ohci-pnx4008.c +++ b/drivers/usb/host/ohci-pnx4008.c @@ -456,9 +456,13 @@ static int usb_hcd_pnx4008_remove(struct platform_device *pdev) return 0; } +/* work with hotplug and coldplug */ +MODULE_ALIAS("platform:usb-ohci"); + static struct platform_driver usb_hcd_pnx4008_driver = { .driver = { .name = "usb-ohci", + .owner = THIS_MODULE, }, .probe = usb_hcd_pnx4008_probe, .remove = usb_hcd_pnx4008_remove, diff --git a/drivers/usb/host/ohci-pnx8550.c b/drivers/usb/host/ohci-pnx8550.c index 85fdfd2a7ad..605d59cba28 100644 --- a/drivers/usb/host/ohci-pnx8550.c +++ b/drivers/usb/host/ohci-pnx8550.c @@ -230,11 +230,12 @@ static int ohci_hcd_pnx8550_drv_remove(struct platform_device *pdev) return 0; } -MODULE_ALIAS("pnx8550-ohci"); +MODULE_ALIAS("platform:pnx8550-ohci"); static struct platform_driver ohci_hcd_pnx8550_driver = { .driver = { - .name = "pnx8550-ohci", + .name = "pnx8550-ohci", + .owner = THIS_MODULE, }, .probe = ohci_hcd_pnx8550_drv_probe, .remove = ohci_hcd_pnx8550_drv_remove, diff --git a/drivers/usb/host/ohci-ppc-soc.c b/drivers/usb/host/ohci-ppc-soc.c index f95be1896b0..523c3012557 100644 --- a/drivers/usb/host/ohci-ppc-soc.c +++ b/drivers/usb/host/ohci-ppc-soc.c @@ -213,3 +213,4 @@ static struct platform_driver ohci_hcd_ppc_soc_driver = { }, }; +MODULE_ALIAS("platform:ppc-soc-ohci"); diff --git a/drivers/usb/host/ohci-pxa27x.c b/drivers/usb/host/ohci-pxa27x.c index ff9a7984347..8ad9b3b604b 100644 --- a/drivers/usb/host/ohci-pxa27x.c +++ b/drivers/usb/host/ohci-pxa27x.c @@ -364,6 +364,8 @@ static int ohci_hcd_pxa27x_drv_resume(struct platform_device *pdev) } #endif +/* work with hotplug and coldplug */ +MODULE_ALIAS("platform:pxa27x-ohci"); static struct platform_driver ohci_hcd_pxa27x_driver = { .probe = ohci_hcd_pxa27x_drv_probe, @@ -375,6 +377,7 @@ static struct platform_driver ohci_hcd_pxa27x_driver = { #endif .driver = { .name = "pxa27x-ohci", + .owner = THIS_MODULE, }, }; diff --git a/drivers/usb/host/ohci-s3c2410.c b/drivers/usb/host/ohci-s3c2410.c index 44b79e8a6e2..ead4772f0f2 100644 --- a/drivers/usb/host/ohci-s3c2410.c +++ b/drivers/usb/host/ohci-s3c2410.c @@ -501,3 +501,4 @@ static struct platform_driver ohci_hcd_s3c2410_driver = { }, }; +MODULE_ALIAS("platform:s3c2410-ohci"); diff --git a/drivers/usb/host/ohci-sh.c b/drivers/usb/host/ohci-sh.c index 5309ac039e1..e7ee607278f 100644 --- a/drivers/usb/host/ohci-sh.c +++ b/drivers/usb/host/ohci-sh.c @@ -141,3 +141,4 @@ static struct platform_driver ohci_hcd_sh_driver = { }, }; +MODULE_ALIAS("platform:sh_ohci"); diff --git a/drivers/usb/host/ohci-sm501.c b/drivers/usb/host/ohci-sm501.c index a9707014286..4ea92762fb2 100644 --- a/drivers/usb/host/ohci-sm501.c +++ b/drivers/usb/host/ohci-sm501.c @@ -262,3 +262,4 @@ static struct platform_driver ohci_hcd_sm501_driver = { .name = "sm501-usb", }, }; +MODULE_ALIAS("platform:sm501-usb"); diff --git a/drivers/usb/host/r8a66597-hcd.c b/drivers/usb/host/r8a66597-hcd.c index 0ce2fc5e396..9f80e528557 100644 --- a/drivers/usb/host/r8a66597-hcd.c +++ b/drivers/usb/host/r8a66597-hcd.c @@ -44,6 +44,7 @@ MODULE_DESCRIPTION("R8A66597 USB Host Controller Driver"); MODULE_LICENSE("GPL"); MODULE_AUTHOR("Yoshihiro Shimoda"); +MODULE_ALIAS("platform:r8a66597_hcd"); #define DRIVER_VERSION "29 May 2007" @@ -2219,6 +2220,7 @@ static struct platform_driver r8a66597_driver = { .resume = r8a66597_resume, .driver = { .name = (char *) hcd_name, + .owner = THIS_MODULE, }, }; diff --git a/drivers/usb/host/sl811-hcd.c b/drivers/usb/host/sl811-hcd.c index 59be276ccd9..629bca0ebe8 100644 --- a/drivers/usb/host/sl811-hcd.c +++ b/drivers/usb/host/sl811-hcd.c @@ -58,6 +58,7 @@ MODULE_DESCRIPTION("SL811HS USB Host Controller Driver"); MODULE_LICENSE("GPL"); +MODULE_ALIAS("platform:sl811-hcd"); #define DRIVER_VERSION "19 May 2005" diff --git a/drivers/usb/host/u132-hcd.c b/drivers/usb/host/u132-hcd.c index 3033d694520..8e117a795e9 100644 --- a/drivers/usb/host/u132-hcd.c +++ b/drivers/usb/host/u132-hcd.c @@ -3316,3 +3316,4 @@ static void __exit u132_hcd_exit(void) module_exit(u132_hcd_exit); MODULE_LICENSE("GPL"); +MODULE_ALIAS("platform:u132_hcd"); -- cgit v1.2.3