ap->pio_task_state = PIO_ST_IDLE;  ata_poll_qc_complete(qc, status); 
ap->pio_task_state = PIO_ST_LAST; 
static void ata_pio_block(struct ata_port *ap){	struct ata_queued_cmd *qc;	u8 status;	/*	 * This is purely hueristic.  This is a fast path.	 * Sometimes when we enter, BSY will be cleared in	 * a chk-status or two.  If not, the drive is probably seeking	 * or something.  Snooze for a couple msecs, then	 * chk-status again.  If still busy, fall back to	 * PIO_ST_POLL state.	 */	status = ata_busy_wait(ap, ATA_BUSY, 5);	if (status & ATA_BUSY) {		msleep(2);		status = ata_busy_wait(ap, ATA_BUSY, 10);		if (status & ATA_BUSY) {			ap->pio_task_state = PIO_ST_POLL;			ap->pio_task_timeout = jiffies + ATA_TMOUT_PIO;			return;		}	}	qc = ata_qc_from_tag(ap, ap->active_tag);	assert(qc != NULL);	if (is_atapi_taskfile(&qc->tf)) {		/* no more data to transfer or unsupported ATAPI command */		if ((status & ATA_DRQ) == 0) {			ap->pio_task_state = PIO_ST_IDLE;			ata_poll_qc_complete(qc, status);			return;		}		atapi_pio_bytes(qc);	} else {		/* handle BSY=0, DRQ=0 as error */		if ((status & ATA_DRQ) == 0) {			ap->pio_task_state = PIO_ST_ERR;			return;		}		ata_pio_sector(qc);	}}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/7fb6ec287a05d7a71ec086d8bc9a452d5e16ff1a/libata-core.c/buggy/drivers/scsi/libata-core.c