From patchwork Thu Feb 28 18:49:01 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Williamson X-Patchwork-Id: 224136 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 CACF22C02BE for ; Fri, 1 Mar 2013 05:49:23 +1100 (EST) Received: from localhost ([::1]:51007 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UB8Xh-0006Gy-Se for incoming@patchwork.ozlabs.org; Thu, 28 Feb 2013 13:49:21 -0500 Received: from eggs.gnu.org ([208.118.235.92]:45736) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UB8XQ-0006Gq-Bf for qemu-devel@nongnu.org; Thu, 28 Feb 2013 13:49:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UB8XP-0001z4-84 for qemu-devel@nongnu.org; Thu, 28 Feb 2013 13:49:04 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33697) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UB8XO-0001yg-V7 for qemu-devel@nongnu.org; Thu, 28 Feb 2013 13:49:03 -0500 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 r1SIn1uf017127 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 28 Feb 2013 13:49:02 -0500 Received: from bling.home (ovpn-113-27.phx2.redhat.com [10.3.113.27]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r1SIn11u022500; Thu, 28 Feb 2013 13:49:01 -0500 To: mst@redhat.com From: Alex Williamson Date: Thu, 28 Feb 2013 11:49:01 -0700 Message-ID: <20130228184803.23865.84744.stgit@bling.home> User-Agent: StGit/0.16 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH] ioh3420: Add a map_irq function 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 Every bridge needs to know how to map IRQs from it's secondary bus to the primary bus. We seem to be direct mapped on ioh3420. This avoids segfaults when trying to put assigned devices behind root ports. Signed-off-by: Alex Williamson --- hw/ioh3420.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hw/ioh3420.c b/hw/ioh3420.c index 95bceb5..6ac4fe7 100644 --- a/hw/ioh3420.c +++ b/hw/ioh3420.c @@ -90,6 +90,11 @@ static void ioh3420_reset(DeviceState *qdev) pci_bridge_disable_base_limit(d); } +static int ioh3420_map_irq(PCIDevice *pci_dev, int irq_num) +{ + return irq_num; +} + static int ioh3420_initfn(PCIDevice *d) { PCIBridge* br = DO_UPCAST(PCIBridge, dev, d); @@ -97,6 +102,8 @@ static int ioh3420_initfn(PCIDevice *d) PCIESlot *s = DO_UPCAST(PCIESlot, port, p); int rc; + pci_bridge_map_irq(br, NULL, ioh3420_map_irq); + rc = pci_bridge_initfn(d); if (rc < 0) { return rc;