aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/core
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2008-04-14 12:17:56 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2008-04-25 00:16:53 -0400
commite872154921a6b5256a3c412dd69158ac0b135176 (patch)
tree65c1ef7054d7c5ed3a94799e09db8036a7f9574c /drivers/usb/core
parent5f47493cdf90b8afe5353e59de30e449e775ea8b (diff)
USB: don't explicitly reenable root-hub status interrupts
This patch (as1069b) changes the way OHCI root-hub status-change interrupts are enabled. Currently a special HCD method, hub_irq_enable(), is called when the hub driver is finished using a root hub. This approach turns out to be subject to races, resulting in unnecessary polling. The patch does away with the method entirely. Instead, the driver automatically enables the RHSC interrupt when no more status changes are present. This scheme is safe with controllers using level-triggered semantics for their interrupt flags. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/core')
-rw-r--r--drivers/usb/core/hcd.c9
-rw-r--r--drivers/usb/core/hcd.h2
-rw-r--r--drivers/usb/core/hub.c9
3 files changed, 0 insertions, 20 deletions
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
index e68fef5361d2..bf10e9c4195e 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -924,15 +924,6 @@ static int register_root_hub(struct usb_hcd *hcd)
924 return retval; 924 return retval;
925} 925}
926 926
927void usb_enable_root_hub_irq (struct usb_bus *bus)
928{
929 struct usb_hcd *hcd;
930
931 hcd = container_of (bus, struct usb_hcd, self);
932 if (hcd->driver->hub_irq_enable && hcd->state != HC_STATE_HALT)
933 hcd->driver->hub_irq_enable (hcd);
934}
935
936 927
937/*-------------------------------------------------------------------------*/ 928/*-------------------------------------------------------------------------*/
938 929
diff --git a/drivers/usb/core/hcd.h b/drivers/usb/core/hcd.h
index 3ba258eb05de..1e4b81e9eb50 100644
--- a/drivers/usb/core/hcd.h
+++ b/drivers/usb/core/hcd.h
@@ -210,8 +210,6 @@ struct hc_driver {
210 int (*bus_suspend)(struct usb_hcd *); 210 int (*bus_suspend)(struct usb_hcd *);
211 int (*bus_resume)(struct usb_hcd *); 211 int (*bus_resume)(struct usb_hcd *);
212 int (*start_port_reset)(struct usb_hcd *, unsigned port_num); 212 int (*start_port_reset)(struct usb_hcd *, unsigned port_num);
213 void (*hub_irq_enable)(struct usb_hcd *);
214 /* Needed only if port-change IRQs are level-triggered */
215 213
216 /* force handover of high-speed port to full-speed companion */ 214 /* force handover of high-speed port to full-speed companion */
217 void (*relinquish_port)(struct usb_hcd *, int); 215 void (*relinquish_port)(struct usb_hcd *, int);
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 1e23e360ea91..5a338a5d4fe7 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -2001,8 +2001,6 @@ int usb_port_resume(struct usb_device *udev)
2001 } 2001 }
2002 2002
2003 clear_bit(port1, hub->busy_bits); 2003 clear_bit(port1, hub->busy_bits);
2004 if (!hub->hdev->parent && !hub->busy_bits[0])
2005 usb_enable_root_hub_irq(hub->hdev->bus);
2006 2004
2007 if (status == 0) 2005 if (status == 0)
2008 status = finish_port_resume(udev); 2006 status = finish_port_resume(udev);
@@ -2918,11 +2916,6 @@ static void hub_events(void)
2918 2916
2919 hub->activating = 0; 2917 hub->activating = 0;
2920 2918
2921 /* If this is a root hub, tell the HCD it's okay to
2922 * re-enable port-change interrupts now. */
2923 if (!hdev->parent && !hub->busy_bits[0])
2924 usb_enable_root_hub_irq(hdev->bus);
2925
2926loop_autopm: 2919loop_autopm:
2927 /* Allow autosuspend if we're not going to run again */ 2920 /* Allow autosuspend if we're not going to run again */
2928 if (list_empty(&hub->event_list)) 2921 if (list_empty(&hub->event_list))
@@ -3148,8 +3141,6 @@ int usb_reset_device(struct usb_device *udev)
3148 break; 3141 break;
3149 } 3142 }
3150 clear_bit(port1, parent_hub->busy_bits); 3143 clear_bit(port1, parent_hub->busy_bits);
3151 if (!parent_hdev->parent && !parent_hub->busy_bits[0])
3152 usb_enable_root_hub_irq(parent_hdev->bus);
3153 3144
3154 if (ret < 0) 3145 if (ret < 0)
3155 goto re_enumerate; 3146 goto re_enumerate;