From owner-freebsd-firewire@FreeBSD.ORG Wed Apr 15 18:19:09 2009 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 06773106566B for ; Wed, 15 Apr 2009 18:19:09 +0000 (UTC) (envelope-from sean.bruno@dsl-only.net) Received: from iron2.pdx.net (iron2.pdx.net [69.64.224.71]) by mx1.freebsd.org (Postfix) with ESMTP id CF7858FC0A for ; Wed, 15 Apr 2009 18:19:08 +0000 (UTC) (envelope-from sean.bruno@dsl-only.net) Received: (qmail 20169 invoked from network); 15 Apr 2009 11:19:06 -0700 Received: from 069-064-235-060.pdx.net (HELO ?192.168.1.51?) (69.64.235.60) by iron2.pdx.net with SMTP; 15 Apr 2009 11:19:06 -0700 From: Sean Bruno To: Andreas Tobler In-Reply-To: <49E61B4D.1050209@fgznet.ch> References: <1239382529.21481.7.camel@localhost.localdomain> <20090411154000.GG8143@alchemy.franken.de> <1239600457.24831.8.camel@localhost.localdomain> <49E2F2FA.6000204@fgznet.ch> <1239639423.24831.85.camel@localhost.localdomain> <20090413170537.GI8143@alchemy.franken.de> <1239643406.24831.95.camel@localhost.localdomain> <20090413173528.GJ8143@alchemy.franken.de> <1239646889.24831.135.camel@localhost.localdomain> <20090414184741.GK8143@alchemy.franken.de> <49E4DF9F.1090804@fgznet.ch> <1239814413.15474.2.camel@localhost.localdomain> <49E61B4D.1050209@fgznet.ch> Content-Type: text/plain Date: Wed, 15 Apr 2009 11:19:07 -0700 Message-Id: <1239819547.15474.5.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.24.5 (2.24.5-1.fc10) Content-Transfer-Encoding: 7bit Cc: freebsd-firewire , scottl , Marius Strobl Subject: Re: fwochi.c and bus_space_barrier() 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: Wed, 15 Apr 2009 18:19:09 -0000 On Wed, 2009-04-15 at 19:37 +0200, Andreas Tobler wrote: > Sean Bruno wrote: > >>> This looks basically good, but as outlined earlier a driver > >>> souldn't busy-wait 50ms. Could one of you please test whether > >>> pause("fwlps", (50 * hz + 999) / 1000) works as a drop-in > >>> replacement for DELAY(50000) here? > >> Works fine here! > >> > >> Thanks! > >> Andreas > >> > >> > >> > > > > Ok, time for more testing. A couple of changes here. > > > > 1. change busy DELAY() call with pause() > > 2. test for lps condition before pause(), if not set pause and retry. > > Fine here, but see that there was no pause needed, strange. > > Andreas > > You may want to retry several times. Like you pointed out in earlier posts, this issue seems to be a race condition. > FreeBSD 8.0-CURRENT (GENERIC) #3 r191101:191110M: Wed Apr 15 19:21:30 > CEST 2009 > You have new mail. > u60# kldload firewire > fwohci0: mem > 0x4008000-0x40087ff,0x400c000-0x400ff > ff at device 4.0 on pci0 > fwohci0: latency timer 24 -> 32. > fwohci0: cache size 16 -> 16. > fwohci0: [ITHREAD] > fwohci0: OHCI version 1.0 (ROM=1) > fwohci0: No. of Isochronous channels is 4. > fwohci0: EUI64 00:10:74:60:00:00:ee:a9 > fwohci0: resetting OHCI...done (loop=0) > fwohci0: lps(80000) set > fwohci0: Phy 1394a available S400, 3 ports. > fwohci0: Enable 1394a Enhancements > fwohci0: Link S400, max_rec 2048 bytes. > fwohci0: BUS_OPT 0xa002 -> 0xf800a002 > fwohci0: fwohci_set_intr: 1 > firewire0: on fwohci0 > fwohci0: Initiate bus reset > fwohci0: fwohci_intr_core: BUS reset > fwohci0: fwohci_intr_core: node_id=0x00000000, SelfID Count=1, > CYCLEMASTER mode > node:0 link:1 gap:63 spd:2 con:1 pwr:4 p0:1 p1:1 p2:1 i:1 m:0 > firewire0: 1 nodes, maxhop <= 0 capable IRM irm(0) (me) > fwohci0: fwohci_set_bus_manager: 0->0 (loop=0) > firewire0: bus manager 0 > firewire0: fw_phy_config: root_node=-1 gap_count=5 > fwohci0: fwohci_start: maxdesc 2 > fwohci0: start AT DMA status=0 > u60# firewire0: fw_bus_probe:iterate and invalidate all nodes > firewire0: fw_explore:found myself node(0) fc->nodeid(0) fc->max_node(0) > bus_explore done > > u60# kldunload firewire > firewire0: detached > fwohci0: fwohci_set_intr: 0 > fwohci0: detached > u60# Thanks for testing this. I will see if we can close a PR regarding unloading the firewire module. Sean