Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 23 Nov 2019 23:57:26 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r355039 - head/sys/kern
Message-ID:  <201911232357.xANNvQwM004080@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: imp
Date: Sat Nov 23 23:57:26 2019
New Revision: 355039
URL: https://svnweb.freebsd.org/changeset/base/355039

Log:
  Add a warning about Giant Locked devices
  
  Add a warning when a device registers with devfs and requests
  D_NEEDGIANT. The warning says the device will go away before
  13.0. This is needed to flush out the devices in the tree that are
  still Giant locked. This warning, or some variant of it, should have
  gone into the tree a long time ago...
  
  The intention is to require all devices be converted to not use
  automatic giant in this way, or remove any such devices that remain
  that we don't have the hardware to test a conversion of.
  
  kbd so far is the only device that can't leave the tree, yet needs
  something sensible done to avoid the auto giant lock (even if it is
  just doing the wrapping itself). There may be others added to this
  list... Any discussions of this topic will take place on arch@.

Modified:
  head/sys/kern/kern_conf.c

Modified: head/sys/kern/kern_conf.c
==============================================================================
--- head/sys/kern/kern_conf.c	Sat Nov 23 23:44:00 2019	(r355038)
+++ head/sys/kern/kern_conf.c	Sat Nov 23 23:57:26 2019	(r355039)
@@ -664,6 +664,9 @@ prep_cdevsw(struct cdevsw *devsw, int flags)
 	}
 	
 	if (devsw->d_flags & D_NEEDGIANT) {
+		printf("WARNING: Device \"%s\" is Giant locked and may be "
+		    "deleted before FreeBSD 13.0.\n",
+		    devsw->d_name == NULL ? "???" : devsw->d_name);
 		if (devsw->d_gianttrick == NULL) {
 			memcpy(dsw2, devsw, sizeof *dsw2);
 			devsw->d_gianttrick = dsw2;



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