This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / drivers / block / DAC960.c
index 29035dd..02a29e8 100644 (file)
@@ -6125,6 +6125,9 @@ static boolean DAC960_V2_ExecuteUserCommand(DAC960_Controller_T *Controller,
   unsigned long flags;
   unsigned char Channel, TargetID, LogicalDriveNumber;
   unsigned short LogicalDeviceNumber;
+  wait_queue_t __wait;
+  
+  init_waitqueue_entry(&__wait, current);
 
   spin_lock_irqsave(&Controller->queue_lock, flags);
   while ((Command = DAC960_AllocateCommand(Controller)) == NULL)
@@ -6307,11 +6310,18 @@ static boolean DAC960_V2_ExecuteUserCommand(DAC960_Controller_T *Controller,
                                        .SegmentByteCount =
            CommandMailbox->ControllerInfo.DataTransferSize;
          DAC960_ExecuteCommand(Command);
+         add_wait_queue(&Controller->CommandWaitQueue, &__wait);
+         set_current_state(TASK_UNINTERRUPTIBLE);
+         
          while (Controller->V2.NewControllerInformation->PhysicalScanActive)
            {
              DAC960_ExecuteCommand(Command);
-             sleep_on_timeout(&Controller->CommandWaitQueue, HZ);
+             schedule_timeout(HZ);
+             set_current_state(TASK_UNINTERRUPTIBLE);
            }
+         current->state = TASK_RUNNING;
+         remove_wait_queue(&Controller->CommandWaitQueue, &__wait);
+          
          DAC960_UserCritical("Discovery Completed\n", Controller);
        }
     }