From owner-freebsd-current@FreeBSD.ORG Fri Apr 14 14:30:15 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 A10C116A404; Fri, 14 Apr 2006 14:30:15 +0000 (UTC) (envelope-from iwasaki@jp.FreeBSD.org) Received: from locore.org (ns01.locore.org [218.45.21.227]) by mx1.FreeBSD.org (Postfix) with ESMTP id DB66A43D45; Fri, 14 Apr 2006 14:30:14 +0000 (GMT) (envelope-from iwasaki@jp.FreeBSD.org) Received: from localhost (ns01.locore.org [218.45.21.227]) by locore.org (8.13.6/8.13.6/iwasaki) with ESMTP/inet id k3EEUDYk026048; Fri, 14 Apr 2006 23:30:13 +0900 (JST) (envelope-from iwasaki@jp.FreeBSD.org) Date: Fri, 14 Apr 2006 23:30:13 +0900 (JST) Message-Id: <20060414.233013.41626908.iwasaki@jp.FreeBSD.org> To: sos@FreeBSD.ORG From: Mitsuru IWASAKI In-Reply-To: <20060414.180622.30189283.iwasaki@jp.FreeBSD.org> References: <20060413.012156.56054177.iwasaki@jp.FreeBSD.org> <443F54DF.3080809@root.org> <20060414.180622.30189283.iwasaki@jp.FreeBSD.org> X-Mailer: Mew version 3.3 on Emacs 20.7 / Mule 4.0 (HANANOEN) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: acpi@freebsd.org, current@freebsd.org Subject: Re: CFR: ACPI Dock driver 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: Fri, 14 Apr 2006 14:30:15 -0000 Hi, Soren. I've found the problem with detached ATA channel suspending. After detaching second channel, the system drops into infinity loop at ata_suspend(). I'll commit the following patches with acpi_dock patches, so please refine these if they have any problem. Thanks Index: ata-all.c =================================================================== RCS file: /home/ncvs/src/sys/dev/ata/ata-all.c,v retrieving revision 1.271 diff -u -r1.271 ata-all.c --- ata-all.c 31 Mar 2006 08:09:04 -0000 1.271 +++ ata-all.c 14 Apr 2006 14:03:24 -0000 @@ -277,6 +277,10 @@ if (!dev || !(ch = device_get_softc(dev))) return ENXIO; + /* if the channel is already detached, skip waiting for IDLE */ + if ((ch->state & ATA_STALL_QUEUE) == ATA_STALL_QUEUE) + goto out; + /* wait for the channel to be IDLE before entering suspend mode */ while (1) { mtx_lock(&ch->state_mtx); @@ -288,6 +292,7 @@ mtx_unlock(&ch->state_mtx); tsleep(ch, PRIBIO, "atasusp", hz/10); } +out: ATA_LOCKING(dev, ATA_LF_UNLOCK); return 0; }