From owner-freebsd-usb@FreeBSD.ORG Tue May 12 20:34:57 2009 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0590C106564A for ; Tue, 12 May 2009 20:34:57 +0000 (UTC) (envelope-from gavin@freebsd.org) Received: from mail-gw1.york.ac.uk (mail-gw1.york.ac.uk [144.32.128.246]) by mx1.freebsd.org (Postfix) with ESMTP id 7231A8FC22 for ; Tue, 12 May 2009 20:34:56 +0000 (UTC) (envelope-from gavin@freebsd.org) Received: from mail-gw7.york.ac.uk (mail-gw7.york.ac.uk [144.32.129.30]) by mail-gw1.york.ac.uk (8.13.6/8.13.6) with ESMTP id n4CKYpfx009587; Tue, 12 May 2009 21:34:51 +0100 (BST) Received: from ury.york.ac.uk ([144.32.108.81]) by mail-gw7.york.ac.uk with esmtps (TLSv1:AES256-SHA:256) (Exim 4.68) (envelope-from ) id 1M3ygd-0007kH-3A; Tue, 12 May 2009 21:34:51 +0100 Received: from ury.york.ac.uk (localhost.york.ac.uk [127.0.0.1]) by ury.york.ac.uk (8.14.3/8.14.3) with ESMTP id n4CKYoN9028037; Tue, 12 May 2009 21:34:50 +0100 (BST) (envelope-from gavin@freebsd.org) Received: from localhost (gavin@localhost) by ury.york.ac.uk (8.14.3/8.14.3/Submit) with ESMTP id n4CKYoxY028034; Tue, 12 May 2009 21:34:50 +0100 (BST) (envelope-from gavin@freebsd.org) X-Authentication-Warning: ury.york.ac.uk: gavin owned process doing -bs Date: Tue, 12 May 2009 21:34:50 +0100 (BST) From: Gavin Atkinson X-X-Sender: gavin@ury.york.ac.uk To: Hans Petter Selasky In-Reply-To: <200905121855.19123.hselasky@c2i.net> Message-ID: <20090512212821.G15689@ury.york.ac.uk> References: <1242146062.5455.60.camel@buffy.york.ac.uk> <200905121855.19123.hselasky@c2i.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-York-MailScanner: Found to be clean X-York-MailScanner-From: gavin@freebsd.org Cc: freebsd-usb@freebsd.org Subject: Re: USB panic on 8.0/arm X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2009 20:34:57 -0000 On Tue, 12 May 2009, Hans Petter Selasky wrote: > On Tuesday 12 May 2009, Gavin Atkinson wrote: >> Hi all, >> >> I have an NSLU2, which I am netbooting. I've been doing most of my work >> on it with USB removed from the kernel because the old stack would >> always panic. I've recently been trying the new USB stack, and have >> found that it still panics most of the time on boot. But not all the >> time. > In : > > src/sys/dev/usb/controller/ohci_pci.c > > Can you try to move the pci busmaster enable call further down in the attach > routine, until the I/O resources are setup, then add before enable busmaster: > > #define OBARR(sc) bus_space_barrier((sc)->sc_io_tag, (sc)->sc_io_hdl, 0, > (sc)->sc_io_size, \ > BUS_SPACE_BARRIER_READ|BUS_SPACE_BARRIER_WRITE) > #define OWRITE1(sc, r, x) \ > do { OBARR(sc); bus_space_write_1((sc)->sc_io_tag, (sc)->sc_io_hdl, (r), > (x)); } while (0) > > OWRITE4(sc, OHCI_COMMAND_STATUS, OHCI_HCR); /* Reset HC */ > > I'm not sure if it helps. It's just a guess. I'm assuming you meant to use the "OWRITE4" macro rather than OWRITE1 as that's what is used when accessing that register everywhere else. Assuming that is the case, I'm afraid the patch (below) makes no difference. Any other ideas? Thanks, Gavin Index: src-head/sys/dev/usb/controller/ohci_pci.c =================================================================== RCS file: /home/ncvs/src/sys/dev/usb/controller/ohci_pci.c,v retrieving revision 1.5 diff -u -r1.5 ohci_pci.c --- src-head/sys/dev/usb/controller/ohci_pci.c 6 Apr 2009 00:32:54 -0000 1.5 +++ src-head/sys/dev/usb/controller/ohci_pci.c 12 May 2009 20:24:00 -0000 @@ -205,7 +205,7 @@ } sc->sc_dev = self; - pci_enable_busmaster(self); +/* pci_enable_busmaster(self); */ /* * Some Sun PCIO-2 USB controllers have their intpin register @@ -239,6 +239,17 @@ } device_set_ivars(sc->sc_bus.bdev, &sc->sc_bus); + +#define OBARR(sc) bus_space_barrier((sc)->sc_io_tag, (sc)->sc_io_hdl, 0, (sc)->sc_io_size, \ + BUS_SPACE_BARRIER_READ|BUS_SPACE_BARRIER_WRITE) +#define OWRITE4(sc, r, x) \ + do { OBARR(sc); bus_space_write_4((sc)->sc_io_tag, (sc)->sc_io_hdl, (r), (x)); } while (0) + + OWRITE4(sc, OHCI_COMMAND_STATUS, OHCI_HCR); /* Reset HC */ + + pci_enable_busmaster(self); + + /* * ohci_pci_match will never return NULL if ohci_pci_probe * succeeded