From patchwork Fri Jul 6 14:53:39 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 169481 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 214FE2C01D3 for ; Sat, 7 Jul 2012 00:53:24 +1000 (EST) Received: from localhost ([::1]:52433 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sn9uM-0008Qs-3D for incoming@patchwork.ozlabs.org; Fri, 06 Jul 2012 10:53:22 -0400 Received: from eggs.gnu.org ([208.118.235.92]:57863) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sn9uE-0008Qc-Oz for qemu-devel@nongnu.org; Fri, 06 Jul 2012 10:53:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sn9u8-0000dx-1h for qemu-devel@nongnu.org; Fri, 06 Jul 2012 10:53:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:31210) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sn9u7-0000dj-Q6 for qemu-devel@nongnu.org; Fri, 06 Jul 2012 10:53:07 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q66Er6E1017044 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 6 Jul 2012 10:53:06 -0400 Received: from shalem.localdomain.com (vpn1-4-220.ams2.redhat.com [10.36.4.220]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q66Er44E013014; Fri, 6 Jul 2012 10:53:05 -0400 From: Hans de Goede To: Gerd Hoffmann Date: Fri, 6 Jul 2012 16:53:39 +0200 Message-Id: <1341586419-32625-1-git-send-email-hdegoede@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: Hans de Goede , qemu-devel@nongnu.org, kvm@vger.kernel.org Subject: [Qemu-devel] [PATCH] ehci: Kick async schedule on wakeup in the non companion case 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Commit 0f588df8b3688b00e77aabaa32e26ece5f19bd39, added code to ehci_wakeup to kick the async schedule on wakeup, but the else was positioned wrong making it trigger for devices which are routed to the companion rather then to the ehci controller itself. This patch fixes this. Note that the "programming style" with using the return at the end of the companion block matches how the companion case is handled in the other ports ops, and is done this way for consistency. Signed-off-by: Hans de Goede --- hw/usb/hcd-ehci.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c index 401ccec..b68a8ce 100644 --- a/hw/usb/hcd-ehci.c +++ b/hw/usb/hcd-ehci.c @@ -852,10 +852,11 @@ static void ehci_wakeup(USBPort *port) USBPort *companion = s->companion_ports[port->index]; if (companion->ops->wakeup) { companion->ops->wakeup(companion); - } else { - qemu_bh_schedule(s->async_bh); } + return; } + + qemu_bh_schedule(s->async_bh); } static int ehci_register_companion(USBBus *bus, USBPort *ports[],