From 19bd2f7501efb5091ec87def228b32a4ada4bfc4 Mon Sep 17 00:00:00 2001 From: jdc Date: Sat, 2 Sep 2023 05:51:57 +0000 Subject: [PATCH] sparc64: fix interrupt level mapping for disk and and parallel devices on SBUS-based machines Change the mapping from PIL_SCSI to PIL_BIO, so that they interrupt above the highest soft interrupt (softserial) Remove unused PIL_SCSI, PIL_FDSOFT, PIL_AUSOFT and fix the printf in fdc.c Add "socal" and "SUNW,bpp" to the interrupt map. --- sys/arch/sparc64/dev/fdc.c | 6 +++--- sys/arch/sparc64/include/intr.h | 3 +-- sys/arch/sparc64/include/psl.h | 11 +---------- sys/arch/sparc64/sparc64/autoconf.c | 15 +++++++++------ 4 files changed, 14 insertions(+), 21 deletions(-) diff --git a/sys/arch/sparc64/dev/fdc.c b/sys/arch/sparc64/dev/fdc.c index 2d56ed0bec26..b8c784c0d4ba 100644 --- a/sys/arch/sparc64/dev/fdc.c +++ b/sys/arch/sparc64/dev/fdc.c @@ -1,4 +1,4 @@ -/* $NetBSD: fdc.c,v 1.51 2021/08/07 16:19:05 thorpej Exp $ */ +/* $NetBSD: fdc.c,v 1.52 2023/09/02 05:51:57 jdc Exp $ */ /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -101,7 +101,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: fdc.c,v 1.51 2021/08/07 16:19:05 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: fdc.c,v 1.52 2023/09/02 05:51:57 jdc Exp $"); #include "opt_ddb.h" #include "opt_md.h" @@ -825,7 +825,7 @@ fdcattach(struct fdc_softc *fdc, int pri) #ifdef SUN4 printf(" softpri %d: chip 8207%c\n", IPL_SOFTFDC, code); #elif SUN4U - printf(" softpri %d: chip 8207%c", PIL_FDSOFT, code); + printf(" softpri %d: chip 8207%c", IPL_BIO, code); if (fdc->sc_flags & FDC_NOEJECT) printf(": manual eject"); printf("\n"); diff --git a/sys/arch/sparc64/include/intr.h b/sys/arch/sparc64/include/intr.h index e3f2510b86eb..398b1bcf9151 100644 --- a/sys/arch/sparc64/include/intr.h +++ b/sys/arch/sparc64/include/intr.h @@ -1,4 +1,4 @@ -/* $NetBSD: intr.h,v 1.31 2012/07/27 05:36:12 matt Exp $ */ +/* $NetBSD: intr.h,v 1.32 2023/09/02 05:51:57 jdc Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -54,7 +54,6 @@ #define IPL_HIGH PIL_HIGH /* everything */ #define IPL_HALT 5 /* cpu stop-self */ #define IPL_PAUSE 13 /* pause cpu */ -#define IPL_FDSOFT PIL_FDSOFT /* floppy */ /* * IPL_SAFEPRI is a safe priority for sleep to set for a spin-wait diff --git a/sys/arch/sparc64/include/psl.h b/sys/arch/sparc64/include/psl.h index 16546afcb4b1..6fb999968a3c 100644 --- a/sys/arch/sparc64/include/psl.h +++ b/sys/arch/sparc64/include/psl.h @@ -1,4 +1,4 @@ -/* $NetBSD: psl.h,v 1.63 2023/07/11 11:02:07 martin Exp $ */ +/* $NetBSD: psl.h,v 1.64 2023/09/02 05:51:57 jdc Exp $ */ /* * Copyright (c) 1992, 1993 @@ -73,9 +73,6 @@ #define PSR_BITS "\20\16EC\15EF\10S\7PS\6ET" /* Interesting spl()s */ -#define PIL_SCSI 3 -#define PIL_FDSOFT 4 -#define PIL_AUSOFT 4 #define PIL_BIO 5 #define PIL_VIDEO 5 #define PIL_TTY 6 @@ -514,12 +511,6 @@ SPLHOLD(splsoftint, 1) SPLHOLD(splsoftserial, 4) -/* audio software interrupts are at software level 4 */ -SPLHOLD(splausoft, PIL_AUSOFT) - -/* floppy software interrupts are at software level 4 too */ -SPLHOLD(splfdsoft, PIL_FDSOFT) - /* * Memory allocation (must be as high as highest network, tty, or disk device) */ diff --git a/sys/arch/sparc64/sparc64/autoconf.c b/sys/arch/sparc64/sparc64/autoconf.c index 283df2dd2e98..147fed3fb462 100644 --- a/sys/arch/sparc64/sparc64/autoconf.c +++ b/sys/arch/sparc64/sparc64/autoconf.c @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.c,v 1.238 2022/01/22 11:49:17 thorpej Exp $ */ +/* $NetBSD: autoconf.c,v 1.239 2023/09/02 05:51:57 jdc Exp $ */ /* * Copyright (c) 1996 @@ -48,7 +48,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.238 2022/01/22 11:49:17 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.239 2023/09/02 05:51:57 jdc Exp $"); #include "opt_ddb.h" #include "opt_kgdb.h" @@ -165,19 +165,22 @@ int kernel_dtlb_slots; int kernel_itlb_slots; /* Global interrupt mappings for all device types. Match against the OBP - * 'device_type' property. + * 'device_type' property. Note, that the resulting PIL must be higher than + * the highest soft interrupt level (IPL_SOFTSERIAL). */ struct intrmap intrmap[] = { { "block", PIL_FD }, /* Floppy disk */ { "serial", PIL_SER }, /* zs */ - { "scsi", PIL_SCSI }, - { "scsi-2", PIL_SCSI }, + { "scsi", PIL_BIO }, + { "scsi-2", PIL_BIO }, { "network", PIL_NET }, { "display", PIL_VIDEO }, { "audio", PIL_AUD }, - { "ide", PIL_SCSI }, + { "ide", PIL_BIO }, + { "socal", PIL_BIO }, /* The following devices don't have device types: */ { "SUNW,CS4231", PIL_AUD }, + { "SUNW,bpp", PIL_BIO }, { NULL, 0 } };