Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Mar 2007 18:54:38 +0200
From:      Hans Petter Selasky <hselasky@c2i.net>
To:        freebsd-usb@freebsd.org
Cc:        Andrea Bittau <a.bittau@cs.ucl.ac.uk>
Subject:   Re: fix uhci suspend
Message-ID:  <200703271854.38239.hselasky@c2i.net>
In-Reply-To: <20070327095301.GA1439@shorty.sorbonet.org>
References:  <20070327095301.GA1439@shorty.sorbonet.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200703271854.38239.hselasky>