From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=42934 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PLnr6-0007qH-8W for qemu-devel@nongnu.org; Thu, 25 Nov 2010 21:16:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PLnr5-00059k-0G for qemu-devel@nongnu.org; Thu, 25 Nov 2010 21:16:08 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55922) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PLnr4-00059N-Pa for qemu-devel@nongnu.org; Thu, 25 Nov 2010 21:16:06 -0500 Date: Fri, 26 Nov 2010 00:15:12 -0200 From: Marcelo Tosatti Subject: Re: [Qemu-devel] [patch 0/2] USB UHCI global suspend / remote wakeup Message-ID: <20101126021512.GA18020@amt.cnet> References: <20101125170439.548474575@redhat.com> <201011260038.29290.paul@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201011260038.29290.paul@codesourcery.com> Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paul Brook Cc: Matthew Garrett , kvm , qemu-devel@nongnu.org, Glauber de Oliveira Costa , Adam Jackson , Gerd Hoffmann On Fri, Nov 26, 2010 at 12:38:28AM +0000, Paul Brook wrote: > > This patch enables USB UHCI global suspend/resume feature. The OS wil= l > > stop the HC once all ports are suspended. If there is activity on the > > port(s), an interrupt signalling remote wakeup will be triggered. >=20 > I'm pretty sure this is wrong. Suspend/resume works based on physical=20 > topology, i.e. the resume notification should go to the the port/hub to= which=20 > the device is connected, not directly to the host controller. If the host controller is in global suspend state, and resume is received on any of its root hub ports (given that remote wakeup is enabled for the given port), the system will be interrupted if interrupt enable bit is set. 2.1.2 USB STATUS REGISTER I/O Address: Base + (02-03h) Default Value: 0000h Attribute: Read/Write Clear size: 16 bits This register indicates pending interrupts and various states of the Host Controller Resume Detect. The Host Controller sets this bit to 1 when it receives a =E2=80=9CRESUME=E2=80=9D signal from a USB device. This is only valid i= f the Host Controller is in a global suspend state (bit 3 of Command register =3D 1). 2.1.7.1 Behavior Under Global or Selective Suspend Scenarios Resume will be recognized in the USBSTS register (bit 2) if resume is received on a suspended or enabled port when the Host Controller is in the global suspend state (USBCMD register bit 3 is set). 4.2.1 RESUME RECEIVED This event indicates that the HC received a RESUME signal from a device on the USB during a global suspend. If this interrupt is enabled in the HC Interrupt Enable register, a hardware interrupt will be signaled to the system allowing the USB to be brought out of the suspend state and returned to normal operation. You are correct in that USB HUB emulation does not propagate resume, but this does not make this patch incorrect.