diff options
author | Albert Lee <albertcc@tw.ibm.com> | 2005-09-30 07:14:19 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-09-30 07:21:06 -0400 |
commit | 54f00389563c80fa1de250a21256313ba01ca07d (patch) | |
tree | d8f0372ba782b902144f8efbaec6a38d439aad09 /drivers/scsi/libata-core.c | |
parent | 86a7397cda08a65bc4f306e812c846e2437b5347 (diff) |
[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.c | 46 |
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) | |||
3407 | 3407 | ||
3408 | ata_tf_to_host_nolock(ap, &qc->tf); | 3408 | ata_tf_to_host_nolock(ap, &qc->tf); |
3409 | 3409 | ||
3410 | if (qc->tf.flags & ATA_TFLAG_POLLING) { | 3410 | if (qc->tf.flags & ATA_TFLAG_WRITE) { |
3411 | /* polling PIO */ | 3411 | /* PIO data out protocol */ |
3412 | ap->hsm_task_state = HSM_ST; | 3412 | ap->hsm_task_state = HSM_ST_FIRST; |
3413 | queue_work(ata_wq, &ap->pio_task); | 3413 | queue_work(ata_wq, &ap->dataout_task); |
3414 | |||
3415 | /* always send first data block using | ||
3416 | * the ata_dataout_task() codepath. | ||
3417 | */ | ||
3414 | } else { | 3418 | } else { |
3415 | /* interrupt driven PIO */ | 3419 | /* PIO data in protocol */ |
3416 | if (qc->tf.flags & ATA_TFLAG_WRITE) { | 3420 | ap->hsm_task_state = HSM_ST; |
3417 | /* PIO data out protocol */ | 3421 | |
3418 | ap->hsm_task_state = HSM_ST_FIRST; | 3422 | if (qc->tf.flags & ATA_TFLAG_POLLING) |
3419 | queue_work(ata_wq, &ap->dataout_task); | 3423 | queue_work(ata_wq, &ap->pio_task); |
3420 | 3424 | ||
3421 | /* send first data block by polling */ | 3425 | /* if polling, ata_pio_task() handles the rest. |
3422 | } else { | 3426 | * otherwise, interrupt handler takes over from here. |
3423 | /* PIO data in protocol */ | 3427 | */ |
3424 | ap->hsm_task_state = HSM_ST; | ||
3425 | |||
3426 | /* interrupt handler takes over from here */ | ||
3427 | } | ||
3428 | } | 3428 | } |
3429 | 3429 | ||
3430 | break; | 3430 | break; |
@@ -4005,15 +4005,15 @@ static void ata_dataout_task(void *_data) | |||
4005 | ap->hsm_task_state = HSM_ST; | 4005 | ap->hsm_task_state = HSM_ST; |
4006 | ata_pio_sector(qc); | 4006 | ata_pio_sector(qc); |
4007 | ata_altstatus(ap); /* flush */ | 4007 | ata_altstatus(ap); /* flush */ |
4008 | 4008 | } else | |
4009 | /* interrupt handler takes over from here */ | ||
4010 | } else { | ||
4011 | /* send CDB */ | 4009 | /* send CDB */ |
4012 | atapi_send_cdb(ap, qc); | 4010 | atapi_send_cdb(ap, qc); |
4013 | 4011 | ||
4014 | if (qc->tf.flags & ATA_TFLAG_POLLING) | 4012 | /* if polling, ata_pio_task() handles the rest. |
4015 | queue_work(ata_wq, &ap->pio_task); | 4013 | * otherwise, interrupt handler takes over from here. |
4016 | } | 4014 | */ |
4015 | if (qc->tf.flags & ATA_TFLAG_POLLING) | ||
4016 | queue_work(ata_wq, &ap->pio_task); | ||
4017 | 4017 | ||
4018 | spin_unlock_irqrestore(&ap->host_set->lock, flags); | 4018 | spin_unlock_irqrestore(&ap->host_set->lock, flags); |
4019 | 4019 | ||