From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37174) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zoo7z-00056O-Ix for qemu-devel@nongnu.org; Wed, 21 Oct 2015 03:48:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zoo7u-0006lz-1M for qemu-devel@nongnu.org; Wed, 21 Oct 2015 03:48:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55723) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zoo7t-0006lP-QH for qemu-devel@nongnu.org; Wed, 21 Oct 2015 03:48:01 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 0F788AED7F for ; Wed, 21 Oct 2015 07:48:01 +0000 (UTC) References: <1445413462-18004-1-git-send-email-kraxel@redhat.com> From: Hans de Goede Message-ID: <5627432C.5000700@redhat.com> Date: Wed, 21 Oct 2015 09:47:56 +0200 MIME-Version: 1.0 In-Reply-To: <1445413462-18004-1-git-send-email-kraxel@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] ehci: clear suspend bit on detach List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann , qemu-devel@nongnu.org Hi, On 21-10-15 09:44, Gerd Hoffmann wrote: > When a device is detached, clear the suspend bit (PORTSC_SUSPEND) > in the port status register. > > The specs are not *that* clear what is supposed to happen in case > a suspended device is unplugged. But the enable bit (PORTSC_PED) > is cleared, and the specs mention setting suspend with enable being > unset is undefined behavior. So clearing them both looks reasonable, > and it actually fixes the reported bug. > > https://bugzilla.redhat.com/show_bug.cgi?id=1268879 > > Cc: Hans de Goede > Signed-off-by: Gerd Hoffmann Thanks for fixing this. Patch looks good to me: Reviewed-by: Hans de Goede Regards, Hans > --- > hw/usb/hcd-ehci.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c > index 64a54c6..4e2161b 100644 > --- a/hw/usb/hcd-ehci.c > +++ b/hw/usb/hcd-ehci.c > @@ -726,7 +726,7 @@ static void ehci_detach(USBPort *port) > ehci_queues_rip_device(s, port->dev, 0); > ehci_queues_rip_device(s, port->dev, 1); > > - *portsc &= ~(PORTSC_CONNECT|PORTSC_PED); > + *portsc &= ~(PORTSC_CONNECT|PORTSC_PED|PORTSC_SUSPEND); > *portsc |= PORTSC_CSC; > > ehci_raise_irq(s, USBSTS_PCD); >