Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Jun 2010 18:47:54 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r208898 - head/sys/kern
Message-ID:  <201006071847.o57IlsVG061704@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201006071847.o57IlsVG061704>