aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libata-core.c
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2006-04-02 05:51:53 -0400
committerJeff Garzik <jeff@garzik.org>2006-04-02 10:09:21 -0400
commitece1d63619df010b8c4f08e43755e2a03f3b6eed (patch)
treec6474fe7541d479bf19c36c79700dfa9f6093a8d /drivers/scsi/libata-core.c
parent35e86b53b1a38e78ff0d70dae4aeb25f4572e433 (diff)
[PATCH] libata: separate out libata-eh.c
A lot of EH codes are about to be added to libata. Separate out libata-eh.c. ata_scsi_timed_out(), ata_scsi_error(), ata_qc_timeout(), ata_eng_timeout(), ata_eh_qc_complete() and ata_eh_qc_retry() are moved. No code is changed by this patch. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/scsi/libata-core.c')
-rw-r--r--drivers/scsi/libata-core.c102
1 files changed, 5 insertions, 97 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index 66b48b11fa0e..186a9ce4f072 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -4016,99 +4016,6 @@ err_out:
4016} 4016}
4017 4017
4018/** 4018/**
4019 * ata_qc_timeout - Handle timeout of queued command
4020 * @qc: Command that timed out
4021 *
4022 * Some part of the kernel (currently, only the SCSI layer)
4023 * has noticed that the active command on port @ap has not
4024 * completed after a specified length of time. Handle this
4025 * condition by disabling DMA (if necessary) and completing
4026 * transactions, with error if necessary.
4027 *
4028 * This also handles the case of the "lost interrupt", where
4029 * for some reason (possibly hardware bug, possibly driver bug)
4030 * an interrupt was not delivered to the driver, even though the
4031 * transaction completed successfully.
4032 *
4033 * LOCKING:
4034 * Inherited from SCSI layer (none, can sleep)
4035 */
4036
4037static void ata_qc_timeout(struct ata_queued_cmd *qc)
4038{
4039 struct ata_port *ap = qc->ap;
4040 struct ata_host_set *host_set = ap->host_set;
4041 u8 host_stat = 0, drv_stat;
4042 unsigned long flags;
4043
4044 DPRINTK("ENTER\n");
4045
4046 ap->hsm_task_state = HSM_ST_IDLE;
4047
4048 spin_lock_irqsave(&host_set->lock, flags);
4049
4050 switch (qc->tf.protocol) {
4051
4052 case ATA_PROT_DMA:
4053 case ATA_PROT_ATAPI_DMA:
4054 host_stat = ap->ops->bmdma_status(ap);
4055
4056 /* before we do anything else, clear DMA-Start bit */
4057 ap->ops->bmdma_stop(qc);
4058
4059 /* fall through */
4060
4061 default:
4062 ata_altstatus(ap);
4063 drv_stat = ata_chk_status(ap);
4064
4065 /* ack bmdma irq events */
4066 ap->ops->irq_clear(ap);
4067
4068 printk(KERN_ERR "ata%u: command 0x%x timeout, stat 0x%x host_stat 0x%x\n",
4069 ap->id, qc->tf.command, drv_stat, host_stat);
4070
4071 /* complete taskfile transaction */
4072 qc->err_mask |= ac_err_mask(drv_stat);
4073 break;
4074 }
4075
4076 spin_unlock_irqrestore(&host_set->lock, flags);
4077
4078 ata_eh_qc_complete(qc);
4079
4080 DPRINTK("EXIT\n");
4081}
4082
4083/**
4084 * ata_eng_timeout - Handle timeout of queued command
4085 * @ap: Port on which timed-out command is active
4086 *
4087 * Some part of the kernel (currently, only the SCSI layer)
4088 * has noticed that the active command on port @ap has not
4089 * completed after a specified length of time. Handle this
4090 * condition by disabling DMA (if necessary) and completing
4091 * transactions, with error if necessary.
4092 *
4093 * This also handles the case of the "lost interrupt", where
4094 * for some reason (possibly hardware bug, possibly driver bug)
4095 * an interrupt was not delivered to the driver, even though the
4096 * transaction completed successfully.
4097 *
4098 * LOCKING:
4099 * Inherited from SCSI layer (none, can sleep)
4100 */
4101
4102void ata_eng_timeout(struct ata_port *ap)
4103{
4104 DPRINTK("ENTER\n");
4105
4106 ata_qc_timeout(ata_qc_from_tag(ap, ap->active_tag));
4107
4108 DPRINTK("EXIT\n");
4109}
4110
4111/**
4112 * ata_qc_new - Request an available ATA command, for queueing 4019 * ata_qc_new - Request an available ATA command, for queueing
4113 * @ap: Port associated with device @dev 4020 * @ap: Port associated with device @dev
4114 * @dev: Device from whom we request an available command structure 4021 * @dev: Device from whom we request an available command structure
@@ -5145,7 +5052,6 @@ EXPORT_SYMBOL_GPL(ata_sg_init);
5145EXPORT_SYMBOL_GPL(ata_sg_init_one); 5052EXPORT_SYMBOL_GPL(ata_sg_init_one);
5146EXPORT_SYMBOL_GPL(__ata_qc_complete); 5053EXPORT_SYMBOL_GPL(__ata_qc_complete);
5147EXPORT_SYMBOL_GPL(ata_qc_issue_prot); 5054EXPORT_SYMBOL_GPL(ata_qc_issue_prot);
5148EXPORT_SYMBOL_GPL(ata_eng_timeout);
5149EXPORT_SYMBOL_GPL(ata_tf_load); 5055EXPORT_SYMBOL_GPL(ata_tf_load);
5150EXPORT_SYMBOL_GPL(ata_tf_read); 5056EXPORT_SYMBOL_GPL(ata_tf_read);
5151EXPORT_SYMBOL_GPL(ata_noop_dev_select); 5057EXPORT_SYMBOL_GPL(ata_noop_dev_select);
@@ -5185,15 +5091,12 @@ EXPORT_SYMBOL_GPL(ata_busy_sleep);
5185EXPORT_SYMBOL_GPL(ata_port_queue_task); 5091EXPORT_SYMBOL_GPL(ata_port_queue_task);
5186EXPORT_SYMBOL_GPL(ata_scsi_ioctl); 5092EXPORT_SYMBOL_GPL(ata_scsi_ioctl);
5187EXPORT_SYMBOL_GPL(ata_scsi_queuecmd); 5093EXPORT_SYMBOL_GPL(ata_scsi_queuecmd);
5188EXPORT_SYMBOL_GPL(ata_scsi_error);
5189EXPORT_SYMBOL_GPL(ata_scsi_slave_config); 5094EXPORT_SYMBOL_GPL(ata_scsi_slave_config);
5190EXPORT_SYMBOL_GPL(ata_scsi_release); 5095EXPORT_SYMBOL_GPL(ata_scsi_release);
5191EXPORT_SYMBOL_GPL(ata_host_intr); 5096EXPORT_SYMBOL_GPL(ata_host_intr);
5192EXPORT_SYMBOL_GPL(ata_id_string); 5097EXPORT_SYMBOL_GPL(ata_id_string);
5193EXPORT_SYMBOL_GPL(ata_id_c_string); 5098EXPORT_SYMBOL_GPL(ata_id_c_string);
5194EXPORT_SYMBOL_GPL(ata_scsi_simulate); 5099EXPORT_SYMBOL_GPL(ata_scsi_simulate);
5195EXPORT_SYMBOL_GPL(ata_eh_qc_complete);
5196EXPORT_SYMBOL_GPL(ata_eh_qc_retry);
5197 5100
5198EXPORT_SYMBOL_GPL(ata_pio_need_iordy); 5101EXPORT_SYMBOL_GPL(ata_pio_need_iordy);
5199EXPORT_SYMBOL_GPL(ata_timing_compute); 5102EXPORT_SYMBOL_GPL(ata_timing_compute);
@@ -5215,3 +5118,8 @@ EXPORT_SYMBOL_GPL(ata_device_suspend);
5215EXPORT_SYMBOL_GPL(ata_device_resume); 5118EXPORT_SYMBOL_GPL(ata_device_resume);
5216EXPORT_SYMBOL_GPL(ata_scsi_device_suspend); 5119EXPORT_SYMBOL_GPL(ata_scsi_device_suspend);
5217EXPORT_SYMBOL_GPL(ata_scsi_device_resume); 5120EXPORT_SYMBOL_GPL(ata_scsi_device_resume);
5121
5122EXPORT_SYMBOL_GPL(ata_scsi_error);
5123EXPORT_SYMBOL_GPL(ata_eng_timeout);
5124EXPORT_SYMBOL_GPL(ata_eh_qc_complete);
5125EXPORT_SYMBOL_GPL(ata_eh_qc_retry);