From owner-svn-src-user@FreeBSD.ORG Sat Dec 17 01:02:57 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52226106564A; Sat, 17 Dec 2011 01:02:57 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 275EF8FC0C; Sat, 17 Dec 2011 01:02:57 +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 pBH12vFY035635; Sat, 17 Dec 2011 01:02:57 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pBH12vu9035632; Sat, 17 Dec 2011 01:02:57 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201112170102.pBH12vu9035632@svn.freebsd.org> From: Sean Bruno Date: Sat, 17 Dec 2011 01:02:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228613 - user/sbruno/1394dev/firewire X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Dec 2011 01:02:57 -0000 Author: sbruno Date: Sat Dec 17 01:02:56 2011 New Revision: 228613 URL: http://svn.freebsd.org/changeset/base/228613 Log: Merge in changes from kan@ 1. do not allow any requests until bus reset is done and we know node IDs 2. Do not set fc_status before fwohci_task_sid actually runs 3. When alocating dma blocks, use proper alignment, not whole block size, which is hardly ever multiple of 2 Submitted by: kan@ Modified: user/sbruno/1394dev/firewire/firewire.c user/sbruno/1394dev/firewire/fwohci.c Modified: user/sbruno/1394dev/firewire/firewire.c ============================================================================== --- user/sbruno/1394dev/firewire/firewire.c Sat Dec 17 00:54:09 2011 (r228612) +++ user/sbruno/1394dev/firewire/firewire.c Sat Dec 17 01:02:56 2011 (r228613) @@ -221,9 +221,13 @@ fw_asyreq(struct firewire_comm *fc, int return EINVAL; } - /* XXX allow bus explore packets only after bus rest */ + /* + * XXX allow bus explore packets only after bus rest and after + * we have have passed self-id receive state + */ if ((fc->status < FWBUSEXPLORE) && - ((tcode != FWTCODE_RREQQ) || (fp->mode.rreqq.dest_hi != 0xffff) || + ((fc->status < FWBUSINIT) || + (tcode != FWTCODE_RREQQ) || (fp->mode.rreqq.dest_hi != 0xffff) || (fp->mode.rreqq.dest_lo < 0xf0000000) || (fp->mode.rreqq.dest_lo >= 0xf0001000))) { xfer->resp = EAGAIN; Modified: user/sbruno/1394dev/firewire/fwohci.c ============================================================================== --- user/sbruno/1394dev/firewire/fwohci.c Sat Dec 17 00:54:09 2011 (r228612) +++ user/sbruno/1394dev/firewire/fwohci.c Sat Dec 17 01:02:56 2011 (r228613) @@ -1274,7 +1274,7 @@ fwohci_db_init(struct fwohci_softc *sc, } #define DB_SIZE(x) (sizeof(struct fwohcidb) * (x)->ndesc) - dbch->am = fwdma_malloc_multiseg(&sc->fc, DB_SIZE(dbch), + dbch->am = fwdma_malloc_multiseg(&sc->fc, sizeof(struct fwohcidb), DB_SIZE(dbch), dbch->ndb, BUS_DMA_WAITOK); if (dbch->am == NULL) { printf("fwohci_db_init: fwdma_malloc_multiseg failed\n"); @@ -1907,8 +1907,6 @@ fwohci_intr_core(struct fwohci_softc *sc OWRITE(sc, OHCI_LNKCTL, OHCI_CNTL_CYCTIMER); } - fc->status = FWBUSINIT; - if (!kdb_active) taskqueue_enqueue(sc->fc.taskqueue, &sc->fwohci_task_sid); } @@ -2014,7 +2012,6 @@ fwohci_task_sid(void *arg, int pending) uint32_t *buf; int i, plen; - /* * We really should have locking * here. Not sure why it's not @@ -2039,6 +2036,8 @@ fwohci_task_sid(void *arg, int pending) for (i = 0; i < plen / 4; i ++) buf[i] = FWOHCI_DMA_READ(sc->sid_buf[i+1]); + fc->status = FWBUSINIT; + /* pending all pre-bus_reset packets */ fwohci_txd(sc, &sc->atrq); fwohci_txd(sc, &sc->atrs);