From owner-svn-src-all@FreeBSD.ORG Mon Dec 5 21:38:45 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA1301065678; Mon, 5 Dec 2011 21:38:45 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DA4718FC12; Mon, 5 Dec 2011 21:38:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pB5LcjMe058891; Mon, 5 Dec 2011 21:38:45 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pB5LcjH0058889; Mon, 5 Dec 2011 21:38:45 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201112052138.pB5LcjH0058889@svn.freebsd.org> From: Marius Strobl Date: Mon, 5 Dec 2011 21:38:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228290 - head/sys/dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Dec 2011 21:38:46 -0000 Author: marius Date: Mon Dec 5 21:38:45 2011 New Revision: 228290 URL: http://svn.freebsd.org/changeset/base/228290 Log: - In mii_attach(9) just set the driver for a newly added miibus(4) instance before calling bus_enumerate_hinted_children(9) (which is the minimum for this to work) instead of fully probing it so later on we can just call bus_generic_attach(9) on the parent of the miibus(4) instance. The latter is necessary in order to work around what seems to be a bzzarre race in newbus affecting a few machines since r227687, causing no driver being probed for the newly added miibus(4) instance. Presumably this is the same race that was the motivation for the work around done in r215348. Reported and tested by: yongari - Revert the removal of a static in r221913 in order to help compilers to produce more optimal code. Modified: head/sys/dev/mii/mii.c Modified: head/sys/dev/mii/mii.c ============================================================================== --- head/sys/dev/mii/mii.c Mon Dec 5 19:39:15 2011 (r228289) +++ head/sys/dev/mii/mii.c Mon Dec 5 21:38:45 2011 (r228290) @@ -499,7 +499,7 @@ mii_attach(device_t dev, device_t *miibu free(children, M_TEMP); if (first != 0) { - rv = device_probe(*miibus); + rv = device_set_driver(*miibus, &miibus_driver); if (rv != 0) goto fail; bus_enumerate_hinted_children(*miibus); @@ -511,7 +511,7 @@ mii_attach(device_t dev, device_t *miibu rv = ENXIO; goto fail; } - rv = device_attach(*miibus); + rv = bus_generic_attach(dev); if (rv != 0) goto fail; @@ -626,7 +626,7 @@ mii_down(struct mii_data *mii) static unsigned char mii_bitreverse(unsigned char x) { - unsigned const char const nibbletab[16] = { + static unsigned const char const nibbletab[16] = { 0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15 };