We've been carrying this for a dogs age in Fedora. It'd be good to get
this in -mm, so that it stands some chance of getting upstreamed at some point.
Signed-off-by: Arjan van de Ven <arjan@xxxxxxxxxxxxx>
Signed-off-by: Dave Jones <davej@xxxxxxxxxx>
diff -urNp --exclude-from=/home/davej/.exclude linux-1060/drivers/block/DAC960.c linux-1070/drivers/block/DAC960.c
--- linux-1060/drivers/block/DAC960.c
+++ linux-1070/drivers/block/DAC960.c
@@ -6132,6 +6132,9 @@ static boolean DAC960_V2_ExecuteUserComm
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)
@@ -6314,11 +6317,18 @@ static boolean DAC960_V2_ExecuteUserComm
.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);
diff -urNp --exclude-from=/home/davej/.exclude linux-1060/include/linux/wait.h linux-1070/include/linux/wait.h
--- linux-1060/include/linux/wait.h
+++ linux-1070/include/linux/wait.h