Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src-draft/trunk]: src/sys/dev Move cgd selftest from module init to cgdattach.



details:   https://anonhg.NetBSD.org/src-all/rev/2ba01da38623
branches:  trunk
changeset: 934495:2ba01da38623
user:      Taylor R Campbell <riastradh%NetBSD.org@localhost>
date:      Fri Jun 12 04:35:16 2020 +0000

description:
Move cgd selftest from module init to cgdattach.

This defers it until considerably later at boot, after cpu_attach has
run, which will be needed in order to make AES-NI work.

diffstat:

 sys/dev/cgd.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (38 lines):

diff -r 28dde22c49fd -r 2ba01da38623 sys/dev/cgd.c
--- a/sys/dev/cgd.c     Fri Jun 12 04:34:15 2020 +0000
+++ b/sys/dev/cgd.c     Fri Jun 12 04:35:16 2020 +0000
@@ -389,6 +389,8 @@
 static void    cgd_cipher(struct cgd_softc *, void *, void *,
                           size_t, daddr_t, size_t, int);
 
+static void    cgd_selftest(void);
+
 static const struct dkdriver cgddkdriver = {
         .d_minphys  = minphys,
         .d_open = cgdopen,
@@ -534,6 +536,8 @@
                aprint_error("%s: unable to register cfattach\n",
                    cgd_cd.cd_name);
 #endif
+
+       cgd_selftest();
 }
 
 static struct cgd_softc *
@@ -1598,7 +1602,7 @@
 #endif
 
 static void
-selftest(void)
+cgd_selftest(void)
 {
        struct cgd_softc sc;
        void *buf;
@@ -1673,7 +1677,6 @@
 
        switch (cmd) {
        case MODULE_CMD_INIT:
-               selftest();
 #ifdef _MODULE
                mutex_init(&cgd_spawning_mtx, MUTEX_DEFAULT, IPL_NONE);
                cv_init(&cgd_spawning_cv, "cgspwn");



Home | Main Index | Thread Index | Old Index