summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libata-core.c
diff options
context:
space:
mode:
authorAlbert Lee2005-09-30 13:14:19 +0200
committerJeff Garzik2005-09-30 13:21:06 +0200
commit54f00389563c80fa1de250a21256313ba01ca07d (patch)
treed8f0372ba782b902144f8efbaec6a38d439aad09 /drivers/scsi/libata-core.c
parent[PATCH] libata irq-pio: simplify if condition in ata_dataout_task() (diff)
downloadkernel-qcow2-linux-54f00389563c80fa1de250a21256313ba01ca07d.tar.gz
kernel-qcow2-linux-54f00389563c80fa1de250a21256313ba01ca07d.tar.xz
kernel-qcow2-linux-54f00389563c80fa1de250a21256313ba01ca07d.zip
[PATCH] libata irq-pio: cleanup ata_qc_issue_prot()
ata_qc_issue_prot(): - cleanup and let the PIO data out case always go through the ata_dataout_task() codepath. (Previously for PIO data out case, 2 code pathes were used - irq case goes through ata_data_out_task() codepath. - polling case jumps over the HSM_ST_FIRST state and goes to HSM_ST and ata_pio_task() directly.) ata_dataout_task(): - rearrange the queue_work() code to handle the PIO data out + polling case. Signed-off-by: Albert Lee <albertcc@tw.ibm.com> Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/scsi/libata-core.c')
-rw-r--r--drivers/scsi/libata-core.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index cf5a138cdde5..02a7a9eb464d 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -3407,24 +3407,24 @@ int ata_qc_issue_prot(struct ata_queued_cmd *qc)
ata_tf_to_host_nolock(ap, &qc->tf);
- if (qc->tf.flags & ATA_TFLAG_POLLING) {
- /* polling PIO */
- ap->hsm_task_state = HSM_ST;
- queue_work(ata_wq, &ap->pio_task);
+ if (qc->tf.flags & ATA_TFLAG_WRITE) {
+ /* PIO data out protocol */
+ ap->hsm_task_state = HSM_ST_FIRST;
+ queue_work(ata_wq, &ap->dataout_task);
+
+ /* always send first data block using
+ * the ata_dataout_task() codepath.
+ */
} else {
- /* interrupt driven PIO */
- if (qc->tf.flags & ATA_TFLAG_WRITE) {
- /* PIO data out protocol */
- ap->hsm_task_state = HSM_ST_FIRST;
- queue_work(ata_wq, &ap->dataout_task);
-
- /* send first data block by polling */
- } else {
- /* PIO data in protocol */
- ap->hsm_task_state = HSM_ST;
-
- /* interrupt handler takes over from here */
- }
+ /* PIO data in protocol */
+ ap->hsm_task_state = HSM_ST;
+
+ if (qc->tf.flags & ATA_TFLAG_POLLING)
+ queue_work(ata_wq, &ap->pio_task);
+
+ /* if polling, ata_pio_task() handles the rest.
+ * otherwise, interrupt handler takes over from here.
+ */
}
break;
@@ -4005,15 +4005,15 @@ static void ata_dataout_task(void *_data)
ap->hsm_task_state = HSM_ST;
ata_pio_sector(qc);
ata_altstatus(ap); /* flush */
-
- /* interrupt handler takes over from here */
- } else {
+ } else
/* send CDB */
atapi_send_cdb(ap, qc);
- if (qc->tf.flags & ATA_TFLAG_POLLING)
- queue_work(ata_wq, &ap->pio_task);
- }
+ /* if polling, ata_pio_task() handles the rest.
+ * otherwise, interrupt handler takes over from here.
+ */
+ if (qc->tf.flags & ATA_TFLAG_POLLING)
+ queue_work(ata_wq, &ap->pio_task);
spin_unlock_irqrestore(&ap->host_set->lock, flags);