]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
ide: use wait_drive_not_busy() in drive_cmd_intr() (take 2)
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Sat, 26 Jan 2008 19:13:11 +0000 (20:13 +0100)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Sat, 26 Jan 2008 19:13:11 +0000 (20:13 +0100)
Use wait_drive_not_busy() in drive_cmd_intr().

v2:
* Fix wait_drive_not_busy() comment (noticed by Sergei).

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
drivers/ide/ide-io.c
drivers/ide/ide-taskfile.c
include/linux/ide.h

index 0f3e2f4f9c2c1c25ccda12baa4feee5d68c9d9c8..513a5685db2f6c4374437681a0a0999ff9a0e7e1 100644 (file)
@@ -640,7 +640,6 @@ static ide_startstop_t drive_cmd_intr (ide_drive_t *drive)
        ide_hwif_t *hwif = HWIF(drive);
        u8 *args = (u8 *) rq->buffer;
        u8 stat = hwif->INB(IDE_STATUS_REG);
-       int retries = 10;
 
        local_irq_enable_in_hardirq();
        if (rq->cmd_type == REQ_TYPE_ATA_CMD &&
@@ -649,8 +648,7 @@ static ide_startstop_t drive_cmd_intr (ide_drive_t *drive)
                drive->io_32bit = 0;
                hwif->ata_input_data(drive, &args[4], args[3] * SECTOR_WORDS);
                drive->io_32bit = io_32bit;
-               while (((stat = hwif->INB(IDE_STATUS_REG)) & BUSY_STAT) && retries--)
-                       udelay(100);
+               stat = wait_drive_not_busy(drive);
        }
 
        if (!OK_STAT(stat, READY_STAT, BAD_STAT))
index c34836c02b14ac0fc74a4e369511d5aadf4e07e6..b559bece6e73ea9d49925d142d453ea0912eba62 100644 (file)
@@ -260,7 +260,7 @@ static ide_startstop_t task_no_data_intr(ide_drive_t *drive)
        return ide_stopped;
 }
 
-static u8 wait_drive_not_busy(ide_drive_t *drive)
+u8 wait_drive_not_busy(ide_drive_t *drive)
 {
        ide_hwif_t *hwif = HWIF(drive);
        int retries;
@@ -268,8 +268,7 @@ static u8 wait_drive_not_busy(ide_drive_t *drive)
 
        /*
         * Last sector was transfered, wait until drive is ready.
-        * This can take up to 10 usec, but we will wait max 1 ms
-        * (drive_cmd_intr() waits that long).
+        * This can take up to 10 usec, but we will wait max 1 ms.
         */
        for (retries = 0; retries < 100; retries++) {
                if ((stat = hwif->INB(IDE_STATUS_REG)) & BUSY_STAT)
index 7615a6244a5100114c9eb3cf69d29ea81a6b83df..c889a6e91c5c65db0f16ed6d6750a18850090490 100644 (file)
@@ -994,6 +994,8 @@ ide_startstop_t do_rw_taskfile(ide_drive_t *, ide_task_t *);
 
 void task_end_request(ide_drive_t *, struct request *, u8);
 
+u8 wait_drive_not_busy(ide_drive_t *);
+
 int ide_raw_taskfile(ide_drive_t *, ide_task_t *, u8 *, u16);
 int ide_no_data_taskfile(ide_drive_t *, ide_task_t *);