From owner-freebsd-current@FreeBSD.ORG Tue Nov 8 19:06:51 2005 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 009A116A41F for ; Tue, 8 Nov 2005 19:06:50 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (vc4-2-0-87.dsl.netrack.net [199.45.160.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id 93EDC43D49 for ; Tue, 8 Nov 2005 19:06:50 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (localhost.village.org [127.0.0.1] (may be forged)) by harmony.bsdimp.com (8.13.3/8.13.3) with ESMTP id jA8J55c1025828; Tue, 8 Nov 2005 12:05:06 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Tue, 08 Nov 2005 12:05:36 -0700 (MST) Message-Id: <20051108.120536.90824853.imp@bsdimp.com> To: thierry@herbelot.com From: "M. Warner Losh" In-Reply-To: <200511081913.15042.thierry@herbelot.com> References: <20051107094655.GA76489@cirb503493.alcatel.com.au> <200511081913.15042.thierry@herbelot.com> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (harmony.bsdimp.com [127.0.0.1]); Tue, 08 Nov 2005 12:05:07 -0700 (MST) Cc: freebsd-current@freebsd.org Subject: Re: Attempting to sleep in interrupts X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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, 08 Nov 2005 19:06:51 -0000 In message: <200511081913.15042.thierry@herbelot.com> Thierry Herbelot writes: : I also see this kind of panic : : fwohci0: fwohci_pci_suspend : panic: trying to sleep while sleeping is prohibited The root of this problem is: ... : bus_generic_suspend(c1d6f000,3,1,101dc70,0) at bus_generic_suspend+0x4a : acpi_SetSleepState(c1dd2080,3,0,cb70dc38,c0660a63) at acpi_SetSleepState+0x16a : acpi_pm_func(0,c1dd2080,1,cb70dc80,c07e8d47) at acpi_pm_func+0x3a : power_pm_suspend(1) at power_pm_suspend+0x23 : scgetc(c1f88800,2,c0669865,c1e7a900,c0997fa0) at scgetc+0x4ef : sckbdevent(c0997fa0,0,c1f88800) at sckbdevent+0x1c8 : atkbd_intr(c0997fa0,0,cb70dcec,c0632c9a,c0997fa0) at atkbd_intr+0x20 : atkbdintr(c0997fa0) at atkbdintr+0x16 We're calling the entire suspend chain from an interrupt handler. Granted, this interrupt hanlder is in an ithread, but we still prohibit sleeping there. The solution is to have power_pm_suspend call the callback function using a taskqueue. Warner