Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/ic Further fix problems with 23XX ISR handling and c...



details:   https://anonhg.NetBSD.org/src/rev/bc44e37846f0
branches:  trunk
changeset: 535381:bc44e37846f0
user:      mjacob <mjacob%NetBSD.org@localhost>
date:      Fri Aug 16 21:43:14 2002 +0000

description:
Further fix problems with 23XX ISR handling and correctly initialize the
23XX to use ZIO in preference to fast posting.

diffstat:

 sys/dev/ic/isp.c     |  55 ++++++++++++++++++++++++++++++++-------------------
 sys/dev/ic/ispmbox.h |   3 +-
 sys/dev/ic/ispvar.h  |   4 ++-
 3 files changed, 39 insertions(+), 23 deletions(-)

diffs (161 lines):

diff -r 33b7b318178c -r bc44e37846f0 sys/dev/ic/isp.c
--- a/sys/dev/ic/isp.c  Fri Aug 16 21:16:48 2002 +0000
+++ b/sys/dev/ic/isp.c  Fri Aug 16 21:43:14 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: isp.c,v 1.96 2002/08/12 21:33:39 mjacob Exp $ */
+/* $NetBSD: isp.c,v 1.97 2002/08/16 21:43:14 mjacob Exp $ */
 /*
  * This driver, which is contained in NetBSD in the files:
  *
@@ -68,7 +68,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: isp.c,v 1.96 2002/08/12 21:33:39 mjacob Exp $");
+__KERNEL_RCSID(0, "$NetBSD: isp.c,v 1.97 2002/08/16 21:43:14 mjacob Exp $");
 
 #ifdef __NetBSD__
 #include <dev/ic/isp_netbsd.h>
@@ -759,10 +759,10 @@
        if (IS_FC(isp)) {
                /*
                 * We do not believe firmware attributes for 2100 code less
-                * than 1.17.0.
+                * than 1.17.0. Note that all 22XX and 23XX f/w is greater
+                * than 1.X.0.
                 */
-               if (IS_2100(isp) && 
-                  (ISP_FW_REVX(isp->isp_fwrev) < ISP_FW_REV(1, 17, 0))) {
+               if (!(ISP_FW_NEWER_THAN(isp, 1, 17, 0))) {
                        FCPARAM(isp)->isp_fwattr = 0;
                } else {
                        FCPARAM(isp)->isp_fwattr = mbs.param[6];
@@ -1203,7 +1203,7 @@
         * because otherwise port database entries don't get updated after
         * a LIP- this is a known f/w bug for 2100 f/w less than 1.17.0.
         */
-       if (ISP_FW_REVX(isp->isp_fwrev) < ISP_FW_REV(1, 17, 0)) {
+       if (!ISP_FW_NEWER_THAN(isp, 1, 17, 0)) {
                fcp->isp_fwoptions |= ICBOPT_FULL_LOGIN;
        }
 
@@ -1275,9 +1275,17 @@
                        break;
                }
                if (IS_23XX(isp)) {
-                       if (IS_2300(isp) && isp->isp_revision < 2) {
-                               icbp->icb_fwoptions &= ~ICBOPT_FAST_POST;
-                       }
+                       /*
+                        * QLogic recommends that FAST Posting be turned
+                        * off for 23XX cards and instead allow the HBA
+                        * to write response queue entries and interrupt
+                        * after a delay (ZIO).
+                        *
+                        * If we set ZIO, it will disable fast posting,
+                        * so we don't need to clear it in fwoptions.
+                        */
+                       icbp->icb_xfwoptions |= ICBXOPT_ZIO;
+
                        if (isp->isp_confopts & ISP_CFG_ONEGB) {
                                icbp->icb_zfwoptions |= ICBZOPT_RATE_ONEGB;
                        } else if (isp->isp_confopts & ISP_CFG_TWOGB) {
@@ -1296,21 +1304,24 @@
         * More specifically, on a 2204 I had problems with RIO
         * on a Linux system where I was dropping commands right
         * and left. It's not clear to me what the actual problem
-        * was, but it seems safer to only support this on the
-        * 23XX cards.
+        * was.
         *
-        * I have it disabled if we support a target mode role for
-        * reasons I can't now remember.
+        * 23XX Cards do not support RIO. Instead they support ZIO.
         */
-       if ((isp->isp_role & ISP_ROLE_TARGET) == 0 && IS_23XX(isp)) {
+#if    0
+       if (!IS_23XX(isp) && ISP_FW_NEWER_THAN(isp, 1, 17, 0)) {
                icbp->icb_xfwoptions |= ICBXOPT_RIO_16BIT;
                icbp->icb_racctimer = 4;
                icbp->icb_idelaytimer = 8;
        }
 #endif
-
-       if ((IS_2200(isp) && ISP_FW_REVX(isp->isp_fwrev) >=
-           ISP_FW_REV(2, 1, 26)) || IS_23XX(isp)) {
+#endif
+
+       /*
+        * For 22XX > 2.1.26 && 23XX, set someoptions.
+        * XXX: Probably okay for newer 2100 f/w too.
+        */
+       if (ISP_FW_NEWER_THAN(isp, 2, 26, 0)) {
                /*
                 * Turn on LIP F8 async event (1)
                 * Turn on generate AE 8013 on all LIP Resets (2)
@@ -1357,8 +1368,9 @@
        icbp->icb_respaddr[RQRSP_ADDR1631] = DMA_WD1(isp->isp_result_dma);
        icbp->icb_respaddr[RQRSP_ADDR3247] = DMA_WD2(isp->isp_result_dma);
        icbp->icb_respaddr[RQRSP_ADDR4863] = DMA_WD3(isp->isp_result_dma);
-       isp_prt(isp, ISP_LOGDEBUG1,
-           "isp_fibre_init: fwoptions 0x%x", fcp->isp_fwoptions);
+       isp_prt(isp, ISP_LOGDEBUG0,
+           "isp_fibre_init: fwopt 0x%x xfwopt 0x%x zfwopt 0x%x",
+           icbp->icb_fwoptions, icbp->icb_xfwoptions, icbp->icb_zfwoptions);
 
        FC_SCRATCH_ACQUIRE(isp);
        isp_put_icb(isp, icbp, (isp_icb_t *)fcp->isp_scratch);
@@ -3489,7 +3501,8 @@
                } else if (isp_parse_async(isp, mbox) < 0) {
                        return;
                }
-               if (IS_FC(isp) || isp->isp_state != ISP_RUNSTATE) {
+               if ((IS_FC(isp) && mbox != ASYNC_RIO_RESP) ||
+                   isp->isp_state != ISP_RUNSTATE) {
                        ISP_WRITE(isp, HCCR, HCCR_CMD_CLEAR_RISC_INT);
                        ISP_WRITE(isp, BIU_SEMA, 0);
                        return;
@@ -4045,7 +4058,7 @@
                break;
 
        case ASYNC_RIO_RESP:
-               break;
+               return (rval);
 
        case ASYNC_CTIO_DONE:
        {
diff -r 33b7b318178c -r bc44e37846f0 sys/dev/ic/ispmbox.h
--- a/sys/dev/ic/ispmbox.h      Fri Aug 16 21:16:48 2002 +0000
+++ b/sys/dev/ic/ispmbox.h      Fri Aug 16 21:43:14 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ispmbox.h,v 1.42 2002/08/12 21:33:40 mjacob Exp $ */
+/* $NetBSD: ispmbox.h,v 1.43 2002/08/16 21:43:15 mjacob Exp $ */
 /*
  * This driver, which is contained in NetBSD in the files:
  *
@@ -679,6 +679,7 @@
 #define        ICBXOPT_RIO_32BIT       2
 #define        ICBXOPT_RIO_16BIT_IOCB  3
 #define        ICBXOPT_RIO_32BIT_IOCB  4
+#define        ICBXOPT_ZIO             5
 
 #define        ICBZOPT_ENA_RDXFR_RDY   0x01
 #define        ICBZOPT_ENA_OOF         (1 << 6) /* out of order frame handling */
diff -r 33b7b318178c -r bc44e37846f0 sys/dev/ic/ispvar.h
--- a/sys/dev/ic/ispvar.h       Fri Aug 16 21:16:48 2002 +0000
+++ b/sys/dev/ic/ispvar.h       Fri Aug 16 21:43:14 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ispvar.h,v 1.57 2002/08/12 21:33:41 mjacob Exp $ */
+/* $NetBSD: ispvar.h,v 1.58 2002/08/16 21:43:15 mjacob Exp $ */
 /*
  * This driver, which is contained in NetBSD in the files:
  *
@@ -537,6 +537,8 @@
 #define        ISP_FW_MAJORX(xp)               (xp[0])
 #define        ISP_FW_MINORX(xp)               (xp[1])
 #define        ISP_FW_MICROX(xp)               (xp[2])
+#define        ISP_FW_NEWER_THAN(i, major, minor, micro)               \
+ (ISP_FW_REVX((i)->isp_fwrev) > ISP_FW_REV(major, minor, micro))
 
 /*
  * Bus (implementation) types



Home | Main Index | Thread Index | Old Index