Skip to content

Commit

Permalink
[PATCH] libata irq-pio: misc fixes
Browse files Browse the repository at this point in the history
   - ata_pio_block(): add ata_altstatus(ap) to prevent reading device status before it is valid
   - remove the unnecessary HSM_ST_IDLE state from ata_pio_task()
   - raise BUG() when unknown state is found in ata_pio_task()

Signed-off-by: Albert Lee <albertcc@tw.ibm.com>

============
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
  • Loading branch information
Albert Lee authored and Jeff Garzik committed Nov 9, 2005
1 parent c7c6e94 commit 467b16d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions drivers/scsi/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -3317,6 +3317,8 @@ static void ata_pio_block(struct ata_port *ap)

ata_pio_sector(qc);
}

ata_altstatus(ap); /* flush */
}

static void ata_pio_error(struct ata_port *ap)
Expand Down Expand Up @@ -3344,9 +3346,6 @@ static void ata_pio_task(void *_data)
qc_completed = 0;

switch (ap->hsm_task_state) {
case HSM_ST_IDLE:
return;

case HSM_ST:
ata_pio_block(ap);
break;
Expand All @@ -3364,6 +3363,10 @@ static void ata_pio_task(void *_data)
case HSM_ST_ERR:
ata_pio_error(ap);
return;

default:
BUG();
return;
}

if (timeout)
Expand Down

0 comments on commit 467b16d

Please sign in to comment.