Source-Changes-HG archive

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

[src/trunk]: src/sys/external/bsd/drm2/dist/drm drm: ksyms_getname is forbidd...



details:   https://anonhg.NetBSD.org/src/rev/23d305ba431c
branches:  trunk
changeset: 1028801:23d305ba431c
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 12:04:08 2021 +0000

description:
drm: ksyms_getname is forbidden in interrupt context.

For now, just avoid nice pretty symbol output in interrupt handlers.

diffstat:

 sys/external/bsd/drm2/dist/drm/drm_print.c |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (36 lines):

diff -r 5786dd71bb7f -r 23d305ba431c sys/external/bsd/drm2/dist/drm/drm_print.c
--- a/sys/external/bsd/drm2/dist/drm/drm_print.c        Sun Dec 19 12:03:57 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/drm_print.c        Sun Dec 19 12:04:08 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: drm_print.c,v 1.9 2021/12/19 11:46:00 riastradh Exp $  */
+/*     $NetBSD: drm_print.c,v 1.10 2021/12/19 12:04:08 riastradh Exp $ */
 
 /*
  * Copyright (C) 2016 Red Hat
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: drm_print.c,v 1.9 2021/12/19 11:46:00 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_print.c,v 1.10 2021/12/19 12:04:08 riastradh Exp $");
 
 #ifndef __NetBSD__             /* XXX ??? */
 #define DEBUG /* for pr_debug() */
@@ -35,6 +35,7 @@
 #ifdef __NetBSD__
 #include <sys/param.h>
 #include <sys/stdarg.h>
+#include <sys/cpu.h>
 #include <sys/device.h>
 #include <sys/ksyms.h>
 #else
@@ -78,7 +79,8 @@
        const char *mod;
        const char *sym;
 
-       if (ksyms_getname(&mod, &sym, val, KSYMS_PROC|KSYMS_CLOSEST) == 0) {
+       if (!cpu_intr_p() &&
+           ksyms_getname(&mod, &sym, val, KSYMS_PROC|KSYMS_CLOSEST) == 0) {
                char offset[32];
 
                if (ksyms_getval(mod, sym, &naddr, KSYMS_ANY) == 0 &&



Home | Main Index | Thread Index | Old Index