svn commit: r305751 - in head: share/man/man9 sys/kern

John Baldwin jhb at FreeBSD.org
Mon Sep 12 18:06:43 UTC 2016


Author: jhb
Date: Mon Sep 12 18:06:42 2016
New Revision: 305751
URL: https://svnweb.freebsd.org/changeset/base/305751

Log:
  Make device_quiet() an attachment property.
  
  In particular, reset the DF_QUIET flag when detaching from a device so
  that a driver that marks a device quiet doesn't dictate policy for a
  different driver that may claim the device in the future.
  
  Reviewed by:	rpokala, wblock
  MFC after:	2 weeks
  Sponsored by:	Chelsio Communications
  Differential Revision:	https://reviews.freebsd.org/D7803

Modified:
  head/share/man/man9/device_quiet.9
  head/sys/kern/subr_bus.c

Modified: head/share/man/man9/device_quiet.9
==============================================================================
--- head/share/man/man9/device_quiet.9	Mon Sep 12 17:35:45 2016	(r305750)
+++ head/share/man/man9/device_quiet.9	Mon Sep 12 18:06:42 2016	(r305751)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 21, 1999
+.Dd September 12, 2016
 .Dt DEVICE_QUIET 9
 .Os
 .Sh NAME
@@ -49,16 +49,18 @@
 Each device has a quiet flag associated with it.
 A device is
 verbose by default when it is created but may be quieted to prevent
-the device identification string to be printed during probe.
+printing of the device identification string during attach
+and printing of a message during detach.
 To quiet a device, call
-.Fn device_quiet ,
-to re-enable to probe message (to make the message appear again, for
-example after a
-.Xr device_detach 9 )
+.Fn device_quiet
+during a device driver probe routine.
+To re-enable probe messages,
 call
 .Fn device_verbose .
 To test to see if a device is quieted, call
 .Fn device_is_quiet .
+.Pp
+Devices are implicitly marked verbose after a driver detaches.
 .Sh SEE ALSO
 .Xr device 9
 .Sh AUTHORS

Modified: head/sys/kern/subr_bus.c
==============================================================================
--- head/sys/kern/subr_bus.c	Mon Sep 12 17:35:45 2016	(r305750)
+++ head/sys/kern/subr_bus.c	Mon Sep 12 18:06:42 2016	(r305751)
@@ -2146,6 +2146,12 @@ device_probe_child(device_t dev, device_
 			}
 
 			/*
+			 * Reset DF_QUIET in case this driver doesn't
+			 * end up as the best driver.
+			 */
+			device_verbose(child);
+
+			/*
 			 * Probes that return BUS_PROBE_NOWILDCARD or lower
 			 * only match on devices whose driver was explicitly
 			 * specified.
@@ -2970,6 +2976,7 @@ device_detach(device_t dev)
 	if (!(dev->flags & DF_FIXEDCLASS))
 		devclass_delete_device(dev->devclass, dev);
 
+	device_verbose(dev);
 	dev->state = DS_NOTPRESENT;
 	(void)device_set_driver(dev, NULL);
 	device_sysctl_fini(dev);


More information about the svn-src-head mailing list