From owner-freebsd-firewire@FreeBSD.ORG Tue Jun 17 23:35:59 2008 Return-Path: Delivered-To: freebsd-firewire@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4BB64106567E; Tue, 17 Jun 2008 23:35:59 +0000 (UTC) (envelope-from sbruno@miralink.com) Received: from plato.miralink.com (mail.miralink.com [70.103.185.20]) by mx1.freebsd.org (Postfix) with ESMTP id BE1888FC1E; Tue, 17 Jun 2008 23:35:58 +0000 (UTC) (envelope-from sbruno@miralink.com) Received: from localhost (localhost.localdomain [127.0.0.1]) by plato.miralink.com (Postfix) with ESMTP id 224961A914C; Tue, 17 Jun 2008 16:32:03 -0700 (PDT) X-Virus-Scanned: amavisd-new at X-Spam-Flag: NO X-Spam-Score: -4.399 X-Spam-Level: X-Spam-Status: No, score=-4.399 tagged_above=-10 required=6.6 tests=[ALL_TRUSTED=-1.8, BAYES_00=-2.599] Received: from plato.miralink.com ([127.0.0.1]) by localhost (plato.miralink.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nyE3a4Eab0Hz; Tue, 17 Jun 2008 16:32:02 -0700 (PDT) Received: from iago.office.miralink.com (iago.office.miralink.com [10.0.0.40]) by plato.miralink.com (Postfix) with ESMTP id B61581A8799; Tue, 17 Jun 2008 16:32:02 -0700 (PDT) Message-ID: <48584A5D.2000601@miralink.com> Date: Tue, 17 Jun 2008 16:35:57 -0700 From: Sean Bruno User-Agent: Thunderbird 2.0.0.14 (X11/20080501) MIME-Version: 1.0 To: Hidetoshi Shimokawa References: <4846F3F9.1080302@miralink.com> <48482800.8000501@miralink.com> <484EEF6B.7010407@miralink.com> <626eb4530806102213w3beda7a3u89efffd01d5e254b@mail.gmail.com> <4850BAA6.30501@miralink.com> <48520367.7090807@miralink.com> <4852F55E.6000208@miralink.com> <48572538.6040000@miralink.com> In-Reply-To: <48572538.6040000@miralink.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-firewire@freebsd.org Subject: Re: sbp_targ errors with windows initiators X-BeenThere: freebsd-firewire@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Firewire support in FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jun 2008 23:35:59 -0000 > Allrighty, I seem to have found my issue(I can't believe that it's > only affecting sbp_targ however). > > It seems that fwohci_intr_body() invoked from the interrupt handler at > fwohci_pci.c::fwohci_pci_attach() was being set with INTR_MPSAFE. It > definitely was not MPSAFE and needed Giant locked before it could > start another interrupt. Strange that this hasn't been seen in the wild. > > small diff attached: > [sbruno@desdemona > ~/work/branches/miralink.FreeBSD.6/src/sys/dev/firewire]$ svn diff > Index: fwohci_pci.c > =================================================================== > --- fwohci_pci.c (revision 5496) > +++ fwohci_pci.c (working copy) > @@ -336,7 +336,7 @@ > > err = bus_setup_intr(self, sc->irq_res, > #if FWOHCI_TASKQUEUE > - INTR_TYPE_NET | INTR_MPSAFE, > + INTR_TYPE_NET, > #else > INTR_TYPE_NET, > #endif > > This failed after a few more iterations in the same way. I enabled "OHCI_DEBUG" so I can see what events are being processed in fwohci_intr_body(). It looks like the following is the first event that is seen: fwohci0: INTERRUPT < CYC_64SECOND CYC_START BUS_RESET DMA_PRRQ > 0x00320010, 0x81430133 The DMA_PRRQ seems to cause the firewire layer to end up calling sbp_targ_recv(). The next event to occur is: fwohci0: INTERRUPT < CYC_LOST CYC_START SID DMA_PRRQ > 0x00510010, 0x81010133 This causes us to properly probe/explore the firewire bus and setup the node ids. Unfortuneatly, the first event causes an sbp_targ failure as it is not processed correctly: fwohci0: INTERRUPT < CYC_64SECOND CYC_START BUS_RESET DMA_PRRQ > 0x00320010, 0x81430133 fwohci0: BUS reset sbp_targ_recv: cannot resolve nodeid=0 sbp_targ_recv: rtcode = 6 lo == 0x0 fwohci0: INTERRUPT < CYC_LOST CYC_START SID DMA_PRRQ > 0x00510010, 0x81010133 fwohci0: node_id=0xc800ffc1, gen=4, CYCLEMASTER mode firewire0: 2 nodes, maxhop <= 1, cable IRM = 1 (me) firewire0: bus manager 1 (me) I guess that the BUS_RESET OHCI event needs to do something different that I don't fully understand. Any ideas? -- Sean Bruno MiraLink Corporation 6015 NE 80th Ave, Ste 100 Portland, OR 97218 Phone 503-621-5143 Fax 503-621-5199