From owner-svn-src-all@FreeBSD.ORG Sat Sep 18 13:44:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0BAD106566B; Sat, 18 Sep 2010 13:44:39 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D03D58FC1F; Sat, 18 Sep 2010 13:44:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8IDidvm067237; Sat, 18 Sep 2010 13:44:39 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8IDidNS067235; Sat, 18 Sep 2010 13:44:39 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201009181344.o8IDidNS067235@svn.freebsd.org> From: Alexander Motin Date: Sat, 18 Sep 2010 13:44:39 +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: r212823 - head/sys/arm/mv 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: Sat, 18 Sep 2010 13:44:40 -0000 Author: mav Date: Sat Sep 18 13:44:39 2010 New Revision: 212823 URL: http://svn.freebsd.org/changeset/base/212823 Log: Clear timer interrupt status before calling callback, not after it, This fixes timer interrupt losses, fatal in one-shot mode. Modified: head/sys/arm/mv/timer.c Modified: head/sys/arm/mv/timer.c ============================================================================== --- head/sys/arm/mv/timer.c Sat Sep 18 11:18:42 2010 (r212822) +++ head/sys/arm/mv/timer.c Sat Sep 18 13:44:39 2010 (r212823) @@ -178,14 +178,14 @@ mv_hardclock(void *arg) struct mv_timer_softc *sc; uint32_t irq_cause; - sc = (struct mv_timer_softc *)arg; - if (sc->et.et_active) - sc->et.et_event_cb(&sc->et, sc->et.et_arg); - irq_cause = read_cpu_ctrl(BRIDGE_IRQ_CAUSE); irq_cause &= ~(IRQ_TIMER0); write_cpu_ctrl(BRIDGE_IRQ_CAUSE, irq_cause); + sc = (struct mv_timer_softc *)arg; + if (sc->et.et_active) + sc->et.et_event_cb(&sc->et, sc->et.et_arg); + return (FILTER_HANDLED); } @@ -394,6 +394,8 @@ mv_timer_start(struct eventtimer *et, val |= CPU_TIMER0_EN; if (period != NULL) val |= CPU_TIMER0_AUTO; + else + val &= ~CPU_TIMER0_AUTO; mv_set_timer_control(val); return (0); }