aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_os.c
diff options
context:
space:
mode:
authorSeokmann Ju <seokmann.ju@qlogic.com>2008-07-10 19:55:47 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-07-26 15:14:36 -0400
commit5f3a9a207f1fccde476dd31b4c63ead2967d934f (patch)
tree2b7baa09df49b681dcb32391d120117ffd711286 /drivers/scsi/qla2xxx/qla_os.c
parentbbfb21daa320c9eb327d63734f295fa50ba93826 (diff)
[SCSI] qla2xxx: Add dev_loss_tmo_callbk/terminate_rport_io callback support.
Signed-off-by: Seokmann Ju <seokmann.ju@qlogic.com> Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_os.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_os.c53
1 files changed, 40 insertions, 13 deletions
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 48eaa3bb5433..c5ad858e17e6 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -388,7 +388,7 @@ qla2x00_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
388 } 388 }
389 389
390 /* Close window on fcport/rport state-transitioning. */ 390 /* Close window on fcport/rport state-transitioning. */
391 if (!*(fc_port_t **)rport->dd_data) { 391 if (fcport->drport) {
392 cmd->result = DID_IMM_RETRY << 16; 392 cmd->result = DID_IMM_RETRY << 16;
393 goto qc_fail_command; 393 goto qc_fail_command;
394 } 394 }
@@ -455,7 +455,7 @@ qla24xx_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
455 } 455 }
456 456
457 /* Close window on fcport/rport state-transitioning. */ 457 /* Close window on fcport/rport state-transitioning. */
458 if (!*(fc_port_t **)rport->dd_data) { 458 if (fcport->drport) {
459 cmd->result = DID_IMM_RETRY << 16; 459 cmd->result = DID_IMM_RETRY << 16;
460 goto qc24_fail_command; 460 goto qc24_fail_command;
461 } 461 }
@@ -617,6 +617,40 @@ qla2x00_wait_for_loop_ready(scsi_qla_host_t *ha)
617 return (return_status); 617 return (return_status);
618} 618}
619 619
620void
621qla2x00_abort_fcport_cmds(fc_port_t *fcport)
622{
623 int cnt;
624 unsigned long flags;
625 srb_t *sp;
626 scsi_qla_host_t *ha = fcport->ha;
627 scsi_qla_host_t *pha = to_qla_parent(ha);
628
629 spin_lock_irqsave(&pha->hardware_lock, flags);
630 for (cnt = 1; cnt < MAX_OUTSTANDING_COMMANDS; cnt++) {
631 sp = pha->outstanding_cmds[cnt];
632 if (!sp)
633 continue;
634 if (sp->fcport != fcport)
635 continue;
636
637 spin_unlock_irqrestore(&pha->hardware_lock, flags);
638 if (ha->isp_ops->abort_command(ha, sp)) {
639 DEBUG2(qla_printk(KERN_WARNING, ha,
640 "Abort failed -- %lx\n", sp->cmd->serial_number));
641 } else {
642 if (qla2x00_eh_wait_on_command(ha, sp->cmd) !=
643 QLA_SUCCESS)
644 DEBUG2(qla_printk(KERN_WARNING, ha,
645 "Abort failed while waiting -- %lx\n",
646 sp->cmd->serial_number));
647
648 }
649 spin_lock_irqsave(&pha->hardware_lock, flags);
650 }
651 spin_unlock_irqrestore(&pha->hardware_lock, flags);
652}
653
620static void 654static void
621qla2x00_block_error_handler(struct scsi_cmnd *cmnd) 655qla2x00_block_error_handler(struct scsi_cmnd *cmnd)
622{ 656{
@@ -1813,7 +1847,6 @@ static inline void
1813qla2x00_schedule_rport_del(struct scsi_qla_host *ha, fc_port_t *fcport, 1847qla2x00_schedule_rport_del(struct scsi_qla_host *ha, fc_port_t *fcport,
1814 int defer) 1848 int defer)
1815{ 1849{
1816 unsigned long flags;
1817 struct fc_rport *rport; 1850 struct fc_rport *rport;
1818 1851
1819 if (!fcport->rport) 1852 if (!fcport->rport)
@@ -1821,19 +1854,13 @@ qla2x00_schedule_rport_del(struct scsi_qla_host *ha, fc_port_t *fcport,
1821 1854
1822 rport = fcport->rport; 1855 rport = fcport->rport;
1823 if (defer) { 1856 if (defer) {
1824 spin_lock_irqsave(&fcport->rport_lock, flags); 1857 spin_lock_irq(ha->host->host_lock);
1825 fcport->drport = rport; 1858 fcport->drport = rport;
1826 fcport->rport = NULL; 1859 spin_unlock_irq(ha->host->host_lock);
1827 *(fc_port_t **)rport->dd_data = NULL;
1828 spin_unlock_irqrestore(&fcport->rport_lock, flags);
1829 set_bit(FCPORT_UPDATE_NEEDED, &ha->dpc_flags); 1860 set_bit(FCPORT_UPDATE_NEEDED, &ha->dpc_flags);
1830 } else { 1861 qla2xxx_wake_dpc(ha);
1831 spin_lock_irqsave(&fcport->rport_lock, flags); 1862 } else
1832 fcport->rport = NULL;
1833 *(fc_port_t **)rport->dd_data = NULL;
1834 spin_unlock_irqrestore(&fcport->rport_lock, flags);
1835 fc_remote_port_delete(rport); 1863 fc_remote_port_delete(rport);
1836 }
1837} 1864}
1838 1865
1839/* 1866/*