From owner-cvs-all@FreeBSD.ORG Mon Jul 3 06:45:04 2006 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C3CAF16A403; Mon, 3 Jul 2006 06:45:03 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (vc4-2-0-87.dsl.netrack.net [199.45.160.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id CF57743D48; Mon, 3 Jul 2006 06:45:01 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (localhost.village.org [IPv6:::1] (may be forged)) by harmony.bsdimp.com (8.13.4/8.13.4) with ESMTP id k636i0Xn038963; Mon, 3 Jul 2006 00:44:00 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Mon, 03 Jul 2006 00:44:04 -0600 (MDT) Message-Id: <20060703.004404.1878036141.imp@bsdimp.com> To: nate@root.org From: "M. Warner Losh" In-Reply-To: <44A8B572.6030503@root.org> References: <20060703025355.AA9CA16A62D@hub.freebsd.org> <44A8B572.6030503@root.org> X-Mailer: Mew version 4.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org, yongari@FreeBSD.org Subject: Re: cvs commit: src/sys/dev/mii acphy.c amphy.c bmtphy.c brgphy.c ciphy.c e1000phy.c exphy.c inphy.c lxtphy.c mlphy.c nsgphy.c nsphy.c pnaphy.c qsphy.c rgephy.c rlphy.c ruephy.c tdkphy.c tlphy.c ukphy.c xmphy.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jul 2006 06:45:04 -0000 In message: <44A8B572.6030503@root.org> Nate Lawson writes: : Pyun YongHyeon wrote: : > yongari 2006-07-03 02:53:40 UTC : > : > FreeBSD src repository : > : > Modified files: : > sys/dev/mii acphy.c amphy.c bmtphy.c brgphy.c ciphy.c : > e1000phy.c exphy.c inphy.c lxtphy.c : > mlphy.c nsgphy.c nsphy.c pnaphy.c qsphy.c : > rgephy.c rlphy.c ruephy.c tdkphy.c : > tlphy.c ukphy.c xmphy.c : > Log: : > Replace hard-coded magic constants to system defined constants : > (BUS_PROBE_DEFAULT, BUS_PROBE_GENERIC etc). : > There is no functional changes. : > : > Reviewed by: oleg, scottl : : Actually, there are functional changes. Whether those changes are ok or : not, I don't know. They are fine. There are three functional changes. You only noticed one of them. Since this is an important point, I've replied here. : > --- src/sys/dev/mii/acphy.c:1.17 Fri Sep 30 19:39:27 2005 : > +++ src/sys/dev/mii/acphy.c Mon Jul 3 02:53:39 2006 : > @@ -132,7 +132,7 @@ : > } else : > return (ENXIO); : > : > - return (0); : > + return (BUS_PROBE_DEFAULT); : > } : > : > static int : : This means probe() will be called multiple times to allow bidding for : the device. Is that ok for this and other devices? While generally a good, and subtle, point to me, as far as I can tell it is ok. All of these probe routines just lookup things by name, which is safe to do multiple times. The second subtle thing to look at, btw, is to make sure that the probe routine doesn't have any side effects. Like saving values in softc. I believe that this is the case here as well. The third subtle thing is now other probe routines get to bid on the device. When 0 is returned, we short-circuit the probe process. We don't call the other routines. When -X is returned, we call them all, and then call the winning bidder again (which is the first one above). In some cases, this can cause other probe routines to run that wouldn't have before for other devices. Typically, this isn't a big deal, but it is something to consider. We really should have a mii lookup routine ala the pccard ones, but I've not yet sorted out the mii mess. Did you know we use a different bit order than NetBSD, which makes sharing drivers harder? Or at least bringing in changes to existing drivers? Maybe this would make a good jkh project. Warner