From owner-freebsd-current@FreeBSD.ORG Tue Sep 17 10:21:20 2013 Return-Path: Delivered-To: current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 3BA552BE for ; Tue, 17 Sep 2013 10:21:20 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B9C792B9F for ; Tue, 17 Sep 2013 10:21:18 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.7/8.14.7) with ESMTP id r8HALArY084110 for ; Tue, 17 Sep 2013 14:21:10 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.7/8.14.7/Submit) id r8HALAET084109 for current@FreeBSD.org; Tue, 17 Sep 2013 14:21:10 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 17 Sep 2013 14:21:10 +0400 From: Gleb Smirnoff To: current@FreeBSD.org Subject: ipmi patch for review Message-ID: <20130917102110.GK4574@glebius.int.ru> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="qndya+I13rh6QJ0p" Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Sep 2013 10:21:20 -0000 --qndya+I13rh6QJ0p Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi! When system is writing a kernel core dump, it issues watchdog pat wdog_kern_pat(WD_LASTVAL). If ipmi is in action, it registers ipmi_wd_event() as event for watchdog. Thus ipmi_wd_event() is called in dumping context. The problem is that ipmi_wd_event() calls into ipmi_set_watchdog(), that calls into ipmi_alloc_request(), which uses M_WAITOK and thus sleeps. This is a smaller problem, since can be converted to M_NOWAIT. But ipmi_set_watchdog() then calls into ipmi_submit_driver_request(), which calls msleep() any time. The attached patch allows me to successfully write cores in presence of IPMI. -- Totus tuus, Glebius. --qndya+I13rh6QJ0p Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="ipmi.c.diff" Index: dev/ipmi/ipmi.c =================================================================== --- dev/ipmi/ipmi.c (revision 255625) +++ dev/ipmi/ipmi.c (working copy) @@ -647,6 +647,9 @@ ipmi_wd_event(void *arg, unsigned int cmd, int *er unsigned int timeout; int e; + if (dumping) + return; + cmd &= WD_INTERVAL; if (cmd > 0 && cmd <= 63) { timeout = ((uint64_t)1 << cmd) / 1000000000; --qndya+I13rh6QJ0p--