From owner-svn-src-all@FreeBSD.ORG Mon Jun 7 18:47:54 2010 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 49F43106566B; Mon, 7 Jun 2010 18:47:54 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 386058FC19; Mon, 7 Jun 2010 18:47:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o57Ilsn5061706; Mon, 7 Jun 2010 18:47:54 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o57IlsVG061704; Mon, 7 Jun 2010 18:47:54 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201006071847.o57IlsVG061704@svn.freebsd.org> From: Alexander Motin Date: Mon, 7 Jun 2010 18:47:54 +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: r208898 - head/sys/kern 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, 07 Jun 2010 18:47:54 -0000 Author: mav Date: Mon Jun 7 18:47:53 2010 New Revision: 208898 URL: http://svn.freebsd.org/changeset/base/208898 Log: Call BUS_PROBE_NOMATCH() when device detached due to driver unload. This allows bus to power-down device when driver unloaded on-flight. Modified: head/sys/kern/subr_bus.c Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Mon Jun 7 18:29:10 2010 (r208897) +++ head/sys/kern/subr_bus.c Mon Jun 7 18:47:53 2010 (r208898) @@ -1166,6 +1166,9 @@ devclass_delete_driver(devclass_t buscla if ((error = device_detach(dev)) != 0) return (error); device_set_driver(dev, NULL); + BUS_PROBE_NOMATCH(dev->parent, dev); + devnomatch(dev); + dev->flags |= DF_DONENOMATCH; } } } @@ -2660,6 +2663,7 @@ device_attach(device_t dev) } device_sysctl_update(dev); dev->state = DS_ATTACHED; + dev->flags &= ~DF_DONENOMATCH; devadded(dev); return (0); }