public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] qla2xxx - Use RIO mode 4 for ISP2100/ISP2200 operation. [3/3]
@ 2004-01-27 22:35 Andrew Vasquez
  0 siblings, 0 replies; only message in thread
From: Andrew Vasquez @ 2004-01-27 22:35 UTC (permalink / raw)
  To: James Bottomley; +Cc: linux-scsi

[-- Attachment #1: Type: text/plain, Size: 484 bytes --]

James,

RIO mode 3 (originally used in the qla2xxx driver) will not work on
big-endian platforms due to the firmware returning only the first-word
of the dword command handle returned after SCSI completion.  Use RIO
mode 4 since full 32bit handle is returned during status.

I've recently added an IBM p630 machine (ppc64) to my test ring with a
mix of 2200 and 2300 cards -- I feel fairly confident that most endian
type issues are addressed.

Please apply.

Regards,
Andrew Vasquez

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: QL5_RIO_fixes_bigendian_3-v262rc1mm3.diff --]
[-- Type: text/x-patch; name=QL5_RIO_fixes_bigendian_3-v262rc1mm3.diff; charset=, Size: 1985 bytes --]

diff -Nurd -X /root/praka/dontdiff linux-2.6/drivers/scsi/qla2xxx-2200/qla_init.c linux-2.6/drivers/scsi/qla2xxx/qla_init.c
--- linux-2.6/drivers/scsi/qla2xxx-2200/qla_init.c	2004-01-27 13:45:42.000000000 -0800
+++ linux-2.6/drivers/scsi/qla2xxx/qla_init.c	2004-01-27 13:46:19.000000000 -0800
@@ -1414,7 +1414,7 @@
 		icb->firmware_options[0] &= ~BIT_3;
 		icb->add_firmware_options[0] &=
 		    ~(BIT_3 | BIT_2 | BIT_1 | BIT_0);
-		icb->add_firmware_options[0] |= (BIT_1 | BIT_0);
+		icb->add_firmware_options[0] |= BIT_2;
 		icb->response_accumulation_timer = 3;
 		icb->interrupt_delay_timer = 5;
 
diff -Nurd -X /root/praka/dontdiff linux-2.6/drivers/scsi/qla2xxx-2200/qla_isr.c linux-2.6/drivers/scsi/qla2xxx/qla_isr.c
--- linux-2.6/drivers/scsi/qla2xxx-2200/qla_isr.c	2004-01-27 13:45:42.000000000 -0800
+++ linux-2.6/drivers/scsi/qla2xxx/qla_isr.c	2004-01-27 13:46:19.000000000 -0800
@@ -289,10 +289,13 @@
 	switch (mb[0]) {
 	case MBA_SCSI_COMPLETION:
 		if (IS_QLA2100(ha) || IS_QLA2200(ha))
-			handles[0] = RD_MAILBOX_REG(ha, reg, 1);
+			handles[0] = le32_to_cpu(
+			    ((uint32_t)(RD_MAILBOX_REG(ha, reg, 2) << 16)) |
+			    RD_MAILBOX_REG(ha, reg, 1));
 		else
-			handles[0] = MSW(mbx);
-		handles[0] |= (uint32_t)(RD_MAILBOX_REG(ha, reg, 2) << 16);
+			handles[0] = le32_to_cpu(
+			    ((uint32_t)(RD_MAILBOX_REG(ha, reg, 2) << 16)) |
+			    MSW(mbx));
 		handle_cnt = 1;
 		break;
 	case MBA_CMPLT_1_16BIT:
@@ -334,9 +337,11 @@
 		mb[0] = MBA_SCSI_COMPLETION;
 		break;
 	case MBA_CMPLT_2_32BIT:
-		handles[0] = (uint32_t)((RD_MAILBOX_REG(ha, reg, 2) << 16) |
+		handles[0] = le32_to_cpu(
+		    ((uint32_t)(RD_MAILBOX_REG(ha, reg, 2) << 16)) |
 		    RD_MAILBOX_REG(ha, reg, 1));
-		handles[1] = (uint32_t)((RD_MAILBOX_REG(ha, reg, 7) << 16) |
+		handles[1] = le32_to_cpu(
+		    ((uint32_t)(RD_MAILBOX_REG(ha, reg, 7) << 16)) |
 		    RD_MAILBOX_REG(ha, reg, 6));
 		handle_cnt = 2;
 		mb[0] = MBA_SCSI_COMPLETION;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-01-27 22:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-27 22:35 [PATCH] qla2xxx - Use RIO mode 4 for ISP2100/ISP2200 operation. [3/3] Andrew Vasquez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox