From owner-svn-src-all@FreeBSD.ORG Sat Jul 16 20:16:50 2011 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 94A0010656E7; Sat, 16 Jul 2011 20:16:50 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2EA718FC0C; Sat, 16 Jul 2011 20:16:50 +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 p6GKGoaL042685; Sat, 16 Jul 2011 20:16:50 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6GKGoah042682; Sat, 16 Jul 2011 20:16:50 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201107162016.p6GKGoah042682@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 16 Jul 2011 20:16:50 +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: r224114 - head/sys/ia64/ia64 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, 16 Jul 2011 20:16:50 -0000 Author: marcel Date: Sat Jul 16 20:16:49 2011 New Revision: 224114 URL: http://svn.freebsd.org/changeset/base/224114 Log: Don't send EOI to the CPU before we handled the interrupt. This could potentially trigger multiple pending interrupts for level-sensitive interrupts. However, the event timer interrupt does need EOI before being handled to avoid missing clock events. These conflicting requirements are handled by having the XIV handler inform the dispatch code whether or not it send EOI to the CPU. If not, the dispatch code will do it. This allows handlers to send EOI before doing potentially long-running activities, while still have a sensible default behaviour. Modified: head/sys/ia64/ia64/clock.c head/sys/ia64/ia64/interrupt.c Modified: head/sys/ia64/ia64/clock.c ============================================================================== --- head/sys/ia64/ia64/clock.c Sat Jul 16 20:03:23 2011 (r224113) +++ head/sys/ia64/ia64/clock.c Sat Jul 16 20:16:49 2011 (r224114) @@ -91,12 +91,14 @@ ia64_ih_clock(struct thread *td, u_int x ia64_set_itm(itc + load); } else ia64_set_itv((1 << 16) | xiv); + + ia64_set_eoi(0); ia64_srlz_d(); et = &ia64_clock_et; if (et->et_active) et->et_event_cb(et, et->et_arg); - return (0); + return (1); } /* Modified: head/sys/ia64/ia64/interrupt.c ============================================================================== --- head/sys/ia64/ia64/interrupt.c Sat Jul 16 20:03:23 2011 (r224113) +++ head/sys/ia64/ia64/interrupt.c Sat Jul 16 20:16:49 2011 (r224114) @@ -320,11 +320,12 @@ ia64_handle_intr(struct trapframe *tf) td->td_intr_frame = tf; do { - ia64_set_eoi(0); - ia64_srlz_d(); CTR2(KTR_INTR, "INTR: ITC=%u, XIV=%u", (u_int)tf->tf_special.ifa, xiv); - (ia64_handler[xiv])(td, xiv, tf); + if (!(ia64_handler[xiv])(td, xiv, tf)) { + ia64_set_eoi(0); + ia64_srlz_d(); + } xiv = ia64_get_ivr(); ia64_srlz_d(); } while (xiv != 15);