From patchwork Wed Oct 17 18:25:47 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Williamson X-Patchwork-Id: 192116 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 B8BD82C0097 for ; Thu, 18 Oct 2012 05:26:04 +1100 (EST) Received: from localhost ([::1]:39595 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOYJd-0005dg-GC for incoming@patchwork.ozlabs.org; Wed, 17 Oct 2012 14:26:01 -0400 Received: from eggs.gnu.org ([208.118.235.92]:43087) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOYJT-0005d3-9w for qemu-devel@nongnu.org; Wed, 17 Oct 2012 14:25:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TOYJS-0006l7-2b for qemu-devel@nongnu.org; Wed, 17 Oct 2012 14:25:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:28255) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOYJR-0006l1-Q2 for qemu-devel@nongnu.org; Wed, 17 Oct 2012 14:25:49 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q9HIPmCC018349 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 17 Oct 2012 14:25:48 -0400 Received: from bling.home (ovpn-113-170.phx2.redhat.com [10.3.113.170]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q9HIPlrp022704; Wed, 17 Oct 2012 14:25:48 -0400 From: Alex Williamson To: mst@redhat.com Date: Wed, 17 Oct 2012 12:25:47 -0600 Message-ID: <20121017182413.28445.77012.stgit@bling.home> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: jan.kiszka@siemens.com, alex.williamson@redhat.com, qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH] pci: Return PCI_INTX_DISABLED when no bus INTx routing support 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 Rather than assert, simply return PCI_INTX_DISABLED when we don't have a pci_route_irq_fn. PIIX already returns DISABLED for an invalid pin, so users already deal with this state. Users of this interface should only be acting on an ENABLED or INVERTED return value (though we really have no support for INVERTED). Signed-off-by: Alex Williamson --- A compromise to the gridlock; defuse the assert, but don't add a new state to the API. Thanks, Alex hw/pci.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hw/pci.c b/hw/pci.c index 83d262a..9525220 100644 --- a/hw/pci.c +++ b/hw/pci.c @@ -1094,7 +1094,11 @@ PCIINTxRoute pci_device_route_intx_to_irq(PCIDevice *dev, int pin) pin = bus->map_irq(dev, pin); dev = bus->parent_dev; } while (dev); - assert(bus->route_intx_to_irq); + + if (!bus->route_intx_to_irq) { + return (PCIINTxRoute) { PCI_INTX_DISABLED, -1 }; + } + return bus->route_intx_to_irq(bus->irq_opaque, pin); }