aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libsas/sas_scsi_host.c
diff options
context:
space:
mode:
authorJames Bottomley <James.Bottomley@suse.de>2011-01-23 10:44:12 -0500
committerJames Bottomley <James.Bottomley@suse.de>2011-02-13 14:17:46 -0500
commitc299190b9398d4edfbf80a749875d5bac199bfdc (patch)
tree30f46808bbffe80699c97a7d3b393c4109a05cb6 /drivers/scsi/libsas/sas_scsi_host.c
parent64878c0eff5737e15b3ff06d02e7227eda4aa04c (diff)
[SCSI] libsas: convert to libata new error handler
The conversion is quite complex given that the libata new error handler has to be hooked into the current libsas timeout and error handling. The way this is done is to process all the failed commands via libsas first, but if they have no underlying sas task (and they're on a sata device) assume they are destined for the libata error handler and send them accordingly. Finally, activate the port recovery of the libata error handler for each port known to the host. This is somewhat suboptimal, since that port may not need recovering, but given the current architecture of the libata error handler, it's the only way; and the spurious activation is harmless. Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/libsas/sas_scsi_host.c')
-rw-r--r--drivers/scsi/libsas/sas_scsi_host.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/scsi/libsas/sas_scsi_host.c b/drivers/scsi/libsas/sas_scsi_host.c
index 5815cbeb27a6..2119871aed3e 100644
--- a/drivers/scsi/libsas/sas_scsi_host.c
+++ b/drivers/scsi/libsas/sas_scsi_host.c
@@ -662,11 +662,16 @@ void sas_scsi_recover_host(struct Scsi_Host *shost)
662 * scsi_unjam_host does, but we skip scsi_eh_abort_cmds because any 662 * scsi_unjam_host does, but we skip scsi_eh_abort_cmds because any
663 * command we see here has no sas_task and is thus unknown to the HA. 663 * command we see here has no sas_task and is thus unknown to the HA.
664 */ 664 */
665 if (!scsi_eh_get_sense(&eh_work_q, &ha->eh_done_q)) 665 if (!sas_ata_eh(shost, &eh_work_q, &ha->eh_done_q))
666 scsi_eh_ready_devs(shost, &eh_work_q, &ha->eh_done_q); 666 if (!scsi_eh_get_sense(&eh_work_q, &ha->eh_done_q))
667 scsi_eh_ready_devs(shost, &eh_work_q, &ha->eh_done_q);
667 668
668out: 669out:
670 /* now link into libata eh --- if we have any ata devices */
671 sas_ata_strategy_handler(shost);
672
669 scsi_eh_flush_done_q(&ha->eh_done_q); 673 scsi_eh_flush_done_q(&ha->eh_done_q);
674
670 SAS_DPRINTK("--- Exit %s\n", __func__); 675 SAS_DPRINTK("--- Exit %s\n", __func__);
671 return; 676 return;
672} 677}
@@ -675,6 +680,11 @@ enum blk_eh_timer_return sas_scsi_timed_out(struct scsi_cmnd *cmd)
675{ 680{
676 struct sas_task *task = TO_SAS_TASK(cmd); 681 struct sas_task *task = TO_SAS_TASK(cmd);
677 unsigned long flags; 682 unsigned long flags;
683 enum blk_eh_timer_return rtn;
684
685 if (sas_ata_timed_out(cmd, task, &rtn))
686 return rtn;
687
678 688
679 if (!task) { 689 if (!task) {
680 cmd->request->timeout /= 2; 690 cmd->request->timeout /= 2;