From f2061b9eab29d9b396f0089703da896162fc5233 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Thu, 2 Apr 2009 19:27:39 +0000 Subject: [PATCH] Fixes failure of enabling target mode, if do it too fast. Based on work by sdrb git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@739 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- qla2x00t/qla_attr.c | 8 ++------ qla2x00t/qla_init.c | 4 ++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/qla2x00t/qla_attr.c b/qla2x00t/qla_attr.c index 0d987947a..456868b2a 100644 --- a/qla2x00t/qla_attr.c +++ b/qla2x00t/qla_attr.c @@ -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", diff --git a/qla2x00t/qla_init.c b/qla2x00t/qla_init.c index 439213ba9..9634a393a 100644 --- a/qla2x00t/qla_init.c +++ b/qla2x00t/qla_init.c @@ -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); } /*