summaryrefslogtreecommitdiffstats
path: root/sys/mips
diff options
context:
space:
mode:
authorgonzo <gonzo@FreeBSD.org>2012-03-18 01:43:41 +0000
committergonzo <gonzo@FreeBSD.org>2012-03-18 01:43:41 +0000
commitfd6921cafaeb485d95a0c760fb46c8d68d493496 (patch)
tree9cc5dc8832057a619598ba3b0cf8b88e0439a5d6 /sys/mips
parent7218f7cbc7eab316c5db18cea6d60696090ba3df (diff)
downloadFreeBSD-src-fd6921cafaeb485d95a0c760fb46c8d68d493496.zip
FreeBSD-src-fd6921cafaeb485d95a0c760fb46c8d68d493496.tar.gz
- Fix logic for detection if further processing of PMC should be performed.
pmc_intr returns one if one of the counters actually triggered the IRQ - style(9) fixed
Diffstat (limited to 'sys/mips')
-rw-r--r--sys/mips/atheros/apb.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/sys/mips/atheros/apb.c b/sys/mips/atheros/apb.c
index b0e5524..03eeb2f 100644
--- a/sys/mips/atheros/apb.c
+++ b/sys/mips/atheros/apb.c
@@ -347,6 +347,8 @@ apb_filter(void *arg)
struct intr_event *event;
uint32_t reg, irq;
struct thread *td;
+ struct trapframe *tf;
+ register_t s;
reg = ATH_READ_REG(AR71XX_MISC_INTR_STATUS);
for (irq = 0; irq < APB_NIRQS; irq++) {
@@ -368,18 +370,24 @@ apb_filter(void *arg)
event = sc->sc_eventstab[irq];
if (!event || TAILQ_EMPTY(&event->ie_handlers)) {
if (irq == APB_INTR_PMC) {
- register_t s;
- struct trapframe *tf = PCPU_GET(curthread)->td_intr_frame;
+ td = PCPU_GET(curthread);
+ tf = td->td_intr_frame;
+
s = intr_disable();
mips_intrcnt_inc(sc->sc_intr_counter[irq]);
- if (pmc_intr && (*pmc_intr)(PCPU_GET(cpuid), tf)) {
- intr_restore(s);
- continue;
+ if (pmc_intr) {
+ /*
+ * Make sure at least one of counters
+ * generated this interrupt
+ */
+ if (!(*pmc_intr)(PCPU_GET(cpuid), tf)) {
+ intr_restore(s);
+ continue;
+ }
}
intr_restore(s);
- td = PCPU_GET(curthread);
if (pmc_hook && (td->td_pflags & TDP_CALLCHAIN))
pmc_hook(PCPU_GET(curthread),
OpenPOWER on IntegriCloud