diff --git a/sys/dev/kbd/kbd.c b/sys/dev/kbd/kbd.c index fd996f7a06ad..70c0ef15a56e 100644 --- a/sys/dev/kbd/kbd.c +++ b/sys/dev/kbd/kbd.c @@ -453,7 +453,7 @@ static d_poll_t genkbdpoll; static struct cdevsw kbd_cdevsw = { .d_version = D_VERSION, - .d_flags = D_NEEDGIANT, + .d_flags = D_NEEDGIANT | D_GIANTOK, .d_open = genkbdopen, .d_close = genkbdclose, .d_read = genkbdread, diff --git a/sys/dev/ofw/openfirmio.c b/sys/dev/ofw/openfirmio.c index 2112d45d4dd9..30afb85baf8a 100644 --- a/sys/dev/ofw/openfirmio.c +++ b/sys/dev/ofw/openfirmio.c @@ -66,7 +66,7 @@ static d_ioctl_t openfirm_ioctl; static struct cdevsw openfirm_cdevsw = { .d_version = D_VERSION, - .d_flags = D_NEEDGIANT, + .d_flags = D_NEEDGIANT | D_GIANTOK, .d_ioctl = openfirm_ioctl, .d_name = "openfirm", }; diff --git a/sys/kern/kern_conf.c b/sys/kern/kern_conf.c index 3a07c95e74d0..42435c0b8740 100644 --- a/sys/kern/kern_conf.c +++ b/sys/kern/kern_conf.c @@ -665,7 +665,7 @@ prep_cdevsw(struct cdevsw *devsw, int flags) devsw->d_kqfilter = dead_kqfilter; } - if (devsw->d_flags & D_NEEDGIANT) { + if ((devsw->d_flags & (D_NEEDGIANT | D_GIANTOK)) == D_NEEDGIANT) { printf("WARNING: Device \"%s\" is Giant locked and may be " "deleted before FreeBSD 14.0.\n", devsw->d_name == NULL ? "???" : devsw->d_name); diff --git a/sys/sys/conf.h b/sys/sys/conf.h index 2a87e5d3a9ca..123bf91cf952 100644 --- a/sys/sys/conf.h +++ b/sys/sys/conf.h @@ -173,6 +173,7 @@ typedef int dumper_hdr_t(struct dumperinfo *di, struct kerneldumpheader *kdh, */ #define D_TRACKCLOSE 0x00080000 /* track all closes */ #define D_MMAP_ANON 0x00100000 /* special treatment in vm_mmap.c */ +#define D_GIANTOK 0x00200000 /* suppress warning about using Giant */ #define D_NEEDGIANT 0x00400000 /* driver want Giant */ #define D_NEEDMINOR 0x00800000 /* driver uses clone_create() */