tsutsui / netbsd-src

Automatic conversion of the NetBSD src CVS module, use with care. Please submit bugs/changes via https://gnats.netbsd.org
https://www.NetBSD.org
2 stars 0 forks source link

luna88k: unstable spc(4) SCSI #6

Closed tsutsui closed 2 years ago

tsutsui commented 2 years ago

spc(4) often gets:

not sure if nono issue or NetBSD/luna88k issue, though.

tsutsui commented 2 years ago

@moveccr reported: "after clockintr setipl(1) is called from somewhere, and it seems to trigger stray intr 3"

This means spllowersoftclock(9) and CLKF_BASEPRI() could be problematic.

Actually OpenBSD has removed them on 2002 (i.e. before OpenBSD 4.0 that NetBSD/m88k is based on): https://github.com/openbsd/src/commit/12581b04a4be1be63744ec134d84a59f571e65b2 and NetBSD also removed them before NetBSD 5.0 for proper SMP support: https://github.com/NetBSD/src/commit/3363855a4a9244eb1524057a3b760c4ba17dab68

So disabling CLKF_BASEPRI() in sys/arch/m88k/include/cpu.h should be easy and enough for this tree.

diff --git a/sys/arch/m88k/include/cpu.h b/sys/arch/m88k/include/cpu.h
index a274041b03ca..0af96518f91f 100644
--- a/sys/arch/m88k/include/cpu.h
+++ b/sys/arch/m88k/include/cpu.h
@@ -202,7 +202,12 @@ struct clockframe {
 /*
  * CLKF_BASEPRI: True if we were at spl0 before the interrupt.
  */
+#if 0
+/* XXX: spllowersoftclock(9) could be problematic on m88k/trap.c etc. */
 #define CLKF_BASEPRI(framep)   ((((struct trapframe *)(framep))->tf_epsr & PSR_IND) == 0)
+#else
+#define CLKF_BASEPRI(framep)   0
+#endif

 /*
  * LWP_PC: Find out the program counter for the given lwp.
tsutsui commented 2 years ago

Fixed by https://github.com/tsutsui/netbsd-src/commit/d205ede9fbafa429810ab6974103988a6bb91a3b