From owner-svn-src-stable-11@freebsd.org Fri Sep 30 22:29:20 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D1C8C041DF; Fri, 30 Sep 2016 22:29:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 45457192E; Fri, 30 Sep 2016 22:29:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8UMTJeu068765; Fri, 30 Sep 2016 22:29:19 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8UMTJl5068763; Fri, 30 Sep 2016 22:29:19 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201609302229.u8UMTJl5068763@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 30 Sep 2016 22:29:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r306535 - in stable/11: share/man/man9 sys/kern X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Sep 2016 22:29:20 -0000 Author: jhb Date: Fri Sep 30 22:29:19 2016 New Revision: 306535 URL: https://svnweb.freebsd.org/changeset/base/306535 Log: MFC 305751: 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. Sponsored by: Chelsio Communications Modified: stable/11/share/man/man9/device_quiet.9 stable/11/sys/kern/subr_bus.c Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man9/device_quiet.9 ============================================================================== --- stable/11/share/man/man9/device_quiet.9 Fri Sep 30 22:28:20 2016 (r306534) +++ stable/11/share/man/man9/device_quiet.9 Fri Sep 30 22:29:19 2016 (r306535) @@ -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: stable/11/sys/kern/subr_bus.c ============================================================================== --- stable/11/sys/kern/subr_bus.c Fri Sep 30 22:28:20 2016 (r306534) +++ stable/11/sys/kern/subr_bus.c Fri Sep 30 22:29:19 2016 (r306535) @@ -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);