From owner-svn-src-stable-9@FreeBSD.ORG Sun Sep 2 15:05:40 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C8B71065678; Sun, 2 Sep 2012 15:05:40 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3E10E8FC1D; Sun, 2 Sep 2012 15:05:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q82F5egj022379; Sun, 2 Sep 2012 15:05:40 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q82F5ebg022376; Sun, 2 Sep 2012 15:05:40 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201209021505.q82F5ebg022376@svn.freebsd.org> From: Matt Jacob Date: Sun, 2 Sep 2012 15:05:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240017 - stable/9/sys/dev/isp X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Sep 2012 15:05:40 -0000 Author: mjacob Date: Sun Sep 2 15:05:39 2012 New Revision: 240017 URL: http://svn.freebsd.org/changeset/base/240017 Log: MFC of 239218 Fix an oops where we wiped out DMA maps... Modified: stable/9/sys/dev/isp/isp_freebsd.c stable/9/sys/dev/isp/isp_pci.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/isp/ (props changed) Modified: stable/9/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/9/sys/dev/isp/isp_freebsd.c Sun Sep 2 15:04:39 2012 (r240016) +++ stable/9/sys/dev/isp/isp_freebsd.c Sun Sep 2 15:05:39 2012 (r240017) @@ -779,8 +779,13 @@ static ISP_INLINE void isp_free_pcmd(ispsoftc_t *isp, union ccb *ccb) { if (ISP_PCMD(ccb)) { - memset(ISP_PCMD(ccb), 0, sizeof (struct isp_pcmd)); - ((struct isp_pcmd *)ISP_PCMD(ccb))->next = isp->isp_osinfo.pcmd_free; +#ifdef ISP_TARGET_MODE + PISP_PCMD(ccb)->datalen = 0; + PISP_PCMD(ccb)->totslen = 0; + PISP_PCMD(ccb)->cumslen = 0; + PISP_PCMD(ccb)->crn = 0; +#endif + PISP_PCMD(ccb)->next = isp->isp_osinfo.pcmd_free; isp->isp_osinfo.pcmd_free = ISP_PCMD(ccb); ISP_PCMD(ccb) = NULL; } @@ -6326,12 +6331,20 @@ isp_common_dmateardown(ispsoftc_t *isp, int isp_fcp_next_crn(ispsoftc_t *isp, uint8_t *crnp, XS_T *cmd) { - uint32_t chan = XS_CHANNEL(cmd); - uint32_t tgt = XS_TGT(cmd); - uint32_t lun = XS_LUN(cmd); - struct isp_fc *fc = &isp->isp_osinfo.pc.fc[chan]; - int idx = NEXUS_HASH(tgt, lun); - struct isp_nexus *nxp = fc->nexus_hash[idx]; + uint32_t chan, tgt, lun; + struct isp_fc *fc; + struct isp_nexus *nxp; + int idx; + + if (isp->isp_type < ISP_HA_FC_2300) + return (0); + + chan = XS_CHANNEL(cmd); + tgt = XS_TGT(cmd); + lun = XS_LUN(cmd); + fc = &isp->isp_osinfo.pc.fc[chan]; + idx = NEXUS_HASH(tgt, lun); + nxp = fc->nexus_hash[idx]; while (nxp) { if (nxp->tgt == tgt && nxp->lun == lun) Modified: stable/9/sys/dev/isp/isp_pci.c ============================================================================== --- stable/9/sys/dev/isp/isp_pci.c Sun Sep 2 15:04:39 2012 (r240016) +++ stable/9/sys/dev/isp/isp_pci.c Sun Sep 2 15:05:39 2012 (r240017) @@ -1688,18 +1688,20 @@ isp_pci_mbxdma(ispsoftc_t *isp) bus_dma_tag_destroy(fc->tdmat); goto bad; } - for (i = 0; i < INITIAL_NEXUS_COUNT; i++) { - struct isp_nexus *n = malloc(sizeof (struct isp_nexus), M_DEVBUF, M_NOWAIT | M_ZERO); - if (n == NULL) { - while (fc->nexus_free_list) { - n = fc->nexus_free_list; - fc->nexus_free_list = n->next; - free(n, M_DEVBUF); + if (isp->isp_type >= ISP_HA_FC_2300) { + for (i = 0; i < INITIAL_NEXUS_COUNT; i++) { + struct isp_nexus *n = malloc(sizeof (struct isp_nexus), M_DEVBUF, M_NOWAIT | M_ZERO); + if (n == NULL) { + while (fc->nexus_free_list) { + n = fc->nexus_free_list; + fc->nexus_free_list = n->next; + free(n, M_DEVBUF); + } + goto bad; } - goto bad; + n->next = fc->nexus_free_list; + fc->nexus_free_list = n; } - n->next = fc->nexus_free_list; - fc->nexus_free_list = n; } } }