Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: "Anil Veerabhadrappa" <anilgv@broadcom.com>
To: James.Bottomley@HansenPartnership.com
Cc: linux-scsi@vger.kernel.org,
	"open-iscsi@googlegroups.com" <open-iscsi@googlegroups.com>,
	michaelc@cs.wisc.edu, mchan@broadcom.com
Subject: [PATCH 1/1] BNX2I - Fix context mapping issue for architectures with PAGE_SIZE != 4096
Date: Fri, 11 Sep 2009 10:38:26 -0700	[thread overview]
Message-ID: <1252690706.27482.61.camel@anilgv-desktop> (raw)
In-Reply-To: <1245805860.9829.50.camel@anilgv-desktop>

    [BNX2I] Fix context mapping issue for architectures with PAGE_SIZE != 4096

    * 5706/5708/5709 devices allow driver/user to set page size. By default
      it is set to 4096
    * Current drivers do not program this register based on architecture type
      (e.g. x86 = 4K, IA64 = 16K) and by choice lets device use the defaults
    * So while mapping connection context memory (doorebll registers),
      driver has to match page size used by the device. Included change fixes
      the issue we uncovered during IA64 testing

Signed-off-by: Anil Veerabhadrappa <anilgv@broadcom.com>
---
 drivers/scsi/bnx2i/bnx2i.h     |    2 ++
 drivers/scsi/bnx2i/bnx2i_hwi.c |    2 +-
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/bnx2i/bnx2i.h b/drivers/scsi/bnx2i/bnx2i.h
index d7576f2..5edde1a 100644
--- a/drivers/scsi/bnx2i/bnx2i.h
+++ b/drivers/scsi/bnx2i/bnx2i.h
@@ -100,6 +100,8 @@
 #define CTX_OFFSET 			0x10000
 #define MAX_CID_CNT			0x4000
 
+#define BNX2I_570X_PAGE_SIZE_DEFAULT	4096
+
 /* 5709 context registers */
 #define BNX2_MQ_CONFIG2			0x00003d00
 #define BNX2_MQ_CONFIG2_CONT_SZ		(0x7L<<4)
diff --git a/drivers/scsi/bnx2i/bnx2i_hwi.c b/drivers/scsi/bnx2i/bnx2i_hwi.c
index 906cef5..0afde71 100644
--- a/drivers/scsi/bnx2i/bnx2i_hwi.c
+++ b/drivers/scsi/bnx2i/bnx2i_hwi.c
@@ -2386,7 +2386,7 @@ int bnx2i_map_ep_dbell_regs(struct bnx2i_endpoint *ep)
 		ctx_sz = (config2 & BNX2_MQ_CONFIG2_CONT_SZ) >> 3;
 		if (ctx_sz)
 			reg_off = CTX_OFFSET + MAX_CID_CNT * MB_KERNEL_CTX_SIZE
-				  + PAGE_SIZE *
+				  + BNX2I_570X_PAGE_SIZE_DEFAULT *
 				  (((cid_num - first_l4l5) / ctx_sz) + 256);
 		else
 			reg_off = CTX_OFFSET + (MB_KERNEL_CTX_SIZE * cid_num);
-- 
1.5.4.3





      parent reply	other threads:[~2009-09-11 17:38 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-24  1:11 [PATCH 1/3] bnx2i remove not so useful global variable bnx2i_reg_devices Anil Veerabhadrappa
2009-06-24 20:00 ` Mike Christie
2009-06-28 14:33 ` James Bottomley
2009-06-28 15:46   ` Michael Chan
2009-06-28 17:25     ` James Bottomley
2009-06-28 19:59       ` Michael Chan
2009-06-28 20:11         ` James Bottomley
2009-07-09  1:21 ` [PATCH] BNX2I: register given device with cnic if shost != NULL in ep_connect() Anil Veerabhadrappa
2009-07-09  6:21   ` Mike Christie
2009-07-09  7:15     ` Michael Chan
2009-07-09 14:39       ` Anil Veerabhadrappa
2009-07-09 17:43         ` Mike Christie
2009-07-09 20:32           ` Anil Veerabhadrappa
2009-07-09 20:49           ` Anil Veerabhadrappa
2009-07-30  4:49 ` [PATCH 1/2] bnx2i : Fix CMDSN jump issue seen during cable pull test Anil Veerabhadrappa
2009-07-30 15:31   ` Mike Christie
2009-09-11 17:38 ` Anil Veerabhadrappa [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1252690706.27482.61.camel@anilgv-desktop \
    --to=anilgv@broadcom.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mchan@broadcom.com \
    --cc=michaelc@cs.wisc.edu \
    --cc=open-iscsi@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox