--- linux/drivers/scsi/libata-core.c.ori 2005-09-02 17:59:15.000000000 +0800 +++ pio1/drivers/scsi/libata-core.c 2005-09-02 18:37:26.000000000 +0800 @@ -2461,9 +2461,12 @@ * * LOCKING: * None. (executing in kernel thread context) + * + * RETURNS: + * Zero if qc completed, non-zero otherwise. */ -static void ata_pio_complete (struct ata_port *ap) +static int ata_pio_complete (struct ata_port *ap) { struct ata_queued_cmd *qc; u8 drv_stat; @@ -2482,14 +2485,14 @@ if (drv_stat & (ATA_BUSY | ATA_DRQ)) { ap->pio_task_state = PIO_ST_LAST_POLL; ap->pio_task_timeout = jiffies + ATA_TMOUT_PIO; - return; + return 1; /* qc not completed */ } } drv_stat = ata_wait_idle(ap); if (!ata_ok(drv_stat)) { ap->pio_task_state = PIO_ST_ERR; - return; + return 1; /* qc not completed */ } qc = ata_qc_from_tag(ap, ap->active_tag); @@ -2498,6 +2501,7 @@ ap->pio_task_state = PIO_ST_IDLE; ata_poll_qc_complete(qc, drv_stat); + return 0; /* qc completed */ } @@ -2813,9 +2817,12 @@ * * LOCKING: * None. (executing in kernel thread context) + * + * RETURNS: + * Zero if qc completed, non-zero otherwise. */ -static void ata_pio_block(struct ata_port *ap) +static int ata_pio_block(struct ata_port *ap) { struct ata_queued_cmd *qc; u8 status; @@ -2835,7 +2842,7 @@ if (status & ATA_BUSY) { ap->pio_task_state = PIO_ST_POLL; ap->pio_task_timeout = jiffies + ATA_TMOUT_PIO; - return; + return 1; /* qc not completed */ } } @@ -2848,7 +2855,7 @@ ap->pio_task_state = PIO_ST_IDLE; ata_poll_qc_complete(qc, status); - return; + return 0; /* qc completed */ } atapi_pio_bytes(qc); @@ -2856,11 +2863,13 @@ /* handle BSY=0, DRQ=0 as error */ if ((status & ATA_DRQ) == 0) { ap->pio_task_state = PIO_ST_ERR; - return; + return 1; /* qc not completed */ } ata_pio_sector(qc); } + + return 1; /* qc not completed */ } static void ata_pio_error(struct ata_port *ap)