From patchwork Mon Apr 20 04:28:22 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grant Grundler X-Patchwork-Id: 18968 X-Patchwork-Delegate: kyle@mcmartin.ca Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n3K4SP2T011609 for ; Mon, 20 Apr 2009 04:28:25 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750897AbZDTE2Y (ORCPT ); Mon, 20 Apr 2009 00:28:24 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751356AbZDTE2Y (ORCPT ); Mon, 20 Apr 2009 00:28:24 -0400 Received: from complete.lackof.org ([198.49.126.79]:37386 "EHLO complete.lackof.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750897AbZDTE2X (ORCPT ); Mon, 20 Apr 2009 00:28:23 -0400 Received: from localhost (localhost [127.0.0.1]) by complete.lackof.org (Postfix) with ESMTP id B935033E018A; Sun, 19 Apr 2009 22:28:22 -0600 (MDT) X-Virus-Scanned: Debian amavisd-new at lackof.org Received: from complete.lackof.org ([127.0.0.1]) by localhost (complete.lackof.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IQUHKIaaDnU5; Sun, 19 Apr 2009 22:28:22 -0600 (MDT) Received: by complete.lackof.org (Postfix, from userid 27253) id 5809A33E0256; Sun, 19 Apr 2009 22:28:22 -0600 (MDT) Date: Sun, 19 Apr 2009 22:28:22 -0600 From: Grant Grundler To: Kyle McMartin , Helge Deller Cc: linux-parisc@vger.kernel.org Subject: [PATCH] PARISC 2.6.30-rc1 advertise PCI devs after "assign_resources" Message-ID: <20090420042822.GA27021@lackof.org> MIME-Version: 1.0 Content-Disposition: inline X-Home-Page: http://www.parisc-linux.org/ User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org Alex Chiang asked me why PARISC was calling pci_bus_add_devices() and pci_bus_assign_resources() in the opposite order from everyone else. No reason and I couldn't see any data dependency. Patch below applies cleanly to 2.6.30-rc2. Later, I suspected the code worked only because no drivers would be loaded/ready until much later in the system initialization sequence. Tested "LBA" code on J6000 (32-bit) and A500 (64-bit SMP) with 2.6.30-rc2. Not tested with any Dino controllers. Not tested with PCI-PCI Bridge (TBD). Reported-by: Alex Chiang Signed-off-by: Grant Grundler --- Kyle, Helge, Including this into 2.6.31 would be fine since there is no corresponding bug report. I'd prefer sooner if possible but recognize it doesn't have to. thanks! dino.c | 10 +++++----- lba_pci.c | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-parisc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/parisc/dino.c b/drivers/parisc/dino.c index 52ae0b1..d327c2d 100644 --- a/drivers/parisc/dino.c +++ b/drivers/parisc/dino.c @@ -1019,22 +1019,22 @@ static int __init dino_probe(struct parisc_device *dev) ** It's not used to avoid chicken/egg problems ** with configuration accessor functions. */ - bus = pci_scan_bus_parented(&dev->dev, dino_current_bus, - &dino_cfg_ops, NULL); + dino_dev->hba.hba_bus = bus = pci_scan_bus_parented(&dev->dev, + dino_current_bus, &dino_cfg_ops, NULL); + if(bus) { - pci_bus_add_devices(bus); /* This code *depends* on scanning being single threaded * if it isn't, this global bus number count will fail */ dino_current_bus = bus->subordinate + 1; pci_bus_assign_resources(bus); + pci_bus_add_devices(bus); } else { - printk(KERN_ERR "ERROR: failed to scan PCI bus on %s (probably duplicate bus number %d)\n", + printk(KERN_ERR "ERROR: failed to scan PCI bus on %s (duplicate bus number %d?)\n", dev_name(&dev->dev), dino_current_bus); /* increment the bus number in case of duplicates */ dino_current_bus++; } - dino_dev->hba.hba_bus = bus; return 0; } diff --git a/drivers/parisc/lba_pci.c b/drivers/parisc/lba_pci.c index 59fbbf1..f2661e1 100644 --- a/drivers/parisc/lba_pci.c +++ b/drivers/parisc/lba_pci.c @@ -1509,10 +1509,6 @@ lba_driver_probe(struct parisc_device *dev) lba_bus = lba_dev->hba.hba_bus = pci_scan_bus_parented(&dev->dev, lba_dev->hba.bus_num.start, cfg_ops, NULL); - if (lba_bus) { - lba_next_bus = lba_bus->subordinate + 1; - pci_bus_add_devices(lba_bus); - } /* This is in lieu of calling pci_assign_unassigned_resources() */ if (is_pdc_pat()) { @@ -1533,7 +1529,6 @@ lba_driver_probe(struct parisc_device *dev) } pci_enable_bridges(lba_bus); - /* ** Once PCI register ops has walked the bus, access to config ** space is restricted. Avoids master aborts on config cycles. @@ -1543,6 +1538,11 @@ lba_driver_probe(struct parisc_device *dev) lba_dev->flags |= LBA_FLAG_SKIP_PROBE; } + if (lba_bus) { + lba_next_bus = lba_bus->subordinate + 1; + pci_bus_add_devices(lba_bus); + } + /* Whew! Finally done! Tell services we got this one covered. */ return 0; }