From 0efcd3d65fea8b0a522e0039f17032f1db3f1459 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Fri, 3 Nov 2006 17:41:16 +0000 Subject: [PATCH] - Fixed double locking regression, introduced rev20 - Small docs update git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@27 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- qla2x00t/qla2x00-target/ChangeLog | 2 ++ qla2x00t/qla2x00-target/README | 13 ++----------- qla2x00t/qla2x00-target/ToDo | 8 +++----- qla2x00t/qla2x00-target/qla2x00t.c | 16 +++++++++------- 4 files changed, 16 insertions(+), 23 deletions(-) diff --git a/qla2x00t/qla2x00-target/ChangeLog b/qla2x00t/qla2x00-target/ChangeLog index bd20db782..fcd1d3707 100644 --- a/qla2x00t/qla2x00-target/ChangeLog +++ b/qla2x00t/qla2x00-target/ChangeLog @@ -2,6 +2,8 @@ Summary of changes between versions 0.9.3.8 and 0.9.5 ----------------------------------------------------- - Ported to 2.6.17.x and 2.6.18. + + - Problem with not found WWN on the first login attempt fixed. - Updated for the latest SCST interfaces changes. diff --git a/qla2x00t/qla2x00-target/README b/qla2x00t/qla2x00-target/README index 45a0acf62..b5ff28d78 100644 --- a/qla2x00t/qla2x00-target/README +++ b/qla2x00t/qla2x00-target/README @@ -24,14 +24,6 @@ Tested on stable kernels from http://www.kernel.org. The original initiator driver was taken from kernel version 2.6.17.8, but it should also work on other versions, including 2.6.18.x and 2.6.16.x. -NOTE: WWN-based authentification on 2200 cards doesn't always work from ----- the first "connect", but works on all subsequent attempts. - On this error message "Unable to find wwn login for loop - id XX, using loop id instead" is logged. So, just try again, eg - unload/load FC card driver on the initiator host. This is the - current limitation. Everyone who fix it or found a usable - workaround is welcome. - See also "ToDo" file for list of known issues and unimplemented features. @@ -74,9 +66,8 @@ There are the following compilation options, that could be commented in/out in Makefile: - FC_SCST_WWN_AUTH - turns on using remote initiator's WWN as - authentification name for scst_register_session_ex(). See note above - about limitations of this mode. If it is off, LOOP ID used instead of - WWN. + authentification name for scst_register_session_ex(). If it is off, + LOOP ID used instead of WWN. - DEBUG_TGT - turns on some debugging code, including some logging. Makes the driver considerably bigger and slower, producing large amount of diff --git a/qla2x00t/qla2x00-target/ToDo b/qla2x00t/qla2x00-target/ToDo index 45be8b287..94bfaebf8 100644 --- a/qla2x00t/qla2x00-target/ToDo +++ b/qla2x00t/qla2x00-target/ToDo @@ -17,13 +17,11 @@ Known issues and unimplemented features - SNS support. - - Support for sense with length > 26 (is it possible at all?) + - Support for sense with length > 26 (is it possible?) - - Queue types (simple, ordered, etc.) support (needs appropriate support - from SCST and Linux kernel) - - On 2300 if on a tape with block size 0 we write block with size X and then read it with bs state = Q2T_STATE_ABORTED; - q2t_send_term_exchange(ha, prm.cmd, &prm.cmd->atio); + q2t_send_term_exchange(ha, prm.cmd, &prm.cmd->atio, 0); /* !! At this point cmd could be already freed !! */ goto out; } @@ -880,17 +880,18 @@ out_unlock: } static void q2t_send_term_exchange(scsi_qla_host_t *ha, struct q2t_cmd *cmd, - atio_entry_t *atio) + atio_entry_t *atio, int ha_locked) { ctio_ret_entry_t *ctio; - unsigned long flags; + unsigned long flags = 0; int do_tgt_cmd_done = 0; TRACE_ENTRY(); TRACE_DBG("Sending TERM EXCH CTIO (ha=%p)", ha); - spin_lock_irqsave(&ha->hardware_lock, flags); + if (!ha_locked) + spin_lock_irqsave(&ha->hardware_lock, flags); /* Send marker if required */ if (tgt_data.issue_marker(ha) != QLA_SUCCESS) { @@ -934,7 +935,8 @@ static void q2t_send_term_exchange(scsi_qla_host_t *ha, struct q2t_cmd *cmd, q2t_exec_queue(ha); out_unlock: - spin_unlock_irqrestore(&ha->hardware_lock, flags); + if (!ha_locked) + spin_unlock_irqrestore(&ha->hardware_lock, flags); if (do_tgt_cmd_done) { msleep(250); @@ -1742,7 +1744,7 @@ static void q2t_response_pkt(scsi_qla_host_t *ha, sts_entry_t *pkt) rc = q2t_send_cmd_to_scst(ha, atio); if (unlikely(rc != 0)) { if (rc == -ESRCH) { - q2t_send_term_exchange(ha, NULL, atio); + q2t_send_term_exchange(ha, NULL, atio, 1); } else { PRINT_INFO("qla2x00tgt(%ld): Unable to " "send the command to SCSI target "