From owner-freebsd-firewire@FreeBSD.ORG Mon Apr 20 21:15:46 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 63BAE1065670 for ; Mon, 20 Apr 2009 21:15:46 +0000 (UTC) (envelope-from andreast-list@fgznet.ch) Received: from smtp.fgznet.ch (mail.fgznet.ch [81.92.96.47]) by mx1.freebsd.org (Postfix) with ESMTP id 131AC8FC1C for ; Mon, 20 Apr 2009 21:15:45 +0000 (UTC) (envelope-from andreast-list@fgznet.ch) Received: from wolfram.andreas.nets ([91.190.8.131]) by smtp.fgznet.ch (8.13.8/8.13.8/Submit_SMTPAUTH) with ESMTP id n3KLFXXh093407; Mon, 20 Apr 2009 23:15:34 +0200 (CEST) (envelope-from andreast-list@fgznet.ch) Message-ID: <49ECE5F5.80106@fgznet.ch> Date: Mon, 20 Apr 2009 23:15:33 +0200 From: Andreas Tobler User-Agent: Thunderbird 2.0.0.21 (Macintosh/20090302) MIME-Version: 1.0 To: Sean Bruno 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> <1239819547.15474.5.camel@localhost.localdomain> <49E633C7.9030909@fgznet.ch> <1239826803.15474.48.camel@localhost.localdomain> <49E7931C.8050603@fgznet.ch> <1240248579.29756.4.camel@localhost.localdomain> <49ECC0B6.5000804@fgznet.ch> <1240255386.29756.6.camel@localhost.localdomain> <49ECCF52.6030304@fgznet.ch> <1240259657.29756.61.camel@localhost.localdomain> In-Reply-To: <1240259657.29756.61.camel@localhost.localdomain> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.64 on 81.92.96.47 Cc: Scott Long , freebsd-firewire , 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: Mon, 20 Apr 2009 21:15:46 -0000 Sean Bruno wrote: > On Mon, 2009-04-20 at 21:38 +0200, Andreas Tobler wrote: >> Sean Bruno wrote: >>> On Mon, 2009-04-20 at 20:36 +0200, Andreas Tobler wrote: >>>> resetting OHCI...done (loop=0) >>> >>> Can you recomplile with firewire_debug = 1 and resend the output? >>> >>> I'm interested in: >>> device_printf(sc->fc.dev, "%s: OHCI_INT_REG_FAIL.\n", __func__); >>> >>> If that doesn't get printed, then I need to debug a bit further. >> I always use firewire_debug=1, in the last try even > 1. All the traces >> I sent are with firewire_debug=1. >> >> I didn't see the above, I suspect the early OWRITE/READ in rddata are >> too early for the silicon. Unfortunately adding printf's there, cures >> the issue. >> >> Andreas > > I *think* this section of fwphy_rddata() is suspect: > /* > * Setup command to PHY > */ > fun = PHYDEV_RDCMD | (addr << PHYDEV_REGADDR); > OWRITE(sc, OHCI_PHYACCESS, fun); > bus_space_barrier(sc->bst, sc->bsh, OHCI_PHYACCESS, > 4, BUS_SPACE_BARRIER_WRITE); > > > According to the specification, this access is illegal if SCLK has not > started. So, there's no way out of this error without a pause() after > LPS is set in fwohci_probe_phy(). > > Although this adventure did teach me a great deal regarding firewire. > Thank you for the challenging problem. > > Find the final version of my update attached. Let me know what you find > with it. I'll have it working so far. Give some minutes to go over the code w/o debug. Thanks, Andreas u60# kldload firewire fwohci0: mem 0x4008000-0x40087ff,0x400c000-0x400ff ff irq 2008 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: fwphy_rddata:: 0x2, retry=6 fwohci0: fwphy_rddata:: 0x3, retry=6 fwohci0: Phy 1394a available S400, 3 ports. fwohci0: fwphy_rddata:: 0x5, retry=6 fwohci0: Enable 1394a Enhancements fwohci0: fwphy_rddata:: 0x5, retry=6 fwohci0: fwphy_rddata:: 0x2, retry=6 fwohci0: fwphy_rddata:: 0x4, retry=6 fwohci0: fwphy_rddata:: 0x4, retry=6 fwohci0: fwphy_rddata:: 0x4, retry=6 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: fwphy_rddata:: 0x1, retry=6 fwohci0: fwphy_rddata:: 0x1, retry=6 fwohci0: fwohci_intr_core: BUS reset fwohci0: fwohci_intr_core: node_id=0x00000000, SelfID Count=1, CYCLEMASTER mode node:0 link:1 gap:5 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