diff options
author | Albert Lee <albertcc@tw.ibm.com> | 2005-11-01 06:24:49 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-11-09 01:22:19 -0500 |
commit | e27486db89ef04d5df1727c52362fa3d50cff241 (patch) | |
tree | cd78598ac47f541f51b5d729ea9cf31bdfa10e56 /drivers/scsi/libata-core.c | |
parent | 467b16d4bebe8d251ca974eaa5da50b315206e9d (diff) |
[PATCH] libata irq-pio: merge the ata_dataout_task workqueue with ata_pio_task workqueue
- remove ap->dataout_task from struct ata_port
- let ata_pio_task() handle the HSM_ST_FIRST state.
- rename ata_dataout_task() to ata_pio_first_block()
- replace the ata_dataout_task workqueue with ata_pio_task workqueue
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 | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c index 15736e3313f0..96b8bbaa7631 100644 --- a/drivers/scsi/libata-core.c +++ b/drivers/scsi/libata-core.c | |||
@@ -3056,8 +3056,8 @@ static void atapi_send_cdb(struct ata_port *ap, struct ata_queued_cmd *qc) | |||
3056 | } | 3056 | } |
3057 | 3057 | ||
3058 | /** | 3058 | /** |
3059 | * ata_dataout_task - Write first data block to hardware | 3059 | * ata_pio_first_block - Write first data block to hardware |
3060 | * @_data: Port to which ATA/ATAPI device is attached. | 3060 | * @ap: Port to which ATA/ATAPI device is attached. |
3061 | * | 3061 | * |
3062 | * When device has indicated its readiness to accept | 3062 | * When device has indicated its readiness to accept |
3063 | * the data, this function sends out the CDB or | 3063 | * the data, this function sends out the CDB or |
@@ -3070,9 +3070,8 @@ static void atapi_send_cdb(struct ata_port *ap, struct ata_queued_cmd *qc) | |||
3070 | * Kernel thread context (may sleep) | 3070 | * Kernel thread context (may sleep) |
3071 | */ | 3071 | */ |
3072 | 3072 | ||
3073 | static void ata_dataout_task(void *_data) | 3073 | static void ata_pio_first_block(struct ata_port *ap) |
3074 | { | 3074 | { |
3075 | struct ata_port *ap = _data; | ||
3076 | struct ata_queued_cmd *qc; | 3075 | struct ata_queued_cmd *qc; |
3077 | u8 status; | 3076 | u8 status; |
3078 | unsigned long flags; | 3077 | unsigned long flags; |
@@ -3346,6 +3345,10 @@ fsm_start: | |||
3346 | qc_completed = 0; | 3345 | qc_completed = 0; |
3347 | 3346 | ||
3348 | switch (ap->hsm_task_state) { | 3347 | switch (ap->hsm_task_state) { |
3348 | case HSM_ST_FIRST: | ||
3349 | ata_pio_first_block(ap); | ||
3350 | return; | ||
3351 | |||
3349 | case HSM_ST: | 3352 | case HSM_ST: |
3350 | ata_pio_block(ap); | 3353 | ata_pio_block(ap); |
3351 | break; | 3354 | break; |
@@ -3796,10 +3799,10 @@ int ata_qc_issue_prot(struct ata_queued_cmd *qc) | |||
3796 | if (qc->tf.flags & ATA_TFLAG_WRITE) { | 3799 | if (qc->tf.flags & ATA_TFLAG_WRITE) { |
3797 | /* PIO data out protocol */ | 3800 | /* PIO data out protocol */ |
3798 | ap->hsm_task_state = HSM_ST_FIRST; | 3801 | ap->hsm_task_state = HSM_ST_FIRST; |
3799 | queue_work(ata_wq, &ap->dataout_task); | 3802 | queue_work(ata_wq, &ap->pio_task); |
3800 | 3803 | ||
3801 | /* always send first data block using | 3804 | /* always send first data block using |
3802 | * the ata_dataout_task() codepath. | 3805 | * the ata_pio_task() codepath. |
3803 | */ | 3806 | */ |
3804 | } else { | 3807 | } else { |
3805 | /* PIO data in protocol */ | 3808 | /* PIO data in protocol */ |
@@ -3826,7 +3829,7 @@ int ata_qc_issue_prot(struct ata_queued_cmd *qc) | |||
3826 | /* send cdb by polling if no cdb interrupt */ | 3829 | /* send cdb by polling if no cdb interrupt */ |
3827 | if ((!(qc->dev->flags & ATA_DFLAG_CDB_INTR)) || | 3830 | if ((!(qc->dev->flags & ATA_DFLAG_CDB_INTR)) || |
3828 | (qc->tf.flags & ATA_TFLAG_POLLING)) | 3831 | (qc->tf.flags & ATA_TFLAG_POLLING)) |
3829 | queue_work(ata_wq, &ap->dataout_task); | 3832 | queue_work(ata_wq, &ap->pio_task); |
3830 | break; | 3833 | break; |
3831 | 3834 | ||
3832 | case ATA_PROT_ATAPI_DMA: | 3835 | case ATA_PROT_ATAPI_DMA: |
@@ -3838,7 +3841,7 @@ int ata_qc_issue_prot(struct ata_queued_cmd *qc) | |||
3838 | 3841 | ||
3839 | /* send cdb by polling if no cdb interrupt */ | 3842 | /* send cdb by polling if no cdb interrupt */ |
3840 | if (!(qc->dev->flags & ATA_DFLAG_CDB_INTR)) | 3843 | if (!(qc->dev->flags & ATA_DFLAG_CDB_INTR)) |
3841 | queue_work(ata_wq, &ap->dataout_task); | 3844 | queue_work(ata_wq, &ap->pio_task); |
3842 | break; | 3845 | break; |
3843 | 3846 | ||
3844 | default: | 3847 | default: |
@@ -4426,7 +4429,6 @@ static void ata_host_init(struct ata_port *ap, struct Scsi_Host *host, | |||
4426 | ap->active_tag = ATA_TAG_POISON; | 4429 | ap->active_tag = ATA_TAG_POISON; |
4427 | ap->last_ctl = 0xFF; | 4430 | ap->last_ctl = 0xFF; |
4428 | 4431 | ||
4429 | INIT_WORK(&ap->dataout_task, ata_dataout_task, ap); | ||
4430 | INIT_WORK(&ap->pio_task, ata_pio_task, ap); | 4432 | INIT_WORK(&ap->pio_task, ata_pio_task, ap); |
4431 | 4433 | ||
4432 | for (i = 0; i < ATA_MAX_DEVICES; i++) | 4434 | for (i = 0; i < ATA_MAX_DEVICES; i++) |