From owner-p4-projects@FreeBSD.ORG Wed Oct 18 20:30:20 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9C58A16A4D8; Wed, 18 Oct 2006 20:30:20 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4477C16A4C2 for ; Wed, 18 Oct 2006 20:30:20 +0000 (UTC) (envelope-from mjacob@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3535C43D6A for ; Wed, 18 Oct 2006 20:30:13 +0000 (GMT) (envelope-from mjacob@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k9IKUDxv000545 for ; Wed, 18 Oct 2006 20:30:13 GMT (envelope-from mjacob@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k9IKUC9N000542 for perforce@freebsd.org; Wed, 18 Oct 2006 20:30:12 GMT (envelope-from mjacob@freebsd.org) Date: Wed, 18 Oct 2006 20:30:12 GMT Message-Id: <200610182030.k9IKUC9N000542@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to mjacob@freebsd.org using -f From: Matt Jacob To: Perforce Change Reviews Cc: Subject: PERFORCE change 108066 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Oct 2006 20:30:20 -0000 http://perforce.freebsd.org/chv.cgi?CH=108066 Change 108066 by mjacob@newisp on 2006/10/18 20:29:41 ISR reads should have the semaphore and mailbox pointers as pointers to 16 bit quantities- not 32 bit quantities. Put in PTISP stuff again, but conditionalized on a tag set in sdparam by the outerlayer. *Don't* call isp_intr from isp_start except for ZIO capable cards (23XX/24XX). When getting interrupted when not ready, only disable ints for the 24XX. This needs a better solution, really. Make isp_parse_status/isp_parse_status_24xx take a pointer to a residual so we can do things like setting the residual to the xfer count for things like selection timeout instead of getting some completely bogus value from the status IOCB. Affected files ... .. //depot/projects/newisp/dev/isp/isp.c#17 edit Differences ... ==== //depot/projects/newisp/dev/isp/isp.c#17 (text+ko) ==== @@ -100,9 +100,9 @@ static int isp_handle_other_response(ispsoftc_t *, int, isphdr_t *, uint32_t *); static void -isp_parse_status(ispsoftc_t *, ispstatusreq_t *, XS_T *); +isp_parse_status(ispsoftc_t *, ispstatusreq_t *, XS_T *, long *); static void -isp_parse_status_24xx(ispsoftc_t *, isp24xx_statusreq_t *, XS_T *); +isp_parse_status_24xx(ispsoftc_t *, isp24xx_statusreq_t *, XS_T *, long *); static void isp_fastpost_complete(ispsoftc_t *, uint16_t); static int isp_mbox_continue(ispsoftc_t *); static void isp_scsi_init(ispsoftc_t *); @@ -638,7 +638,22 @@ ISP_SETBITS(isp, CDMA_CONF, DMA_ENABLE_BURST); ISP_SETBITS(isp, DDMA_CONF, DMA_ENABLE_BURST); } - ISP_WRITE(isp, RISC_MTR, 0x1212); + if (SDPARAM(isp)->isp_ptisp) { + if (SDPARAM(isp)->isp_ultramode) { + while (ISP_READ(isp, RISC_MTR) != 0x1313) { + ISP_WRITE(isp, RISC_MTR, 0x1313); + ISP_WRITE(isp, HCCR, HCCR_CMD_STEP); + } + } else { + ISP_WRITE(isp, RISC_MTR, 0x1212); + } + /* + * PTI specific register + */ + ISP_WRITE(isp, RISC_EMB, DUAL_BANK); + } else { + ISP_WRITE(isp, RISC_MTR, 0x1212); + } ISP_WRITE(isp, HCCR, HCCR_CMD_RELEASE); } else { ISP_WRITE(isp, RISC_MTR2100, 0x1212); @@ -3869,7 +3884,8 @@ isp_start(XS_T *xs) { ispsoftc_t *isp; - uint32_t nxti, optr, handle, isr, sema, mbox; + uint32_t nxti, optr, handle, isr; + uint16_t sema, mbox; uint8_t local[QENTRY_LEN]; ispreq_t *reqp, *qep; void *cdbp; @@ -3981,6 +3997,7 @@ MEMZERO(m, QENTRY_LEN); m->mrk_header.rqs_entry_count = 1; m->mrk_header.rqs_entry_type = RQSTYPE_MARKER; + m->mrk_target = (i << 7); /* bus # */ m->mrk_modifier = SYNC_ALL; isp_put_marker(isp, m, (isp_marker_t *) qep); ISP_ADD_REQUEST(isp, nxti); @@ -4125,8 +4142,10 @@ (long) XS_XFRLEN(xs)); ISP_ADD_REQUEST(isp, nxti); isp->isp_nactive++; - if (ISP_READ_ISR(isp, &isr, &sema, &mbox)) { - isp_intr(isp, isr, sema, mbox); + if (IS_23XX(isp) || IS_24XX(isp)) { + if (ISP_READ_ISR(isp, &isr, &sema, &mbox)) { + isp_intr(isp, isr, sema, mbox); + } } return (CMD_QUEUED); } @@ -4157,8 +4176,7 @@ */ mbs.param[0] = MBOX_BUS_RESET; if (IS_SCSI(isp)) { - mbs.param[1] = - ((sdparam *) isp->isp_param)->isp_bus_reset_delay; + mbs.param[1] = SDPARAM(isp)->isp_bus_reset_delay; if (mbs.param[1] < 2) { mbs.param[1] = 2; } @@ -4345,7 +4363,7 @@ #endif void -isp_intr(ispsoftc_t *isp, uint32_t isr, uint32_t sema, uint16_t mbox) +isp_intr(ispsoftc_t *isp, uint32_t isr, uint16_t sema, uint16_t mbox) { XS_T *complist[MAX_REQUESTQ_COMPLETIONS], *xs; uint32_t iptr, optr, junk; @@ -4402,7 +4420,9 @@ */ ISP_WRITE(isp, isp->isp_respoutrp, ISP_READ(isp, isp->isp_respinrp)); - ISP_DISABLE_INTS(isp); + if (IS_24XX(isp)) { + ISP_DISABLE_INTS(isp); + } goto out; } @@ -4718,9 +4738,9 @@ XS_SET_STATE_STAT(isp, xs, sp); if (IS_24XX(isp)) { isp_parse_status_24xx(isp, - (isp24xx_statusreq_t *)sp, xs); + (isp24xx_statusreq_t *)sp, xs, &resid); } else { - isp_parse_status(isp, (void *)sp, xs); + isp_parse_status(isp, (void *)sp, xs, &resid); } if ((XS_NOERR(xs) || XS_ERR(xs) == HBA_NOERROR) && (*XS_STSP(xs) == SCSI_BUSY)) { @@ -5318,7 +5338,7 @@ } static void -isp_parse_status(ispsoftc_t *isp, ispstatusreq_t *sp, XS_T *xs) +isp_parse_status(ispsoftc_t *isp, ispstatusreq_t *sp, XS_T *xs, long *rp) { switch (sp->req_completion_status & 0xff) { case RQCS_COMPLETE: @@ -5334,6 +5354,7 @@ XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs)); if (XS_NOERR(xs)) { XS_SETERR(xs, HBA_SELTIMEOUT); + *rp = XS_XFRLEN(xs); } return; } @@ -5346,6 +5367,7 @@ case RQCS_DMA_ERROR: isp_prt(isp, ISP_LOGERR, "DMA error for command on %d.%d.%d", XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs)); + *rp = XS_XFRLEN(xs); break; case RQCS_TRANSPORT_ERROR: @@ -5401,6 +5423,7 @@ isp_prt(isp, ISP_LOGERR, "%s", buf); isp_prt(isp, ISP_LOGERR, "transport error for %d.%d.%d:\n%s", XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs), buf); + *rp = XS_XFRLEN(xs); break; } case RQCS_RESET_OCCURRED: @@ -5411,6 +5434,7 @@ if (XS_NOERR(xs)) { XS_SETERR(xs, HBA_BUSRESET); } + *rp = XS_XFRLEN(xs); return; case RQCS_ABORTED: @@ -5705,7 +5729,8 @@ } static void -isp_parse_status_24xx(ispsoftc_t *isp, isp24xx_statusreq_t *sp, XS_T *xs) +isp_parse_status_24xx(ispsoftc_t *isp, isp24xx_statusreq_t *sp, + XS_T *xs, long *rp) { switch (sp->req_completion_status) { case RQCS_COMPLETE: @@ -5766,6 +5791,7 @@ if (XS_NOERR(xs)) { XS_SETERR(xs, HBA_ABORTED); } + *rp = XS_XFRLEN(xs); return; case RQCS_24XX_TABORT: /* aborted by target */