From owner-svn-src-all@FreeBSD.ORG Mon Sep 14 00:30:44 2009 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 E0CC51065676; Mon, 14 Sep 2009 00:30:43 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 923E18FC13; Mon, 14 Sep 2009 00:30:43 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id n8E0SOXZ089175; Sun, 13 Sep 2009 18:28:24 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sun, 13 Sep 2009 18:29:59 -0600 (MDT) Message-Id: <20090913.182959.1038847030.imp@bsdimp.com> To: scottl@samsco.org From: "M. Warner Losh" In-Reply-To: References: <200909131508.n8DF8JwI024189@svn.freebsd.org> X-Mailer: Mew version 5.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: attilio@FreeBSD.org, svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r197165 - in head/sys: kern sys 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, 14 Sep 2009 00:30:44 -0000 In message: Scott Long writes: : Are we just just giving up on this for now? Also, I would have liked : to have known that this was coming. There's a thread in arch@ that discusses the plans, more or less... Warner : Scott : : On Sep 13, 2009, at 9:08 AM, Attilio Rao wrote: : : > Author: attilio : > Date: Sun Sep 13 15:08:19 2009 : > New Revision: 197165 : > URL: http://svn.freebsd.org/changeset/base/197165 : > : > Log: : > Revert r196779 in order to implement a different scheme for newbus : > locking : > methodology. : > : > Requested by: imp : > : > Modified: : > head/sys/kern/subr_bus.c : > head/sys/sys/bus.h : > : > Modified: head/sys/kern/subr_bus.c : > = : > = : > = : > = : > = : > = : > = : > = : > ====================================================================== : > --- head/sys/kern/subr_bus.c Sun Sep 13 14:47:31 2009 (r197164) : > +++ head/sys/kern/subr_bus.c Sun Sep 13 15:08:19 2009 (r197165) : > @@ -2625,16 +2625,10 @@ device_attach(device_t dev) : > { : > int error; : > : > - if (dev->state >= DS_ATTACHING) : > - return (0); : > device_sysctl_init(dev); : > if (!device_is_quiet(dev)) : > device_print_child(dev->parent, dev); : > - dev->state = DS_ATTACHING; : > if ((error = DEVICE_ATTACH(dev)) != 0) { : > - KASSERT(dev->state == DS_ATTACHING, : > - ("%s: %p device state must not been changing", __func__, : > - dev)); : > printf("device_attach: %s%d attach returned %d\n", : > dev->driver->name, dev->unit, error); : > /* Unset the class; set in device_probe_child */ : > @@ -2645,8 +2639,6 @@ device_attach(device_t dev) : > dev->state = DS_NOTPRESENT; : > return (error); : > } : > - KASSERT(dev->state == DS_ATTACHING, : > - ("%s: %p device state must not been changing", __func__, dev)); : > device_sysctl_update(dev); : > dev->state = DS_ATTACHED; : > devadded(dev); : > @@ -2682,16 +2674,8 @@ device_detach(device_t dev) : > if (dev->state != DS_ATTACHED) : > return (0); : > : > - dev->state = DS_DETACHING; : > - if ((error = DEVICE_DETACH(dev)) != 0) { : > - KASSERT(dev->state == DS_DETACHING, : > - ("%s: %p device state must not been changing", __func__, : > - dev)); : > - dev->state = DS_ATTACHED; : > + if ((error = DEVICE_DETACH(dev)) != 0) : > return (error); : > - } : > - KASSERT(dev->state == DS_DETACHING, : > - ("%s: %p device state must not been changing", __func__, dev)); : > devremoved(dev); : > if (!device_is_quiet(dev)) : > device_printf(dev, "detached\n"); : > @@ -2746,7 +2730,7 @@ device_quiesce(device_t dev) : > int : > device_shutdown(device_t dev) : > { : > - if (dev->state < DS_ATTACHED || dev->state == DS_DETACHING) : > + if (dev->state < DS_ATTACHED) : > return (0); : > return (DEVICE_SHUTDOWN(dev)); : > } : > : > Modified: head/sys/sys/bus.h : > = : > = : > = : > = : > = : > = : > = : > = : > ====================================================================== : > --- head/sys/sys/bus.h Sun Sep 13 14:47:31 2009 (r197164) : > +++ head/sys/sys/bus.h Sun Sep 13 15:08:19 2009 (r197165) : > @@ -52,11 +52,8 @@ struct u_businfo { : > typedef enum device_state { : > DS_NOTPRESENT, /**< @brief not probed or probe failed */ : > DS_ALIVE, /**< @brief probe succeeded */ : > - DS_ATTACHING, /**< @brief attaching is in progress */ : > DS_ATTACHED, /**< @brief attach method called */ : > - DS_BUSY, /**< @brief device is open */ : > - DS_DETACHING /**< @brief detaching is in progress */ : > - : > + DS_BUSY /**< @brief device is open */ : > } device_state_t; : > : > /** : 1