[SCSI] bnx2i: use common iscsi suspend queue
authorMike Christie <michaelc@cs.wisc.edu>
Wed, 11 Nov 2009 22:34:30 +0000 (16:34 -0600)
committerJames Bottomley <James.Bottomley@suse.de>
Fri, 4 Dec 2009 18:01:35 +0000 (12:01 -0600)
This just has bnx2i use the iscsi_suspend_queue helper.

The suspend works as follows:

When ep_poll has succeeed iscsid will call conn_bind, the LLD will
then call iscsi_conn_bind which will clear the suspend bit.
When ep_disconnect is called (or if there is a conn error) we set
the suspend bit. For the ep_disconnect case I  added a helper
in the previous kernel that will take the session lock to make sure
iscsi_queuecommand/xmit_task is not running and it will set
the suspend bit.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Acked-by: Anil Veerabhadrappa <anilgv@broadcom.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
drivers/scsi/bnx2i/bnx2i.h
drivers/scsi/bnx2i/bnx2i_iscsi.c

index 5edde1a8c04df5f991b252d99602d2687175cd73..2b973f3c2eb2a7da1e0166c4713947c05d480283 100644 (file)
@@ -232,7 +232,6 @@ struct bnx2i_conn {
        struct iscsi_cls_conn *cls_conn;
        struct bnx2i_hba *hba;
        struct completion cmd_cleanup_cmpl;
-       int is_bound;
 
        u32 iscsi_conn_cid;
 #define BNX2I_CID_RESERVED     0x5AFF
index cafb888c237625c55aa4e35d848b8f5d23eaf194..89e84c302aa04168768d65d9a1d6448a9ec4b029 100644 (file)
@@ -1161,9 +1161,6 @@ static int bnx2i_task_xmit(struct iscsi_task *task)
        struct bnx2i_cmd *cmd = task->dd_data;
        struct iscsi_cmd *hdr = (struct iscsi_cmd *) task->hdr;
 
-       if (!bnx2i_conn->is_bound)
-               return -ENOTCONN;
-
        /*
         * If there is no scsi_cmnd this must be a mgmt task
         */
@@ -1371,7 +1368,6 @@ static int bnx2i_conn_bind(struct iscsi_cls_session *cls_session,
        bnx2i_conn->ep = bnx2i_ep;
        bnx2i_conn->iscsi_conn_cid = bnx2i_ep->ep_iscsi_cid;
        bnx2i_conn->fw_cid = bnx2i_ep->ep_cid;
-       bnx2i_conn->is_bound = 1;
 
        ret_code = bnx2i_bind_conn_to_iscsi_cid(hba, bnx2i_conn,
                                                bnx2i_ep->ep_iscsi_cid);
@@ -1896,9 +1892,7 @@ static void bnx2i_ep_disconnect(struct iscsi_endpoint *ep)
                conn = bnx2i_conn->cls_conn->dd_data;
                session = conn->session;
 
-               spin_lock_bh(&session->lock);
-               bnx2i_conn->is_bound = 0;
-               spin_unlock_bh(&session->lock);
+               iscsi_suspend_queue(conn);
        }
 
        hba = bnx2i_ep->hba;