From owner-svn-src-all@FreeBSD.ORG Sun Mar 18 01:43:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 42287106564A; Sun, 18 Mar 2012 01:43:42 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2DD568FC0C; Sun, 18 Mar 2012 01:43:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2I1hgkY096010; Sun, 18 Mar 2012 01:43:42 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2I1hfEh096007; Sun, 18 Mar 2012 01:43:41 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201203180143.q2I1hfEh096007@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sun, 18 Mar 2012 01:43:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233104 - head/sys/mips/atheros X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Mar 2012 01:43:42 -0000 Author: gonzo Date: Sun Mar 18 01:43:41 2012 New Revision: 233104 URL: http://svn.freebsd.org/changeset/base/233104 Log: - 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 Modified: head/sys/mips/atheros/apb.c Modified: head/sys/mips/atheros/apb.c ============================================================================== --- head/sys/mips/atheros/apb.c Sun Mar 18 00:22:29 2012 (r233103) +++ head/sys/mips/atheros/apb.c Sun Mar 18 01:43:41 2012 (r233104) @@ -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),