public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Vasquez <andrew.vasquez@qlogic.com>
To: James Bottomley <James.Bottomley@SteelEye.com>
Cc: linux-scsi@vger.kernel.org
Subject: [PATCH] qla2xxx - Use RIO mode 4 for ISP2100/ISP2200 operation. [3/3]
Date: Tue, 27 Jan 2004 14:35:37 -0800	[thread overview]
Message-ID: <1075242937.6050.72.camel@dieplab1> (raw)

[-- 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;

                 reply	other threads:[~2004-01-27 22:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1075242937.6050.72.camel@dieplab1 \
    --to=andrew.vasquez@qlogic.com \
    --cc=James.Bottomley@SteelEye.com \
    --cc=linux-scsi@vger.kernel.org \
    /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