From owner-svn-src-head@FreeBSD.ORG Sun Sep 4 13:07:02 2011 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 E998E1065672; Sun, 4 Sep 2011 13:07:02 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BB8408FC12; Sun, 4 Sep 2011 13:07:02 +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 p84D72Ft092464; Sun, 4 Sep 2011 13:07:02 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p84D72GY092462; Sun, 4 Sep 2011 13:07:02 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201109041307.p84D72GY092462@svn.freebsd.org> From: Attilio Rao Date: Sun, 4 Sep 2011 13:07:02 +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: r225372 - head/sys/kern 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: Sun, 04 Sep 2011 13:07:03 -0000 Author: attilio Date: Sun Sep 4 13:07:02 2011 New Revision: 225372 URL: http://svn.freebsd.org/changeset/base/225372 Log: Interrupts are disabled/enabled when entering and exiting the KDB context. While this is generally good, it brings along a serie of problems, like clocks going off sync and in presence of SW_WATCHDOG, watchdogs firing without a good reason (missed hardclock wdog ticks update). Fix the latter by kicking the watchdog just before to re-enable the interrupts. Also, while here, not rely on users to stop the watchdog manually when entering DDB but do that when entering KDB context. Sponsored by: Sandvine Incorporated Reviewed by: emaste, rstone Approved by: re (kib) MFC after: 1 week Modified: head/sys/kern/subr_kdb.c Modified: head/sys/kern/subr_kdb.c ============================================================================== --- head/sys/kern/subr_kdb.c Sun Sep 4 05:04:34 2011 (r225371) +++ head/sys/kern/subr_kdb.c Sun Sep 4 13:07:02 2011 (r225372) @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$"); #include "opt_kdb.h" #include "opt_stack.h" +#include "opt_watchdog.h" #include #include @@ -41,6 +42,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef SW_WATCHDOG +#include +#endif #include #include @@ -587,6 +591,9 @@ kdb_trap(int type, int code, struct trap cpuset_t other_cpus; #endif struct kdb_dbbe *be; +#ifdef SW_WATCHDOG + u_int wdoglvt; +#endif register_t intr; int handled; @@ -600,6 +607,10 @@ kdb_trap(int type, int code, struct trap intr = intr_disable(); +#ifdef SW_WATCHDOG + wdoglvt = wdog_kern_last_timeout(); + wdog_kern_pat(WD_TO_NEVER); +#endif #ifdef SMP other_cpus = all_cpus; CPU_CLR(PCPU_GET(cpuid), &other_cpus); @@ -631,6 +642,9 @@ kdb_trap(int type, int code, struct trap #ifdef SMP restart_cpus(stopped_cpus); #endif +#ifdef SW_WATCHDOG + wdog_kern_pat(wdoglvt); +#endif intr_restore(intr);