]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/2.6.38.8/bnx2i-fixed-packet-error-created-when-the-sq_size-is.patch
drop drm patch
[thirdparty/kernel/stable-queue.git] / releases / 2.6.38.8 / bnx2i-fixed-packet-error-created-when-the-sq_size-is.patch
1 From 7287c63e986fe1a51a89f4bb1327320274a7a741 Mon Sep 17 00:00:00 2001
2 From: Eddie Wai <eddie.wai@broadcom.com>
3 Date: Mon, 16 May 2011 11:13:18 -0700
4 Subject: [SCSI] bnx2i: Fixed packet error created when the sq_size is
5 set to 16
6
7 From: Eddie Wai <eddie.wai@broadcom.com>
8
9 commit 7287c63e986fe1a51a89f4bb1327320274a7a741 upstream.
10
11 The number of chip's internal command cell, which is use to generate
12 SCSI cmd packets to the target, was not initialized correctly by
13 the driver when the sq_size is changed from the default 128.
14 This, in turn, will create a problem where the chip's transmit pipe
15 will erroneously reuse an old command cell that is no longer valid.
16 The fix is to correctly initialize the chip's command cell upon setup.
17
18 Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
19 Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
20 Signed-off-by: James Bottomley <jbottomley@parallels.com>
21 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
22
23 ---
24 drivers/scsi/bnx2i/bnx2i_hwi.c | 1 +
25 drivers/scsi/bnx2i/bnx2i_iscsi.c | 3 +++
26 2 files changed, 4 insertions(+)
27
28 --- a/drivers/scsi/bnx2i/bnx2i_hwi.c
29 +++ b/drivers/scsi/bnx2i/bnx2i_hwi.c
30 @@ -1221,6 +1221,7 @@ int bnx2i_send_fw_iscsi_init_msg(struct
31 iscsi_init.dummy_buffer_addr_hi =
32 (u32) ((u64) hba->dummy_buf_dma >> 32);
33
34 + hba->num_ccell = hba->max_sqes >> 1;
35 hba->ctx_ccell_tasks =
36 ((hba->num_ccell & 0xFFFF) | (hba->max_sqes << 16));
37 iscsi_init.num_ccells_per_conn = hba->num_ccell;
38 --- a/drivers/scsi/bnx2i/bnx2i_iscsi.c
39 +++ b/drivers/scsi/bnx2i/bnx2i_iscsi.c
40 @@ -1205,6 +1205,9 @@ static int bnx2i_task_xmit(struct iscsi_
41 struct bnx2i_cmd *cmd = task->dd_data;
42 struct iscsi_cmd *hdr = (struct iscsi_cmd *) task->hdr;
43
44 + if (bnx2i_conn->ep->num_active_cmds + 1 > hba->max_sqes)
45 + return -ENOMEM;
46 +
47 /*
48 * If there is no scsi_cmnd this must be a mgmt task
49 */