[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20110601080331.421910604@blue.kroah.org>
Date: Wed, 01 Jun 2011 17:00:05 +0900
From: Greg KH <gregkh@...e.de>
To: linux-kernel@...r.kernel.org, stable@...nel.org
Cc: stable-review@...nel.org, torvalds@...ux-foundation.org,
akpm@...ux-foundation.org, alan@...rguk.ukuu.org.uk,
Eddie Wai <eddie.wai@...adcom.com>,
James Bottomley <jbottomley@...allels.com>,
Greg Kroah-Hartman <gregkh@...e.de>
Subject: [069/146] [SCSI] bnx2i: Fixed packet error created when the sq_size is
2.6.38-stable review patch. If anyone has any objections, please let us know.
------------------
set to 16
From: Eddie Wai <eddie.wai@...adcom.com>
commit 7287c63e986fe1a51a89f4bb1327320274a7a741 upstream.
The number of chip's internal command cell, which is use to generate
SCSI cmd packets to the target, was not initialized correctly by
the driver when the sq_size is changed from the default 128.
This, in turn, will create a problem where the chip's transmit pipe
will erroneously reuse an old command cell that is no longer valid.
The fix is to correctly initialize the chip's command cell upon setup.
Signed-off-by: Eddie Wai <eddie.wai@...adcom.com>
Reviewed-by: Mike Christie <michaelc@...wisc.edu>
Signed-off-by: James Bottomley <jbottomley@...allels.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@...e.de>
---
drivers/scsi/bnx2i/bnx2i_hwi.c | 1 +
drivers/scsi/bnx2i/bnx2i_iscsi.c | 3 +++
2 files changed, 4 insertions(+)
--- a/drivers/scsi/bnx2i/bnx2i_hwi.c
+++ b/drivers/scsi/bnx2i/bnx2i_hwi.c
@@ -1221,6 +1221,7 @@ int bnx2i_send_fw_iscsi_init_msg(struct
iscsi_init.dummy_buffer_addr_hi =
(u32) ((u64) hba->dummy_buf_dma >> 32);
+ hba->num_ccell = hba->max_sqes >> 1;
hba->ctx_ccell_tasks =
((hba->num_ccell & 0xFFFF) | (hba->max_sqes << 16));
iscsi_init.num_ccells_per_conn = hba->num_ccell;
--- a/drivers/scsi/bnx2i/bnx2i_iscsi.c
+++ b/drivers/scsi/bnx2i/bnx2i_iscsi.c
@@ -1205,6 +1205,9 @@ static int bnx2i_task_xmit(struct iscsi_
struct bnx2i_cmd *cmd = task->dd_data;
struct iscsi_cmd *hdr = (struct iscsi_cmd *) task->hdr;
+ if (bnx2i_conn->ep->num_active_cmds + 1 > hba->max_sqes)
+ return -ENOMEM;
+
/*
* If there is no scsi_cmnd this must be a mgmt task
*/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists