From owner-freebsd-i386@FreeBSD.ORG Thu Mar 10 16:10:12 2011 Return-Path: Delivered-To: freebsd-i386@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC33A1065676 for ; Thu, 10 Mar 2011 16:10:11 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 9F0DB8FC16 for ; Thu, 10 Mar 2011 16:10:11 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p2AGABqG008962 for ; Thu, 10 Mar 2011 16:10:11 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p2AGABAu008961; Thu, 10 Mar 2011 16:10:11 GMT (envelope-from gnats) Resent-Date: Thu, 10 Mar 2011 16:10:11 GMT Resent-Message-Id: <201103101610.p2AGABAu008961@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-i386@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Andreas Longwitz Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 42566106566B for ; Thu, 10 Mar 2011 16:09:47 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 1787D8FC18 for ; Thu, 10 Mar 2011 16:09:47 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p2AG9kXv078711 for ; Thu, 10 Mar 2011 16:09:46 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id p2AG9k68078710; Thu, 10 Mar 2011 16:09:46 GMT (envelope-from nobody) Message-Id: <201103101609.p2AG9k68078710@red.freebsd.org> Date: Thu, 10 Mar 2011 16:09:46 GMT From: Andreas Longwitz To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: i386/155441: Firewire support in loader is broken X-BeenThere: freebsd-i386@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: I386-specific issues for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Mar 2011 16:10:12 -0000 >Number: 155441 >Category: i386 >Synopsis: Firewire support in loader is broken >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-i386 >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Mar 10 16:10:11 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Andreas Longwitz >Release: 8.1-RELEASE-p1 >Organization: Data Service Stockelsdorf >Environment: FreeBSD pclong.incore 8.1-RELEASE-p1 FreeBSD 8.1-RELEASE-p1 #3: Mon Feb 14 14:47:50 CET 2011 root@pclong.incore:/usr/src/sys/i386/compile/PCLONG i386 >Description: With LOADER_FIREWIRE_SUPPORT=yes the loader includes firewire support. In /usr/src/sys/boot/i386/libfirewire/firewire.c the call of the function biospci_write_config is not correct (the second and third parameter must be swapped). Some hardware complains about this, some do not. Also only the first firewire device is supported - in my opinion unnecessarily. >How-To-Repeat: Try to use the loader over firewire. >Fix: Patch attached with submission follows: --- /usr/src/sys/boot/i386/libfirewire/firewire.c.orig 2010-06-14 04:09:06.000000000 +0200 +++ /usr/src/sys/boot/i386/libfirewire/firewire.c 2011-02-07 14:40:15.000000000 +0100 @@ -105,10 +105,14 @@ return; } - biospci_write_config(sc->locator, + err = biospci_write_config(sc->locator, 0x4 /* command */, - 0x6 /* enable bus master and memory mapped I/O */, - 1 /* word */); + 1 /* word */, + 0x6 /* enable bus master and memory mapped I/O */); + if (err != 0) { + sc->state = FWOHCI_STATE_DEAD; + return; + } biospci_read_config(sc->locator, 0x00 /*devid*/, 2 /*dword*/, &sc->devid); @@ -135,9 +139,9 @@ sc = &fwinfo[i]; fw_probe(i, sc); if (sc->state == FWOHCI_STATE_DEAD) - break; + continue; avail ++; - break; + continue; } fw_initialized = 1; @@ -157,7 +161,7 @@ for (i = 0; i < MAX_OHCI; i ++) { sc = &fwinfo[i]; if (sc->state == FWOHCI_STATE_DEAD) - break; + continue; printf("%d: locator=0x%04x devid=0x%08x" " base_addr=0x%08x handle=0x%08x bus_id=0x%08x\n", i, sc->locator, sc->devid, @@ -360,7 +364,7 @@ for (i = 0; i < MAX_OHCI; i ++) { sc = &fwinfo[i]; if (sc->state != FWOHCI_STATE_INIT) - break; + continue; sc->config_rom = (uint32_t *) (((uint32_t)sc->config_rom_buf @@ -389,7 +393,7 @@ for (i = 0; i < MAX_OHCI; i ++) { sc = &fwinfo[i]; if (sc->state < FWOHCI_STATE_ENABLED) - break; + continue; fwohci_poll(sc); } } @@ -404,7 +408,7 @@ for (i = 0; i < MAX_OHCI; i ++) { sc = &fwinfo[i]; if (sc->state < FWOHCI_STATE_INIT) - break; + continue; fw_busreset(sc); } return(CMD_OK); >Release-Note: >Audit-Trail: >Unformatted: