Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 467b16d4 authored by Albert Lee's avatar Albert Lee Committed by Jeff Garzik
Browse files

[PATCH] libata irq-pio: misc fixes



   - 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: default avatarAlbert Lee <albertcc@tw.ibm.com>

============
Signed-off-by: default avatarJeff Garzik <jgarzik@pobox.com>
parent c7c6e949
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -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)
@@ -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;
@@ -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)