Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm/xscale Do *NOT* lower IPL in i80321_splraise().



details:   https://anonhg.NetBSD.org/src/rev/fbda137a2196
branches:  trunk
changeset: 1022770:fbda137a2196
user:      rin <rin%NetBSD.org@localhost>
date:      Fri Aug 06 08:58:42 2021 +0000

description:
Do *NOT* lower IPL in i80321_splraise().

Fix various strange crashes for DIAGNOSTIC kernel on evbarm/HDL_G,
including one worked around by if_wm.c rev 1.706:

http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/dev/pci/if_wm.c#rev1.706

diffstat:

 sys/arch/arm/xscale/i80321_intr.h |  13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diffs (28 lines):

diff -r 4dd0b9d6d20f -r fbda137a2196 sys/arch/arm/xscale/i80321_intr.h
--- a/sys/arch/arm/xscale/i80321_intr.h Fri Aug 06 08:44:31 2021 +0000
+++ b/sys/arch/arm/xscale/i80321_intr.h Fri Aug 06 08:58:42 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i80321_intr.h,v 1.12 2018/01/24 09:04:45 skrll Exp $   */
+/*     $NetBSD: i80321_intr.h,v 1.13 2021/08/06 08:58:42 rin Exp $     */
 
 /*
  * Copyright (c) 2001, 2002, 2006 Wasabi Systems, Inc.
@@ -95,10 +95,15 @@
 i80321_splraise(int ipl)
 {
        int old = curcpl();
-       set_curcpl(ipl);
 
-       /* Don't let the compiler re-order this code with subsequent code */
-       __insn_barrier();
+       if (ipl > old) {
+               set_curcpl(ipl);
+               /*
+                * Don't let the compiler re-order this code with
+                * subsequent code
+                */
+               __insn_barrier();
+       }
 
        return (old);
 }



Home | Main Index | Thread Index | Old Index