[Linux1394-cvslog] rev 859 - branches/linux-2.4
Brought to you by:
aeb,
bencollins
|
From: SVN U. <ben...@li...> - 2003-04-10 15:06:38
|
Author: bencollins
Date: 2003-04-10 11:05:57 -0400 (Thu, 10 Apr 2003)
New Revision: 859
Modified:
branches/linux-2.4/nodemgr.c
Log:
Patch from Jim Radford to keep from building up long delays from busreset
storms.
Modified: branches/linux-2.4/nodemgr.c
==============================================================================
--- branches/linux-2.4/nodemgr.c (original)
+++ branches/linux-2.4/nodemgr.c 2003-04-10 11:05:58.000000000 -0400
@@ -1260,18 +1260,13 @@
while (!down_interruptible(&hi->reset_sem) &&
!down_interruptible(&nodemgr_serialize)) {
unsigned int generation;
+ int i;
- /* Many resets can happen while we are waiting below.
- * Make sure we respond only to the most recent one. */
- do {
- /* Pause for 1/4 second, to make sure things settle down. If
- * schedule_timeout returns non-zero, it means we caught a signal
- * and that we should exit. */
+ /* Pause for 1/4 second, to make sure things settle down. */
+ for (i = HZ/4; i > 0; i-= HZ/16) {
set_current_state(TASK_INTERRUPTIBLE);
- if (schedule_timeout (HZ/4)) {
- up(&nodemgr_serialize);
+ if (schedule_timeout(HZ/16))
goto caught_signal;
- }
/* Now get the generation in which the node ID's we collect
* are valid. During the bus scan we will use this generation
@@ -1279,7 +1274,12 @@
* during the scan the transactions will fail instead of
* returning bogus data. */
generation = get_hpsb_generation(hi->host);
- } while(!down_trylock(&hi->reset_sem));
+
+ /* If we get a reset before we are done waiting, then
+ * start the the waiting over again */
+ while (!down_trylock(&hi->reset_sem))
+ i = HZ/4;
+ }
if (!nodemgr_check_root_capability(hi->host)) {
/* Do nothing, we are resetting */
|