From patchwork Fri Nov 7 01:14:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Duc Dang X-Patchwork-Id: 5249111 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 7B4DDC11AC for ; Fri, 7 Nov 2014 01:12:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B261020125 for ; Fri, 7 Nov 2014 01:12:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3B02D20121 for ; Fri, 7 Nov 2014 01:12:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750998AbaKGBMX (ORCPT ); Thu, 6 Nov 2014 20:12:23 -0500 Received: from exprod5og108.obsmtp.com ([64.18.0.186]:44992 "HELO exprod5og108.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1751121AbaKGBMW (ORCPT ); Thu, 6 Nov 2014 20:12:22 -0500 Received: from mail-pa0-f53.google.com ([209.85.220.53]) (using TLSv1) by exprod5ob108.postini.com ([64.18.4.12]) with SMTP ID DSNKVFwcdldn4jhOZ8S2hhxbjwITTSlcu5Vu@postini.com; Thu, 06 Nov 2014 17:12:22 PST Received: by mail-pa0-f53.google.com with SMTP id kx10so2372744pab.26 for ; Thu, 06 Nov 2014 17:12:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=rKOidjv7IvrObP+yCQ7iROVwJB3siT/o2h7yXAlMb4g=; b=HUy8XMFIYt7rO4lB260hyRBdSq4M4KQMrW6sVE29cibk0/oD7Ot8FH39YayicdJtLD fTGQtZ1b7kK0vw0eecIM8CBKiu1+umdFhZoS27SnbXEmuzLRdSmUz2QhoOnZ+vTbynBH TBaByRkif9PEQBQONujkRYDbPO52XMrngJTZNwH2qpx1kYlp/pno7hFlxL2wvY3lAyh9 URV7NZ0lY9VmLyL4Eovt8ffSk7QB+7vn5QdDgRjC1mwG/c0ffTtINstQKwKtwzMuRl/7 5jN3UBPCKChR311fpLA1IIcLiD/Cuos4pmtakw2jVqx3SUrPRB4r9NA9RLNrtd44EzrF cQqA== X-Gm-Message-State: ALoCoQm35BTON0fdttxJmrRAe+drrsA74hk2oUI2eaY8tYa6fFRk20OxESuNMBicfwfmyqYorHSmcgqIIzyiVvb6PWmLBbZSM0ZeO4b1cowPN6ETeuakc+kACgc98s94VQCUehBvvVVj8gh8SVvZYBI+4tWvVDI8TA== X-Received: by 10.66.254.136 with SMTP id ai8mr8427454pad.76.1415322741990; Thu, 06 Nov 2014 17:12:21 -0800 (PST) X-Received: by 10.66.254.136 with SMTP id ai8mr8427438pad.76.1415322741872; Thu, 06 Nov 2014 17:12:21 -0800 (PST) Received: from amcclab162.amcc.com (67-207-112-226.static.wiline.com. [67.207.112.226]) by mx.google.com with ESMTPSA id nb5sm7028154pbc.25.2014.11.06.17.12.19 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 06 Nov 2014 17:12:20 -0800 (PST) From: Duc Dang To: Bjorn Helgaas , Arnd Bergmann , Liviu Dudau Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, patches@apm.com, jcm@redhat.com, Duc Dang , Tanmay Inamdar Subject: [PATCH 1/1] PCI: X-Gene: assign resource to bus before adding new devices Date: Thu, 6 Nov 2014 17:14:18 -0800 Message-Id: <1415322858-4318-1-git-send-email-dhdang@apm.com> X-Mailer: git-send-email 1.7.9.5 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.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 X-Gene PCIE driver currently depends on Liviu Dudau's patch https://lkml.org/lkml/2014/9/30/166 in order to assign resource to root bus and endpoint devices. The patch was dropped because it will break x86, powerpc and probably others. So X-Gene PCIE host functionality is currently broken. This patch adds function calls to create and scan root_bus as well as assign unassigned bus resource (similar to Liviu Dudau's patch above). This will help resolve the dependency to Liviu Dudau's patch and make X-Gene PCIE work in latest open-source kernel. Signed-off-by: Duc Dang Signed-off-by: Tanmay Inamdar --- drivers/pci/host/pci-xgene.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/pci/host/pci-xgene.c b/drivers/pci/host/pci-xgene.c index 9ecabfa..2988fe1 100644 --- a/drivers/pci/host/pci-xgene.c +++ b/drivers/pci/host/pci-xgene.c @@ -631,10 +631,15 @@ static int xgene_pcie_probe_bridge(struct platform_device *pdev) if (ret) return ret; - bus = pci_scan_root_bus(&pdev->dev, 0, &xgene_pcie_ops, port, &res); + bus = pci_create_root_bus(&pdev->dev, 0, + &xgene_pcie_ops, port, &res); if (!bus) return -ENOMEM; + pci_scan_child_bus(bus); + pci_assign_unassigned_bus_resources(bus); + pci_bus_add_devices(bus); + platform_set_drvdata(pdev, port); return 0; }