Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (5 of many)

r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are
still not MPSAFE (or already are but aren’t properly marked). Use it in
preparation for a general review of all nodes.
This is non-functional change that adds annotations to SYSCTL_NODE and
SYSCTL_PROC nodes using one of the soon-to-be-required flags.

Reviewed by:	imp, kib
Approved by:	kib (mentor)
Differential Revision:	https://reviews.freebsd.org/D23633
This commit is contained in:
Pawel Biernacki 2020-02-16 17:11:54 +00:00
parent f1cabcd328
commit 59e4be225c
3 changed files with 10 additions and 14 deletions

View File

@ -42,7 +42,8 @@ __FBSDID("$FreeBSD$");
#include <dev/drm2/drmP.h>
static int drm_msi = 1; /* Enable by default. */
SYSCTL_NODE(_hw, OID_AUTO, drm, CTLFLAG_RW, NULL, "DRM device");
SYSCTL_NODE(_hw, OID_AUTO, drm, CTLFLAG_RW | CTLFLAG_MPSAFE, NULL,
"DRM device");
SYSCTL_INT(_hw_drm, OID_AUTO, msi, CTLFLAG_RDTUN, &drm_msi, 1,
"Enable MSI interrupts for drm devices");

View File

@ -69,7 +69,7 @@ int drm_sysctl_init(struct drm_device *dev)
/* Add the sysctl node for DRI if it doesn't already exist */
drioid = SYSCTL_ADD_NODE(&info->ctx, SYSCTL_CHILDREN(&sysctl___hw), OID_AUTO,
"dri", CTLFLAG_RW, NULL, "DRI Graphics");
"dri", CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, "DRI Graphics");
if (!drioid) {
free(dev->sysctl, DRM_MEM_DRIVER);
dev->sysctl = NULL;
@ -92,23 +92,17 @@ int drm_sysctl_init(struct drm_device *dev)
info->name[0] = '0' + i;
info->name[1] = 0;
top = SYSCTL_ADD_NODE(&info->ctx, SYSCTL_CHILDREN(drioid),
OID_AUTO, info->name, CTLFLAG_RW, NULL, NULL);
OID_AUTO, info->name, CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, NULL);
if (!top) {
drm_sysctl_cleanup(dev);
return (-ENOMEM);
}
for (i = 0; i < DRM_SYSCTL_ENTRIES; i++) {
oid = SYSCTL_ADD_OID(&info->ctx,
SYSCTL_CHILDREN(top),
OID_AUTO,
drm_sysctl_list[i].name,
CTLTYPE_STRING | CTLFLAG_RD,
dev,
0,
drm_sysctl_list[i].f,
"A",
NULL);
oid = SYSCTL_ADD_OID(&info->ctx, SYSCTL_CHILDREN(top),
OID_AUTO, drm_sysctl_list[i].name,
CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT,
dev, 0, drm_sysctl_list[i].f, "A", NULL);
if (!oid) {
drm_sysctl_cleanup(dev);
return (-ENOMEM);

View File

@ -332,7 +332,8 @@ uint32_t pci_numdevs = 0;
static int pcie_chipset, pcix_chipset;
/* sysctl vars */
SYSCTL_NODE(_hw, OID_AUTO, pci, CTLFLAG_RD, 0, "PCI bus tuning parameters");
SYSCTL_NODE(_hw, OID_AUTO, pci, CTLFLAG_RD | CTLFLAG_MPSAFE, 0,
"PCI bus tuning parameters");
static int pci_enable_io_modes = 1;
SYSCTL_INT(_hw_pci, OID_AUTO, enable_io_modes, CTLFLAG_RWTUN,