Alan,
I looked at uhci_scan_schedule today, and it seems to me that the code
which prevents re-entry is completely superfluous. I do not see a code
path which would loop back through usb_giveback_urb and end in
uhci_scan_schedule again. It is only called from ->stop, suspend,
and an interrupt. The access from other CPU is bracketed with uhci->lock.
What do you think about dropping this code?
I only noticed because Fujitsu submitted a patch for RHEL which backports
this stuff, and they fumbled with spinlocks. But on their platform it's
an instant death. Apparently, this mechanism is never excercised.
It must be a carryover from some old implementation.
-- Pete
diff -urp -X dontdiff linux-2.6.16-git13/drivers/usb/host/uhci-hcd.h
linux-2.6.16-git13-uhci/drivers/usb/host/uhci-hcd.h
--- linux-2.6.16-git13/drivers/usb/host/uhci-hcd.h 2006-03-27
07:48:23.000000000 -0800
+++ linux-2.6.16-git13-uhci/drivers/usb/host/uhci-hcd.h 2006-03-29
19:00:52.000000000 -0800
@@ -406,8 +406,6 @@ struct uhci_hcd {
unsigned int is_stopped;
#define UHCI_IS_STOPPED 9999 /* Larger than a frame
# */
- unsigned int scan_in_progress:1; /* Schedule scan is running */
- unsigned int need_rescan:1; /* Redo the schedule scan */
unsigned int hc_inaccessible:1; /* HC is suspended or dead */
unsigned int working_RD:1; /* Suspended root hub doesn't
need to be polled */
diff -urp -X dontdiff linux-2.6.16-git13/drivers/usb/host/uhci-q.c
linux-2.6.16-git13-uhci/drivers/usb/host/uhci-q.c
--- linux-2.6.16-git13/drivers/usb/host/uhci-q.c 2006-03-27
07:48:23.000000000 -0800
+++ linux-2.6.16-git13-uhci/drivers/usb/host/uhci-q.c 2006-03-29
18:58:23.000000000 -0800
@@ -1355,15 +1355,6 @@ static void uhci_scan_schedule(struct uh
int i;
struct uhci_qh *qh;
- /* Don't allow re-entrant calls */
- if (uhci->scan_in_progress) {
- uhci->need_rescan = 1;
- return;
- }
- uhci->scan_in_progress = 1;
- rescan:
- uhci->need_rescan = 0;
-
uhci_clear_next_interrupt(uhci);
uhci_get_current_frame_number(uhci);
@@ -1381,10 +1372,6 @@ static void uhci_scan_schedule(struct uh
}
}
- if (uhci->need_rescan)
- goto rescan;
- uhci->scan_in_progress = 0;
-
/* If the controller is stopped, we can finish these off right now */
if (uhci->is_stopped)
uhci_free_pending_tds(uhci);
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel