Fixes failure of enabling target mode, if do it too fast. Based on work by sdrb ...
authorvlnb <vlnb@d57e44dd-8a1f-0410-8b47-8ef2f437770f>
Thu, 2 Apr 2009 19:27:39 +0000 (19:27 +0000)
committervlnb <vlnb@d57e44dd-8a1f-0410-8b47-8ef2f437770f>
Thu, 2 Apr 2009 19:27:39 +0000 (19:27 +0000)
git-svn-id: https://scst.svn.sourceforge.net/svnroot/scst/trunk@739 d57e44dd-8a1f-0410-8b47-8ef2f437770f

qla2x00t/qla_attr.c
qla2x00t/qla_init.c

index 0d98794..456868b 100644 (file)
@@ -59,16 +59,12 @@ qla2x00_store_tgt_enabled(struct device *dev, struct device_attribute *attr,
 
        switch (buf[0]) {
        case '0' :
-               if ((ha->flags.enable_target_mode) || force) {
+               if ((ha->flags.enable_target_mode) || force)
                        qla_target.tgt_host_action(ha, DISABLE_TARGET_MODE);
-                       msleep_interruptible(10*1000);
-               }
                break;
        case '1' :
-               if ((ha->flags.enable_target_mode == 0) || force) {
+               if ((ha->flags.enable_target_mode == 0) || force)
                        qla_target.tgt_host_action(ha, ENABLE_TARGET_MODE);
-                       msleep_interruptible(10*1000);
-               }
                break;
        default:
                printk(KERN_INFO "%s: Requested action not understood: %s\n",
index 439213b..9634a39 100644 (file)
@@ -4150,6 +4150,8 @@ __qla2x00_enable_lun(scsi_qla_host_t *ha)
        spin_unlock_irqrestore(&ha->hardware_lock, flags);
 
        set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags);
+       qla2xxx_wake_dpc(ha); 
+       qla2x00_wait_for_hba_online(ha);
 }
 
 /*
@@ -4167,6 +4169,8 @@ __qla2x00_disable_lun(scsi_qla_host_t *ha)
        spin_unlock_irqrestore(&ha->hardware_lock, flags);
 
        set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags);
+       qla2xxx_wake_dpc(ha); 
+       qla2x00_wait_for_hba_online(ha);
 }
 
 /*