From patchwork Thu Jan 23 20:59:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Noever X-Patchwork-Id: 3531751 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 42DEFC02DC for ; Thu, 23 Jan 2014 21:00:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3C43E201C0 for ; Thu, 23 Jan 2014 21:00:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1BE9E201BB for ; Thu, 23 Jan 2014 21:00:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754470AbaAWVAG (ORCPT ); Thu, 23 Jan 2014 16:00:06 -0500 Received: from mail-wg0-f41.google.com ([74.125.82.41]:52045 "EHLO mail-wg0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754379AbaAWVAE (ORCPT ); Thu, 23 Jan 2014 16:00:04 -0500 Received: by mail-wg0-f41.google.com with SMTP id n12so1117393wgh.0 for ; Thu, 23 Jan 2014 13:00:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=2MukInyM3ZWH/DQ6K0072sB5VCF7yPXGHtsxbQBD72k=; b=VdY4sB3BJTLLJ+Ak6Dcle9q7eYkVicudT4FRGi/ONAEMYS8aqmCfvG+YWLmBdUjEf0 6CNdsXRCjX4Ns8ZOcj03AxCedBTQktiG2km1+RucAAXLpfV5FSiALRQ7VO3sB/dOQiFp OLYgCT4PKzZ0jRQ0/+/QdtvoEvERSnncFKJtcLr4JCkNnT2oyGpepH5ILGBX17gpwChs vdLqHXoT2/6sGvV3DZRUB/HqbjeRdGlqZxHyQ6vnS5Km/Zaai+Y96kSTan36NSvaH0Ba xW4vUp2zA/CPpIEf6dnW5Y5G6V5yj/54UnwRHfunsSDDbaktc6PJfuYfb1kHfdjdYrzz Rv0g== X-Received: by 10.180.74.200 with SMTP id w8mr697139wiv.58.1390510803271; Thu, 23 Jan 2014 13:00:03 -0800 (PST) Received: from localhost.localdomain (77-58-151-250.dclient.hispeed.ch. [77.58.151.250]) by mx.google.com with ESMTPSA id ux5sm25371408wjc.6.2014.01.23.13.00.02 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 23 Jan 2014 13:00:02 -0800 (PST) From: Andreas Noever To: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, bhelgaas@google.com Cc: Andreas Noever Subject: [PATCH 6/8] PCI: Remove pci_fixup_parent_subordinate_busnr. Date: Thu, 23 Jan 2014 21:59:26 +0100 Message-Id: <1390510768-5652-7-git-send-email-andreas.noever@gmail.com> X-Mailer: git-send-email 1.8.5.3 In-Reply-To: <1390510768-5652-1-git-send-email-andreas.noever@gmail.com> References: <1390510768-5652-1-git-send-email-andreas.noever@gmail.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The function has no effect. If pcibios_assign_all_busses() is not set then the function does nothing. If it is set then in pci_scan_bridge we are always in the branch where we assign the bus numbers ourselves and the subordinate values of all parent busses will be set to 0xff since that is what they inherited from their parent bus and ultimately from the root bus. Signed-off-by: Andreas Noever --- drivers/pci/probe.c | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 42ee0c0..90d5c48 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -731,22 +731,6 @@ struct pci_bus *__ref pci_add_new_bus(struct pci_bus *parent, struct pci_dev *de return child; } -static void pci_fixup_parent_subordinate_busnr(struct pci_bus *child, int max) -{ - struct pci_bus *parent = child->parent; - - /* Attempts to fix that up are really dangerous unless - we're going to re-assign all bus numbers. */ - if (!pcibios_assign_all_busses()) - return; - - while (parent->parent && parent->busn_res.end < max) { - parent->busn_res.end = max; - pci_write_config_byte(parent->self, PCI_SUBORDINATE_BUS, max); - parent = parent->parent; - } -} - /* * If it's a bridge, configure it and scan the bus behind it. * For CardBus bridges, we don't scan behind as the devices will @@ -879,20 +863,7 @@ int pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max, int pass) if (!is_cardbus) { child->bridge_ctl = bctl; - /* - * Adjust subordinate busnr in parent buses. - * We do this before scanning for children because - * some devices may not be detected if the bios - * was lazy. - */ - pci_fixup_parent_subordinate_busnr(child, max); - /* Now we can scan all subordinate buses... */ max = pci_scan_child_bus(child); - /* - * now fix it up again since we have found - * the real value of max. - */ - pci_fixup_parent_subordinate_busnr(child, max); } else { /* * For CardBus bridges, we leave 4 bus numbers @@ -923,7 +894,6 @@ int pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max, int pass) } } max += i; - pci_fixup_parent_subordinate_busnr(child, max); } /* * Set the subordinate bus number to its real value.