From owner-freebsd-current@FreeBSD.ORG Thu Jul 13 06:07:13 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 E4B0516A4E6 for ; Thu, 13 Jul 2006 06:07:13 +0000 (UTC) (envelope-from nate@root.org) Received: from ylpvm15.prodigy.net (ylpvm15-ext.prodigy.net [207.115.57.46]) by mx1.FreeBSD.org (Postfix) with ESMTP id 727B643D55 for ; Thu, 13 Jul 2006 06:07:13 +0000 (GMT) (envelope-from nate@root.org) Received: from pimout6-ext.prodigy.net (pimout6-int.prodigy.net [207.115.4.22]) by ylpvm15.prodigy.net (8.12.10 outbound/8.12.10) with ESMTP id k6D67DEs015886 for ; Thu, 13 Jul 2006 02:07:13 -0400 X-ORBL: [71.139.3.149] Received: from [10.0.5.51] (ppp-71-139-3-149.dsl.snfc21.pacbell.net [71.139.3.149]) by pimout6-ext.prodigy.net (8.13.6 out.dk/8.13.6) with ESMTP id k6D67B7h234076; Thu, 13 Jul 2006 02:07:11 -0400 Message-ID: <44B5E300.6000800@root.org> Date: Wed, 12 Jul 2006 23:06:56 -0700 From: Nate Lawson User-Agent: Thunderbird 1.5.0.2 (X11/20060501) MIME-Version: 1.0 To: Sam Leffler References: <44B59A22.7000407@root.org> <44B5A2A3.2070702@errno.com> In-Reply-To: <44B5A2A3.2070702@errno.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed 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 06:07:14 -0000 Sam Leffler wrote: > 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. Thanks, I'll look into that. The relevant card is: ath_hal: 0.9.17.2 (AR5210, AR5211, AR5212, RF5111, RF5112, RF2413, RF5413) ath0: mem 0xc0210000-0xc021ffff at device 0.0 on cardbus1 ath0: mac 7.9 phy 4.5 radio 5.6 The interrupt is shared with: vgapci0: mem 0xc0100000-0xc017ffff,0xe8000000-0xebffffff,0xe4000000-0xe7ffffff,0xe0000000-0xe1ffffff irq 11 at device 0.0 on pci1 cbb0: mem 0x50000000-0x50000fff irq 11 at device 0.0 on pci2 cbb1: mem 0x51000000-0x51000fff irq 11 at device 0.1 on pci2 fxp0: port 0x6000-0x603f mem 0xc0200000-0xc0200fff irq 11 at device 8.0 on pci2 ichsmb0: port 0x1880-0x189f irq 11 at device 31.3 on pci0 pcm0: port 0x1c00-0x1cff,0x18c0-0x18ff irq 11 at device 31.5 on pci0 -- Nate