Source-Changes-HG archive

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

[src/trunk]: src/sys/dev ssdfb(4): remove code for dealing with non-MPSAFE at...



details:   https://anonhg.NetBSD.org/src/rev/3cb8f142423b
branches:  trunk
changeset: 1022629:3cb8f142423b
user:      tnn <tnn%NetBSD.org@localhost>
date:      Fri Jul 30 13:44:09 2021 +0000

description:
ssdfb(4): remove code for dealing with non-MPSAFE attachment

spi(4) was marked MPSAFE some time ago, so we're always on an
MPSAFE parent device.

diffstat:

 sys/dev/i2c/ssdfb_i2c.c |   5 ++---
 sys/dev/ic/ssdfb.c      |  17 ++++++-----------
 sys/dev/ic/ssdfbvar.h   |   3 +--
 3 files changed, 9 insertions(+), 16 deletions(-)

diffs (89 lines):

diff -r cb8bab74e867 -r 3cb8f142423b sys/dev/i2c/ssdfb_i2c.c
--- a/sys/dev/i2c/ssdfb_i2c.c   Fri Jul 30 12:46:46 2021 +0000
+++ b/sys/dev/i2c/ssdfb_i2c.c   Fri Jul 30 13:44:09 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ssdfb_i2c.c,v 1.9 2021/01/28 14:42:45 thorpej Exp $ */
+/* $NetBSD: ssdfb_i2c.c,v 1.10 2021/07/30 13:44:09 tnn Exp $ */
 
 /*
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ssdfb_i2c.c,v 1.9 2021/01/28 14:42:45 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ssdfb_i2c.c,v 1.10 2021/07/30 13:44:09 tnn Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -112,7 +112,6 @@
        if ((flags & SSDFB_ATTACH_FLAG_PRODUCT_MASK) == SSDFB_PRODUCT_UNKNOWN)
                flags |= SSDFB_PRODUCT_SSD1306_GENERIC;
 
-       flags |= SSDFB_ATTACH_FLAG_MPSAFE;
        sc->sc.sc_dev = self;
        sc->sc_i2c_tag = ia->ia_tag;
        sc->sc_i2c_addr = ia->ia_addr;
diff -r cb8bab74e867 -r 3cb8f142423b sys/dev/ic/ssdfb.c
--- a/sys/dev/ic/ssdfb.c        Fri Jul 30 12:46:46 2021 +0000
+++ b/sys/dev/ic/ssdfb.c        Fri Jul 30 13:44:09 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ssdfb.c,v 1.13 2021/04/24 23:36:55 thorpej Exp $ */
+/* $NetBSD: ssdfb.c,v 1.14 2021/07/30 13:44:09 tnn Exp $ */
 
 /*
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ssdfb.c,v 1.13 2021/04/24 23:36:55 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ssdfb.c,v 1.14 2021/07/30 13:44:09 tnn Exp $");
 
 #include "opt_ddb.h"
 
@@ -227,7 +227,6 @@
        int error = 0;
        long defattr;
        const struct ssdfb_product *p;
-       int kt_flags;
 
        p = ssdfb_lookup_product(flags & SSDFB_ATTACH_FLAG_PRODUCT_MASK);
        if (p == NULL) {
@@ -332,15 +331,11 @@
        if (sc->sc_is_console)
                ssdfb_set_usepoll(sc, true);
 
-       mutex_init(&sc->sc_cond_mtx, MUTEX_DEFAULT,
-           ISSET(flags, SSDFB_ATTACH_FLAG_MPSAFE) ? IPL_SCHED : IPL_BIO);
+       mutex_init(&sc->sc_cond_mtx, MUTEX_DEFAULT, IPL_SCHED);
        cv_init(&sc->sc_cond, "ssdfb");
-       kt_flags = KTHREAD_MUSTJOIN;
-       /* XXX spi(4) is not MPSAFE yet. */
-       if (ISSET(flags, SSDFB_ATTACH_FLAG_MPSAFE))
-               kt_flags |= KTHREAD_MPSAFE;
-       error = kthread_create(PRI_SOFTCLOCK, kt_flags, NULL, ssdfb_thread, sc,
-           &sc->sc_thread, "%s", device_xname(sc->sc_dev));
+       error = kthread_create(PRI_SOFTCLOCK, KTHREAD_MUSTJOIN | KTHREAD_MPSAFE,
+           NULL, ssdfb_thread, sc,  &sc->sc_thread, "%s",
+           device_xname(sc->sc_dev));
        if (error) {
                cv_destroy(&sc->sc_cond);
                mutex_destroy(&sc->sc_cond_mtx);
diff -r cb8bab74e867 -r 3cb8f142423b sys/dev/ic/ssdfbvar.h
--- a/sys/dev/ic/ssdfbvar.h     Fri Jul 30 12:46:46 2021 +0000
+++ b/sys/dev/ic/ssdfbvar.h     Fri Jul 30 13:44:09 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ssdfbvar.h,v 1.5 2019/11/02 14:18:36 tnn Exp $ */
+/* $NetBSD: ssdfbvar.h,v 1.6 2021/07/30 13:44:09 tnn Exp $ */
 
 /*
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -36,7 +36,6 @@
 #define SSDFB_ATTACH_FLAG_UPSIDEDOWN           0x00000100
 #define SSDFB_ATTACH_FLAG_INVERSE              0x00000200
 #define SSDFB_ATTACH_FLAG_CONSOLE              0x00000400
-#define SSDFB_ATTACH_FLAG_MPSAFE               0x00000800
 
 /*
  * Fundamental commands



Home | Main Index | Thread Index | Old Index