aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_target.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_target.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_target.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c
index 04f80ebf09eb..77759c78cc21 100644
--- a/drivers/scsi/qla2xxx/qla_target.c
+++ b/drivers/scsi/qla2xxx/qla_target.c
@@ -26,7 +26,6 @@
26#include <linux/module.h> 26#include <linux/module.h>
27#include <linux/init.h> 27#include <linux/init.h>
28#include <linux/types.h> 28#include <linux/types.h>
29#include <linux/version.h>
30#include <linux/blkdev.h> 29#include <linux/blkdev.h>
31#include <linux/interrupt.h> 30#include <linux/interrupt.h>
32#include <linux/pci.h> 31#include <linux/pci.h>
@@ -2477,11 +2476,9 @@ static void qlt_do_ctio_completion(struct scsi_qla_host *vha, uint32_t handle,
2477 } 2476 }
2478 2477
2479 cmd = qlt_ctio_to_cmd(vha, handle, ctio); 2478 cmd = qlt_ctio_to_cmd(vha, handle, ctio);
2480 if (cmd == NULL) { 2479 if (cmd == NULL)
2481 if (status != CTIO_SUCCESS)
2482 qlt_term_ctio_exchange(vha, ctio, NULL, status);
2483 return; 2480 return;
2484 } 2481
2485 se_cmd = &cmd->se_cmd; 2482 se_cmd = &cmd->se_cmd;
2486 tfo = se_cmd->se_tfo; 2483 tfo = se_cmd->se_tfo;
2487 2484
@@ -2727,10 +2724,12 @@ static void qlt_do_work(struct work_struct *work)
2727out_term: 2724out_term:
2728 ql_dbg(ql_dbg_tgt_mgt, vha, 0xf020, "Terminating work cmd %p", cmd); 2725 ql_dbg(ql_dbg_tgt_mgt, vha, 0xf020, "Terminating work cmd %p", cmd);
2729 /* 2726 /*
2730 * cmd has not sent to target yet, so pass NULL as the second argument 2727 * cmd has not sent to target yet, so pass NULL as the second
2728 * argument to qlt_send_term_exchange() and free the memory here.
2731 */ 2729 */
2732 spin_lock_irqsave(&ha->hardware_lock, flags); 2730 spin_lock_irqsave(&ha->hardware_lock, flags);
2733 qlt_send_term_exchange(vha, NULL, &cmd->atio, 1); 2731 qlt_send_term_exchange(vha, NULL, &cmd->atio, 1);
2732 kmem_cache_free(qla_tgt_cmd_cachep, cmd);
2734 spin_unlock_irqrestore(&ha->hardware_lock, flags); 2733 spin_unlock_irqrestore(&ha->hardware_lock, flags);
2735 if (sess) 2734 if (sess)
2736 ha->tgt.tgt_ops->put_sess(sess); 2735 ha->tgt.tgt_ops->put_sess(sess);
@@ -3961,7 +3960,7 @@ void qlt_async_event(uint16_t code, struct scsi_qla_host *vha,
3961{ 3960{
3962 struct qla_hw_data *ha = vha->hw; 3961 struct qla_hw_data *ha = vha->hw;
3963 struct qla_tgt *tgt = ha->tgt.qla_tgt; 3962 struct qla_tgt *tgt = ha->tgt.qla_tgt;
3964 int reason_code; 3963 int login_code;
3965 3964
3966 ql_dbg(ql_dbg_tgt, vha, 0xe039, 3965 ql_dbg(ql_dbg_tgt, vha, 0xe039,
3967 "scsi(%ld): ha state %d init_done %d oper_mode %d topo %d\n", 3966 "scsi(%ld): ha state %d init_done %d oper_mode %d topo %d\n",
@@ -4004,9 +4003,9 @@ void qlt_async_event(uint16_t code, struct scsi_qla_host *vha,
4004 { 4003 {
4005 ql_dbg(ql_dbg_tgt_mgt, vha, 0xf03b, 4004 ql_dbg(ql_dbg_tgt_mgt, vha, 0xf03b,
4006 "qla_target(%d): Async LOOP_UP occured " 4005 "qla_target(%d): Async LOOP_UP occured "
4007 "(m[1]=%x, m[2]=%x, m[3]=%x, m[4]=%x)", vha->vp_idx, 4006 "(m[0]=%x, m[1]=%x, m[2]=%x, m[3]=%x)", vha->vp_idx,
4008 le16_to_cpu(mailbox[1]), le16_to_cpu(mailbox[2]), 4007 le16_to_cpu(mailbox[0]), le16_to_cpu(mailbox[1]),
4009 le16_to_cpu(mailbox[3]), le16_to_cpu(mailbox[4])); 4008 le16_to_cpu(mailbox[2]), le16_to_cpu(mailbox[3]));
4010 if (tgt->link_reinit_iocb_pending) { 4009 if (tgt->link_reinit_iocb_pending) {
4011 qlt_send_notify_ack(vha, (void *)&tgt->link_reinit_iocb, 4010 qlt_send_notify_ack(vha, (void *)&tgt->link_reinit_iocb,
4012 0, 0, 0, 0, 0, 0); 4011 0, 0, 0, 0, 0, 0);
@@ -4021,23 +4020,24 @@ void qlt_async_event(uint16_t code, struct scsi_qla_host *vha,
4021 case MBA_RSCN_UPDATE: 4020 case MBA_RSCN_UPDATE:
4022 ql_dbg(ql_dbg_tgt_mgt, vha, 0xf03c, 4021 ql_dbg(ql_dbg_tgt_mgt, vha, 0xf03c,
4023 "qla_target(%d): Async event %#x occured " 4022 "qla_target(%d): Async event %#x occured "
4024 "(m[1]=%x, m[2]=%x, m[3]=%x, m[4]=%x)", vha->vp_idx, code, 4023 "(m[0]=%x, m[1]=%x, m[2]=%x, m[3]=%x)", vha->vp_idx, code,
4025 le16_to_cpu(mailbox[1]), le16_to_cpu(mailbox[2]), 4024 le16_to_cpu(mailbox[0]), le16_to_cpu(mailbox[1]),
4026 le16_to_cpu(mailbox[3]), le16_to_cpu(mailbox[4])); 4025 le16_to_cpu(mailbox[2]), le16_to_cpu(mailbox[3]));
4027 break; 4026 break;
4028 4027
4029 case MBA_PORT_UPDATE: 4028 case MBA_PORT_UPDATE:
4030 ql_dbg(ql_dbg_tgt_mgt, vha, 0xf03d, 4029 ql_dbg(ql_dbg_tgt_mgt, vha, 0xf03d,
4031 "qla_target(%d): Port update async event %#x " 4030 "qla_target(%d): Port update async event %#x "
4032 "occured: updating the ports database (m[1]=%x, m[2]=%x, " 4031 "occured: updating the ports database (m[0]=%x, m[1]=%x, "
4033 "m[3]=%x, m[4]=%x)", vha->vp_idx, code, 4032 "m[2]=%x, m[3]=%x)", vha->vp_idx, code,
4034 le16_to_cpu(mailbox[1]), le16_to_cpu(mailbox[2]), 4033 le16_to_cpu(mailbox[0]), le16_to_cpu(mailbox[1]),
4035 le16_to_cpu(mailbox[3]), le16_to_cpu(mailbox[4])); 4034 le16_to_cpu(mailbox[2]), le16_to_cpu(mailbox[3]));
4036 reason_code = le16_to_cpu(mailbox[2]); 4035
4037 if (reason_code == 0x4) 4036 login_code = le16_to_cpu(mailbox[2]);
4037 if (login_code == 0x4)
4038 ql_dbg(ql_dbg_tgt_mgt, vha, 0xf03e, 4038 ql_dbg(ql_dbg_tgt_mgt, vha, 0xf03e,
4039 "Async MB 2: Got PLOGI Complete\n"); 4039 "Async MB 2: Got PLOGI Complete\n");
4040 else if (reason_code == 0x7) 4040 else if (login_code == 0x7)
4041 ql_dbg(ql_dbg_tgt_mgt, vha, 0xf03f, 4041 ql_dbg(ql_dbg_tgt_mgt, vha, 0xf03f,
4042 "Async MB 2: Port Logged Out\n"); 4042 "Async MB 2: Port Logged Out\n");
4043 break; 4043 break;
@@ -4045,9 +4045,9 @@ void qlt_async_event(uint16_t code, struct scsi_qla_host *vha,
4045 default: 4045 default:
4046 ql_dbg(ql_dbg_tgt_mgt, vha, 0xf040, 4046 ql_dbg(ql_dbg_tgt_mgt, vha, 0xf040,
4047 "qla_target(%d): Async event %#x occured: " 4047 "qla_target(%d): Async event %#x occured: "
4048 "ignore (m[1]=%x, m[2]=%x, m[3]=%x, m[4]=%x)", vha->vp_idx, 4048 "ignore (m[0]=%x, m[1]=%x, m[2]=%x, m[3]=%x)", vha->vp_idx,
4049 code, le16_to_cpu(mailbox[1]), le16_to_cpu(mailbox[2]), 4049 code, le16_to_cpu(mailbox[0]), le16_to_cpu(mailbox[1]),
4050 le16_to_cpu(mailbox[3]), le16_to_cpu(mailbox[4])); 4050 le16_to_cpu(mailbox[2]), le16_to_cpu(mailbox[3]));
4051 break; 4051 break;
4052 } 4052 }
4053 4053