From patchwork Tue Jul 6 11:23:27 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 57999 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 65437B6EDF for ; Tue, 6 Jul 2010 21:34:42 +1000 (EST) Received: from localhost ([127.0.0.1]:50592 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OW6Ld-0002Ln-3J for incoming@patchwork.ozlabs.org; Tue, 06 Jul 2010 07:29:57 -0400 Received: from [140.186.70.92] (port=46039 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OW6KP-0001qq-5n for qemu-devel@nongnu.org; Tue, 06 Jul 2010 07:28:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OW6KO-00059v-1h for qemu-devel@nongnu.org; Tue, 06 Jul 2010 07:28:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52961) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OW6KN-00059h-RP for qemu-devel@nongnu.org; Tue, 06 Jul 2010 07:28:40 -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.13.8/8.13.8) with ESMTP id o66BSbZp015894 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 6 Jul 2010 07:28:37 -0400 Received: from redhat.com (vpn1-4-106.ams2.redhat.com [10.36.4.106]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with SMTP id o66BSZ3l011331; Tue, 6 Jul 2010 07:28:36 -0400 Date: Tue, 6 Jul 2010 14:23:27 +0300 From: "Michael S. Tsirkin" To: yamahata@valinux.co.jp, qemu-devel@nongnu.org Message-ID: <20100706112327.GA20108@redhat.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-12-10) 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. Cc: Subject: [Qemu-devel] [PATCH] pci: pass bridge update to secondary bus X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org bridge config write should trigger updates on the secondary bus. never on the primary bus. Signed-off-by: Michael S. Tsirkin --- Compile-tested only. Isaku Yamahata, could you review this please? You wrote the code, and you seem to have some bridged setups. hw/pci.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/hw/pci.c b/hw/pci.c index 926cf63..011d83e 100644 --- a/hw/pci.c +++ b/hw/pci.c @@ -1513,7 +1513,9 @@ static void pci_bridge_write_config(PCIDevice *d, /* memory base/limit, prefetchable base/limit and io base/limit upper 16 */ ranges_overlap(address, len, PCI_MEMORY_BASE, 20)) { - pci_bridge_update_mappings(d->bus); + PCIBridge *s = container_of(d, PCIBridge, dev); + PCIBus *secondary_bus = &s->bus; + pci_bridge_update_mappings(secondary_bus); } }