From owner-freebsd-usb@FreeBSD.ORG Tue Mar 27 16:54:59 2007 Return-Path: X-Original-To: freebsd-usb@freebsd.org Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BFD6D16A534 for ; Tue, 27 Mar 2007 16:54:59 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe08.swip.net [212.247.154.225]) by mx1.freebsd.org (Postfix) with ESMTP id 5C13113C43E for ; Tue, 27 Mar 2007 16:54:58 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] Received: from [193.217.102.48] (account mc467741@c2i.net HELO [10.0.0.249]) by mailfe08.swip.net (CommuniGate Pro SMTP 5.1.7) with ESMTPA id 447854395; Tue, 27 Mar 2007 18:54:57 +0200 From: Hans Petter Selasky To: freebsd-usb@freebsd.org Date: Tue, 27 Mar 2007 18:54:38 +0200 User-Agent: KMail/1.9.5 References: <20070327095301.GA1439@shorty.sorbonet.org> In-Reply-To: <20070327095301.GA1439@shorty.sorbonet.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200703271854.38239.hselasky@c2i.net> Cc: Andrea Bittau Subject: Re: fix uhci suspend X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Mar 2007 16:54:59 -0000 On Tuesday 27 March 2007 11:53, Andrea Bittau wrote: > To suspend, you need to: > 1) stop the controller > 2) set the global suspend bit > > The current code does: > cmd = UREAD2(sc, UHCI_CMD); > ... > uhci_run(sc, 0); /* stop the controller */ > ... > UHCICMD(sc, cmd | UHCI_CMD_EGSM); /* enter global suspend */ > > The problem is that cmd is not re-read after stopping the controller, so > cmd will still have the run bit set to 1 instead of 0. Thus, when entering > suspend, the controller's run bit will be put back to 1 and the controller > will freak out. The attached patch fixes this. I don't know if the resume > branch of the code suffers from this problem too---I'm working on suspend > for now. With my patch, I can get ICH7 82801G to suspend, otherwise, > suspend would just hang the box. That is correctly noticed. In my new USB stack I simply do: /* enter global suspend */ UHCICMD(sc, UHCI_CMD_EGSM); Clearing all other bits. Could you have tried the SVN version of the new USB stack and see if suspend/resume works there? http://www.turbocat.net/~hselasky/usb4bsd --HPS