Skip to contentSkip to conversation

scsi/ahci: replace schedule_timeout() with

PATCH New Nishanth Aravamudan 1 participant 1 message Oct 22, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi/ahci: replace schedule_timeout() with

Any comments would be, as always, appreciated.

-Nish

Description: Uses msleep() / ssleep() [as appropriate] instead of schedule_timeout() to guarantee the task delays as expected.

drivers/scsi/ahci.c +3 -6
@@ -363,8 +363,7 @@ static void ahci_port_stop(struct ata_po
 	/* spec says 500 msecs for each PORT_CMD_{START,FIS_RX} bit, so
 	 * this is slightly incorrect.
 	 */
-	set_current_state(TASK_UNINTERRUPTIBLE);
-	schedule_timeout((HZ / 2) + 1);
+	msleep(500);
 
 	ap->private_data = NULL;
 	pci_free_consistent(pdev, AHCI_PORT_PRIV_DMA_SZ,
@@ -719,8 +718,7 @@ static int ahci_host_init(struct ata_pro
 	/* reset must complete within 1 second, or
 	 * the hardware should be considered fried.
 	 */
-	set_current_state(TASK_UNINTERRUPTIBLE);
-	schedule_timeout(HZ + 1);
+	ssleep(1);
 
 	tmp = readl(mmio + HOST_CTL);
 	if (tmp & HOST_RESET) {
@@ -798,8 +796,7 @@ static int ahci_host_init(struct ata_pro
 			/* spec says 500 msecs for each bit, so
 			 * this is slightly incorrect.
 			 */
-			set_current_state(TASK_UNINTERRUPTIBLE);
-			schedule_timeout((HZ / 2) + 1);
+			msleep(500);
 		}
 
 		writel(PORT_CMD_SPIN_UP, port_mmio + PORT_CMD);

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors