Source-Changes-HG archive

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

[src/trunk]: src/sys/kern PR kern/45117



details:   https://anonhg.NetBSD.org/src/rev/fe55edfb76dc
branches:  trunk
changeset: 955689:fe55edfb76dc
user:      rin <rin%NetBSD.org@localhost>
date:      Thu Oct 08 09:16:13 2020 +0000

description:
PR kern/45117

Work around regression introduced in rev 1.92:

http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/kern/kern_cpu.c#rev1.92

by which ``cpuctl offline n'' became broken on architectures without
__HAVE_INTR_CONTROL (i.e., everything other than alpha and x86);
cpu_setintr() always fails on these archs, and we had neglected
return value from that function until rev 1.91.

XXX
As martin pointed out in the PR, I'm not sure whether fix in rev 1.92
itself is correct or not. Insert XXX comment referring the PR there....

diffstat:

 sys/kern/kern_cpu.c |  10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diffs (38 lines):

diff -r ce7661302bc5 -r fe55edfb76dc sys/kern/kern_cpu.c
--- a/sys/kern/kern_cpu.c       Thu Oct 08 08:32:57 2020 +0000
+++ b/sys/kern/kern_cpu.c       Thu Oct 08 09:16:13 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_cpu.c,v 1.92 2020/07/13 13:16:07 jruoho Exp $     */
+/*     $NetBSD: kern_cpu.c,v 1.93 2020/10/08 09:16:13 rin Exp $        */
 
 /*-
  * Copyright (c) 2007, 2008, 2009, 2010, 2012, 2019 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_cpu.c,v 1.92 2020/07/13 13:16:07 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_cpu.c,v 1.93 2020/10/08 09:16:13 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_cpu_ucode.h"
@@ -212,9 +212,7 @@
                        error = ESRCH;
                        break;
                }
-               error = cpu_setintr(ci, cs->cs_intr);
-               if (error)
-                       break;
+               cpu_setintr(ci, cs->cs_intr);   /* XXX neglect errors */
                error = cpu_setstate(ci, cs->cs_online);
                break;
 
@@ -492,7 +490,7 @@
                        return 0;
                func = (xcfunc_t)cpu_xc_intr;
        } else {
-               if (CPU_IS_PRIMARY(ci))
+               if (CPU_IS_PRIMARY(ci)) /* XXX kern/45117 */
                        return EINVAL;
                if ((spc->spc_flags & SPCF_NOINTR) != 0)
                        return 0;



Home | Main Index | Thread Index | Old Index