From patchwork Tue Jan 19 11:44:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 8061041 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5CE819F818 for ; Tue, 19 Jan 2016 11:45:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C6EA920397 for ; Tue, 19 Jan 2016 11:45:41 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9B3AE20382 for ; Tue, 19 Jan 2016 11:45:40 +0000 (UTC) Received: from localhost ([::1]:36341 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLUjE-0005O9-44 for patchwork-qemu-devel@patchwork.kernel.org; Tue, 19 Jan 2016 06:45:40 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46030) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLUiX-0004b5-Dp for qemu-devel@nongnu.org; Tue, 19 Jan 2016 06:44:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aLUiT-00015z-9O for qemu-devel@nongnu.org; Tue, 19 Jan 2016 06:44:57 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39306) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLUiT-00015u-4Q; Tue, 19 Jan 2016 06:44:53 -0500 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 B27F4C0BF2AC; Tue, 19 Jan 2016 11:44:52 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-56.ams2.redhat.com [10.36.116.56]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u0JBipt1016754; Tue, 19 Jan 2016 06:44:52 -0500 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id 29B4480756; Tue, 19 Jan 2016 12:44:51 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 19 Jan 2016 12:44:44 +0100 Message-Id: <1453203884-4125-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Andrey Korolyov , Gerd Hoffmann , qemu-stable@nongnu.org Subject: [Qemu-devel] [PATCH] ehci: update irq on reset X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP After clearing the status register we also have to update the irq line status. Otherwise a irq which happends to be pending at reset time causes a interrupt storm. And the guest can't stop as the status register doesn't indicate any pending interrupt. Both NetBSD and FreeBSD hang on shutdown because of that. Cc: qemu-stable@nongnu.org Reported-by: Andrey Korolyov Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-ehci.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c index d07f228..d2b7fa2 100644 --- a/hw/usb/hcd-ehci.c +++ b/hw/usb/hcd-ehci.c @@ -865,6 +865,7 @@ void ehci_reset(void *opaque) s->usbsts = USBSTS_HALT; s->usbsts_pending = 0; s->usbsts_frindex = 0; + ehci_update_irq(s); s->astate = EST_INACTIVE; s->pstate = EST_INACTIVE;