From owner-svn-src-all@FreeBSD.ORG Mon Nov 2 21:22:31 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60FFB106568F; Mon, 2 Nov 2009 21:22:31 +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 36F9B8FC22; Mon, 2 Nov 2009 21:22:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nA2LMUp3070118; Mon, 2 Nov 2009 21:22:30 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nA2LMUtt070116; Mon, 2 Nov 2009 21:22:30 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <200911022122.nA2LMUtt070116@svn.freebsd.org> From: Matt Jacob Date: Mon, 2 Nov 2009 21:22:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198822 - head/sys/dev/isp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Nov 2009 21:22:31 -0000 Author: mjacob Date: Mon Nov 2 21:22:30 2009 New Revision: 198822 URL: http://svn.freebsd.org/changeset/base/198822 Log: Unbreak SBus cards which have been broken (apparently) for a while. Most of the pieces came from Marius- correct settings for channels and resource management. The one piece missing was that you cannot for SBus cards replace 32 bit operations with A64 operations- not supported. Submitted by: marius MFC after: 3 days Modified: head/sys/dev/isp/isp_sbus.c Directory Properties: Modified: head/sys/dev/isp/isp_sbus.c ============================================================================== --- head/sys/dev/isp/isp_sbus.c Mon Nov 2 20:37:49 2009 (r198821) +++ head/sys/dev/isp/isp_sbus.c Mon Nov 2 21:22:30 2009 (r198822) @@ -193,6 +193,8 @@ isp_sbus_attach(device_t dev) isp->isp_param = &sbs->sbus_param; isp->isp_osinfo.pc.ptr = &sbs->sbus_spi; isp->isp_revision = 0; /* XXX */ + isp->isp_dev = dev; + isp->isp_nchan = 1; ISP_SET_PC(isp, 0, role, role); /* @@ -316,18 +318,16 @@ isp_sbus_attach(device_t dev) goto bad; } isp_init(isp); - if (role != ISP_ROLE_NONE && isp->isp_state != ISP_INITSTATE) { - isp_uninit(isp); - ISP_UNLOCK(isp); - goto bad; + if (isp->isp_state == ISP_INITSTATE) { + isp->isp_state = ISP_RUNSTATE; } - isp_attach(isp); - if (role != ISP_ROLE_NONE && isp->isp_state != ISP_RUNSTATE) { + ISP_UNLOCK(isp); + if (isp_attach(isp)) { + ISP_LOCK(isp); isp_uninit(isp); ISP_UNLOCK(isp); goto bad; } - ISP_UNLOCK(isp); return (0); bad: @@ -345,13 +345,10 @@ bad: } if (regs) { - (void) bus_release_resource(dev, 0, 0, regs); + (void) bus_release_resource(dev, SYS_RES_MEMORY, 0, regs); } if (sbs) { - if (sbs->sbus_isp.isp_param) { - free(sbs->sbus_isp.isp_param, M_DEVBUF); - } free(sbs, M_DEVBUF); } return (ENXIO); @@ -584,13 +581,6 @@ dma2(void *arg, bus_dma_segment_t *dm_se isp = mp->isp; rq = mp->rq; if (nseg) { - if (sizeof (bus_addr_t) > 4) { - if (rq->req_header.rqs_entry_type == RQSTYPE_T2RQS) { - rq->req_header.rqs_entry_type = RQSTYPE_T3RQS; - } else if (rq->req_header.rqs_entry_type == RQSTYPE_REQUEST) { - rq->req_header.rqs_entry_type = RQSTYPE_A64; - } - } if ((csio->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) { bus_dmamap_sync(isp->isp_osinfo.dmat, PISP_PCMD(csio)->dmap, BUS_DMASYNC_PREREAD); ddir = ISP_FROM_DEVICE;