Source-Changes-HG archive

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

[src/trunk]: src/sys/arch TS7200: Defer event counter registration until afte...



details:   https://anonhg.NetBSD.org/src/rev/ee0da8ac7c4c
branches:  trunk
changeset: 374547:ee0da8ac7c4c
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Tue May 02 09:49:33 2023 +0000

description:
TS7200: Defer event counter registration until after evcnt is initialized

Patch from Lloyd Parkes <lloyd%must-have-coffee.gen.nz@localhost> in PR# kern/57386

diffstat:

 sys/arch/arm/ep93xx/ep93xx_intr.c     |  21 ++++++++++++++++-----
 sys/arch/arm/ep93xx/ep93xxvar.h       |   3 ++-
 sys/arch/evbarm/tsarm/tsarm_machdep.c |  10 ++++++++--
 3 files changed, 26 insertions(+), 8 deletions(-)

diffs (94 lines):

diff -r 3069f03c9e52 -r ee0da8ac7c4c sys/arch/arm/ep93xx/ep93xx_intr.c
--- a/sys/arch/arm/ep93xx/ep93xx_intr.c Tue May 02 00:11:27 2023 +0000
+++ b/sys/arch/arm/ep93xx/ep93xx_intr.c Tue May 02 09:49:33 2023 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ep93xx_intr.c,v 1.27 2021/11/21 08:25:26 skrll Exp $ */
+/* $NetBSD: ep93xx_intr.c,v 1.28 2023/05/02 09:49:33 jmcneill Exp $ */
 
 /*
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ep93xx_intr.c,v 1.27 2021/11/21 08:25:26 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ep93xx_intr.c,v 1.28 2023/05/02 09:49:33 jmcneill Exp $");
 
 /*
  * Interrupt support for the Cirrus Logic EP93XX
@@ -257,9 +257,6 @@ ep93xx_intr_init(void)
                TAILQ_INIT(&iq->iq_list);
 
                snprintf(iq->iq_name, sizeof(iq->iq_name), "irq %d", i);
-               evcnt_attach_dynamic(&iq->iq_ev, EVCNT_TYPE_INTR,
-                                    NULL, (i < VIC_NIRQ ? "vic1" : "vic2"),
-                                    iq->iq_name);
        }
        curcpu()->ci_intr_depth = 0;
        set_curcpl(0);
@@ -275,6 +272,20 @@ ep93xx_intr_init(void)
        enable_interrupts(I32_bit);
 }
 
+void
+ep93xx_intr_evcnt_attach(void)
+{
+       struct intrq *iq;
+       int i;
+
+       for (i = 0; i < NIRQ; i++) {
+               iq = &intrq[i];
+               evcnt_attach_dynamic(&iq->iq_ev, EVCNT_TYPE_INTR,
+                                    NULL, (i < VIC_NIRQ ? "vic1" : "vic2"),
+                                    iq->iq_name);
+       }
+}
+
 void *
 ep93xx_intr_establish(int irq, int ipl, int (*ih_func)(void *), void *arg)
 {
diff -r 3069f03c9e52 -r ee0da8ac7c4c sys/arch/arm/ep93xx/ep93xxvar.h
--- a/sys/arch/arm/ep93xx/ep93xxvar.h   Tue May 02 00:11:27 2023 +0000
+++ b/sys/arch/arm/ep93xx/ep93xxvar.h   Tue May 02 09:49:33 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ep93xxvar.h,v 1.6 2012/11/12 18:00:36 skrll Exp $ */
+/*     $NetBSD: ep93xxvar.h,v 1.7 2023/05/02 09:49:33 jmcneill Exp $ */
 /*
  * Copyright (c) 2004 Jesse Off
  * All rights reserved.
@@ -69,6 +69,7 @@ extern struct arm32_bus_dma_tag ep93xx_b
 void   ep93xx_intr_init(void);
 void   *ep93xx_intr_establish(int irq, int ipl, int (*)(void *), void *);
 void   ep93xx_intr_disestablish(void *);
+void   ep93xx_intr_evcnt_attach(void);
 /* Platform needs to provide this */
 bus_dma_tag_t ep93xx_bus_dma_init(struct arm32_bus_dma_tag *);
 void   ep93xx_reset(void);
diff -r 3069f03c9e52 -r ee0da8ac7c4c sys/arch/evbarm/tsarm/tsarm_machdep.c
--- a/sys/arch/evbarm/tsarm/tsarm_machdep.c     Tue May 02 00:11:27 2023 +0000
+++ b/sys/arch/evbarm/tsarm/tsarm_machdep.c     Tue May 02 09:49:33 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tsarm_machdep.c,v 1.35 2023/04/20 08:28:05 skrll Exp $ */
+/*     $NetBSD: tsarm_machdep.c,v 1.36 2023/05/02 09:49:33 jmcneill Exp $ */
 
 /*
  * Copyright (c) 2001, 2002, 2003 Wasabi Systems, Inc.
@@ -73,7 +73,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tsarm_machdep.c,v 1.35 2023/04/20 08:28:05 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tsarm_machdep.c,v 1.36 2023/05/02 09:49:33 jmcneill Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_console.h"
@@ -843,3 +843,9 @@ ep93xx_bus_dma_init(struct arm32_bus_dma
 
        return dmat;
 }
+
+void
+cpu_startup_hook(void)
+{
+       ep93xx_intr_evcnt_attach();
+}



Home | Main Index | Thread Index | Old Index