]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[SCSI] bnx2i: Fix context mapping issue for architectures with PAGE_SIZE != 4096
authorAnil Veerabhadrappa <anilgv@broadcom.com>
Fri, 11 Sep 2009 17:38:26 +0000 (10:38 -0700)
committerJames Bottomley <James.Bottomley@suse.de>
Fri, 2 Oct 2009 14:45:34 +0000 (09:45 -0500)
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>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
drivers/scsi/bnx2i/bnx2i.h
drivers/scsi/bnx2i/bnx2i_hwi.c

index d7576f28c6e9b55f40420daba80b0c3999aa3667..5edde1a8c04df5f991b252d99602d2687175cd73 100644 (file)
 #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)
index 41e1b0e7e2ef30403909c226c21f6365afa73c1c..5c8d7630c13e4c0a403aeacc4cf1533ef40579c0 100644 (file)
@@ -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);