From owner-svn-src-head@FreeBSD.ORG Tue Jan 26 05:10:10 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E42831065670; Tue, 26 Jan 2010 05:10:10 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D48CF8FC08; Tue, 26 Jan 2010 05:10:10 +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 o0Q5AA89086585; Tue, 26 Jan 2010 05:10:10 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0Q5AASp086583; Tue, 26 Jan 2010 05:10:10 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201001260510.o0Q5AASp086583@svn.freebsd.org> From: Randall Stewart Date: Tue, 26 Jan 2010 05:10:10 +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: r203008 - head/sys/mips/rmi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2010 05:10:11 -0000 Author: rrs Date: Tue Jan 26 05:10:10 2010 New Revision: 203008 URL: http://svn.freebsd.org/changeset/base/203008 Log: Fix up the msg ring driver a bit tighter so that we don't loose an interrupt which we appeared to be doing. Modified: head/sys/mips/rmi/xlr_machdep.c Modified: head/sys/mips/rmi/xlr_machdep.c ============================================================================== --- head/sys/mips/rmi/xlr_machdep.c Tue Jan 26 05:07:41 2010 (r203007) +++ head/sys/mips/rmi/xlr_machdep.c Tue Jan 26 05:10:10 2010 (r203008) @@ -352,14 +352,6 @@ mips_init(void) mips_cpu_init(); pmap_bootstrap(); - - mips_proc0_init(); - write_c0_register32(MIPS_COP_0_OSSCRATCH, 7, pcpup->pc_curthread); - - mutex_init(); - - PMAP_LOCK_INIT(kernel_pmap); - #ifdef DDB #ifdef SMP setup_nmi(); @@ -369,6 +361,9 @@ mips_init(void) kdb_enter("Boot flags requested debugger", NULL); } #endif + mips_proc0_init(); + write_c0_register32(MIPS_COP_0_OSSCRATCH, 7, pcpup->pc_curthread); + mutex_init(); } void @@ -604,31 +599,26 @@ msgring_process_fast_intr(void *arg) { int cpu = PCPU_GET(cpuid); volatile struct msgring_ithread *it; - struct proc *p; struct thread *td; /* wakeup an appropriate intr_thread for processing this interrupt */ it = (volatile struct msgring_ithread *)&msgring_ithreads[cpu]; td = it->i_thread; - p = td->td_proc; /* * Interrupt thread will enable the interrupts after processing all * messages */ disable_msgring_int(NULL); + atomic_store_rel_int(&it->i_pending, 1); thread_lock(td); - it->i_pending = 1; if (TD_AWAITING_INTR(td)) { - CTR3(KTR_INTR, "%s: schedule pid %d (%s)", __func__, p->p_pid, - p->p_comm); TD_CLR_IWAIT(td); sched_add(td, SRQ_INTR); } thread_unlock(td); } -#define MIT_DEAD 4 static void msgring_process(void *arg) { @@ -650,22 +640,17 @@ msgring_process(void *arg) //printf("Started %s on CPU %d\n", __FUNCTION__, ithd->i_cpu); while (1) { - if (ithd->i_flags & MIT_DEAD) { - CTR3(KTR_INTR, "%s: pid %d (%s) exiting", __func__, - p->p_pid, p->p_comm); - kthread_exit(); - } while (ithd->i_pending) { /* * This might need a full read and write barrier to * make sure that this write posts before any of the * memory or device accesses in the handlers. */ - atomic_store_rel_int(&ithd->i_pending, 0); xlr_msgring_handler(NULL); + atomic_store_rel_int(&ithd->i_pending, 0); + enable_msgring_int(NULL); } - enable_msgring_int(NULL); - if (!ithd->i_pending && !(ithd->i_flags & MIT_DEAD)) { + if (!ithd->i_pending) { thread_lock(td); if (ithd->i_pending) { thread_unlock(td);