From owner-freebsd-current@FreeBSD.ORG Thu Jul 13 01:32:21 2006 Return-Path: X-Original-To: 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 359BA16A4DA for ; Thu, 13 Jul 2006 01:32:21 +0000 (UTC) (envelope-from sam@errno.com) Received: from ebb.errno.com (ebb.errno.com [69.12.149.25]) by mx1.FreeBSD.org (Postfix) with ESMTP id D7CF343D4C for ; Thu, 13 Jul 2006 01:32:20 +0000 (GMT) (envelope-from sam@errno.com) Received: from [10.0.0.248] (trouble.errno.com [10.0.0.248]) (authenticated bits=0) by ebb.errno.com (8.13.6/8.12.6) with ESMTP id k6D1WJM2005698 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 12 Jul 2006 18:32:20 -0700 (PDT) (envelope-from sam@errno.com) Message-ID: <44B5A2A3.2070702@errno.com> Date: Wed, 12 Jul 2006 18:32:19 -0700 From: Sam Leffler User-Agent: Thunderbird 1.5.0.2 (X11/20060508) MIME-Version: 1.0 To: Nate Lawson References: <44B59A22.7000407@root.org> In-Reply-To: <44B59A22.7000407@root.org> X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: current Subject: Re: cbb hangs during suspend if ath card active 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: Thu, 13 Jul 2006 01:32:21 -0000 Nate Lawson wrote: > I've seen a recent regression in the past few months when suspending my > laptop. When I have an ath0 card inserted in a cardbus slot and then > press the sleep button, the system hangs. If I eject the card, it > continues going into suspend and everything works as normal. > > If the card is up (ifconfig up), this process hangs. If it's down, no > hang and it suspends normally. I did some debugging by starting the > suspend, waiting for the hang, hitting "break to ddb", and then ejecting > the card. The eject causes an interrupt which causes ddb to be entered. > With ps, I can see that the thread on the acpi_taskq is running the > button event and then calling bus_generic_suspend(), which eventually > calls cbb_detach(), which then calls a power routine in pccbb.c. This > routine calls tsleep() (wchan "cbbP3") which never wakes up. > > Any idea why tsleep() is not waking up now? It seems tsleep() calls > mi_switch() and never returns. > A more likely scenario is that ath_stop is putting the card into "deep sleep". At that point you cannot touch any of the PCI domain registers for the card w/o bringing it out of sleep. If you do then the pci/cardbus will hang. Ejecting the card removes the device from the bus and allows things to continue. I walked through this scenario with Ed Maste when he mentioned it to me and we tried to catch ath being entered after it set the card to sleep but failed. Note that something as simple as checking for ath_intrpend at the top of ath_intr can cause this but after shuffling code to ensure this does not occur we still couldn't catch what was going on. My suggestion is you work under the above assumption and try to catch entry to the ath driver. I still think the problem is a shared irq interrupting after ath_stop puts the card to sleep. Sam