Module Name:    src
Committed By:   skrll
Date:           Wed Jun 28 20:46:35 UTC 2017

Modified Files:
        src/sys/arch/arm/cortex: gic.c

Log Message:
Revert the KERNHIST for now it causes problems


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/arm/cortex/gic.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/cortex/gic.c
diff -u src/sys/arch/arm/cortex/gic.c:1.28 src/sys/arch/arm/cortex/gic.c:1.29
--- src/sys/arch/arm/cortex/gic.c:1.28	Thu Jun 22 08:10:29 2017
+++ src/sys/arch/arm/cortex/gic.c	Wed Jun 28 20:46:35 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: gic.c,v 1.28 2017/06/22 08:10:29 skrll Exp $	*/
+/*	$NetBSD: gic.c,v 1.29 2017/06/28 20:46:35 skrll Exp $	*/
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,22 +29,19 @@
  */
 
 #include "opt_ddb.h"
-#include "opt_kernhist.h"
 #include "opt_multiprocessor.h"
 
 #define _INTR_PRIVATE
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gic.c,v 1.28 2017/06/22 08:10:29 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gic.c,v 1.29 2017/06/28 20:46:35 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
-#include <sys/cpu.h>
 #include <sys/device.h>
 #include <sys/evcnt.h>
 #include <sys/intr.h>
-#include <sys/kernhist.h>
-#include <sys/once.h>
+#include <sys/cpu.h>
 #include <sys/proc.h>
 
 #include <arm/armreg.h>
@@ -74,16 +71,6 @@ static void armgic_cpu_init(struct pic_s
 static void armgic_ipi_send(struct pic_softc *, const kcpuset_t *, u_long);
 #endif
 
-#ifdef KERNHIST
-static int armgichist_init(void);
-
-#ifndef ARMGICHIST_SIZE
-#define ARMGICHIST_SIZE 200
-#endif
-
-KERNHIST_DEFINE(armgichist);
-#endif
-
 static const struct pic_ops armgic_picops = {
 	.pic_unblock_irqs = armgic_unblock_irqs,
 	.pic_block_irqs = armgic_block_irqs,
@@ -251,27 +238,12 @@ softint_trigger(uintptr_t machdep)
 }
 #endif
 
-
-#ifdef KERNHIST
-int
-armgichist_init(void)
-{
-
-	KERNHIST_INIT(armgichist, ARMGICHIST_SIZE);
-
-	return 0;
-}
-#endif
-
 void
-armgic_irq_handler(void *arg)
+armgic_irq_handler(void *tf)
 {
-    	KERNHIST_FUNC(__func__); KERNHIST_CALLED(armgichist);
 	struct cpu_info * const ci = curcpu();
 	struct armgic_softc * const sc = &armgic_softc;
 	const int old_ipl = ci->ci_cpl;
-	struct trapframe * const tf = arg;
-	
 #ifdef DIAGNOSTIC
 	const int old_mtx_count = ci->ci_mtx_count;
 	const int old_l_biglocks = ci->ci_curlwp->l_biglocks;
@@ -285,14 +257,10 @@ armgic_irq_handler(void *arg)
 	KASSERTMSG(old_ipl != IPL_HIGH, "old_ipl %d pmr %#x hppir %#x",
 	    old_ipl, gicc_read(sc, GICC_PMR), gicc_read(sc, GICC_HPPIR));
 
-	KERNHIST_LOG(armgichist, "old_ipl %d pmr %u hppir %u", old_ipl,
-	    gicc_read(sc, GICC_PMR), gicc_read(sc, GICC_HPPIR), 0);
-
 	for (;;) {
 		uint32_t iar = gicc_read(sc, GICC_IAR);
 		uint32_t irq = __SHIFTOUT(iar, GICC_IAR_IRQ);
 
-		KERNHIST_LOG(armgichist, "iar %#x (irq %d)", iar, irq, 0, 0);
 		if (irq == GICC_IAR_IRQ_SPURIOUS ||
 		    irq == GICC_IAR_IRQ_SSPURIOUS) {
 			iar = gicc_read(sc, GICC_IAR);
@@ -321,9 +289,6 @@ armgic_irq_handler(void *arg)
 		 * However, if are just raising ipl, we can just update ci_cpl.
 		 */
 		const int ipl = is->is_ipl;
-
-		KERNHIST_LOG(armgichist, "ipl %d vs ci_cpl %d pmr %#x", ipl,
-		    ci->ci_cpl, gicc_read(sc, GICC_PMR), 0);
 		if (__predict_false(ipl < ci->ci_cpl)) {
 			pic_do_pending_ints(I32_bit, ipl, tf);
 			KASSERT(ci->ci_cpl == ipl);
@@ -350,18 +315,14 @@ armgic_irq_handler(void *arg)
 	 */
 	KASSERT(old_ipl != IPL_HIGH);
 	pic_do_pending_ints(I32_bit, old_ipl, tf);
-	KASSERTMSG(ci->ci_cpl == old_ipl, "ci_cpl %d old_ipl %d", ci->ci_cpl,
-	    old_ipl);
+	KASSERTMSG(ci->ci_cpl == old_ipl, "ci_cpl %d old_ipl %d", ci->ci_cpl, old_ipl);
 	KASSERT(old_mtx_count == ci->ci_mtx_count);
 	KASSERT(old_l_biglocks == ci->ci_curlwp->l_biglocks);
-
-	KERNHIST_LOG(armgichist, "... done", 0, 0, 0, 0);
 }
 
 void
 armgic_establish_irq(struct pic_softc *pic, struct intrsource *is)
 {
-    	KERNHIST_FUNC(__func__); KERNHIST_CALLED(armgichist);
 	struct armgic_softc * const sc = PICTOSOFTC(pic);
 	const size_t group = is->is_irq / 32;
 	const u_int irq = is->is_irq & 31;
@@ -409,9 +370,6 @@ armgic_establish_irq(struct pic_softc *p
 		}
 		if (new_cfg != cfg) {
 			gicd_write(sc, cfg_reg, new_cfg);
-
-			KERNHIST_LOG(armgichist, "irq %u: cfg changed from %#x "
-			    "to %#x", is->is_irq, cfg, new_cfg, 0);
 		}
 #ifdef MULTIPROCESSOR
 	} else {
@@ -509,7 +467,6 @@ armgic_cpu_init(struct pic_softc *pic, s
 void
 armgic_ipi_send(struct pic_softc *pic, const kcpuset_t *kcp, u_long ipi)
 {
-    	KERNHIST_FUNC(__func__); KERNHIST_CALLED(armgichist);
 	struct armgic_softc * const sc = PICTOSOFTC(pic);
 
 #if 0
@@ -532,7 +489,6 @@ armgic_ipi_send(struct pic_softc *pic, c
 	}
 
 	gicd_write(sc, GICD_SGIR, sgir);
-	KERNHIST_LOG(armgichist, "... done (%#x)", sgir, 0, 0, 0);
 }
 #endif
 
@@ -554,13 +510,6 @@ armgic_attach(device_t parent, device_t 
 {
 	struct armgic_softc * const sc = &armgic_softc;
 	struct mpcore_attach_args * const mpcaa = aux;
-#ifdef KERNHIST
-	static ONCE_DECL(armgic_once);
-
-	RUN_ONCE(&armgic_once, armgichist_init);
-#endif
-
-    	KERNHIST_FUNC(__func__); KERNHIST_CALLED(armgichist);
 
 	sc->sc_dev = self;
 	self->dv_private = sc;

Reply via email to