From patchwork Tue Aug 4 21:54:04 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 6944711 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D7492C05AC for ; Tue, 4 Aug 2015 21:56:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E6DE82056E for ; Tue, 4 Aug 2015 21:56:45 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 102482053C for ; Tue, 4 Aug 2015 21:56:45 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZMkAJ-0000cL-Io; Tue, 04 Aug 2015 21:54:31 +0000 Received: from mail-ig0-x231.google.com ([2607:f8b0:4001:c05::231]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZMkAF-0000YX-De for linux-arm-kernel@lists.infradead.org; Tue, 04 Aug 2015 21:54:28 +0000 Received: by igbij6 with SMTP id ij6so83600120igb.1 for ; Tue, 04 Aug 2015 14:54:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=subject:to:from:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding; bh=P6YErvvodF1D5Bj1SRA+qogN0tOPgRttOfqKMU802WI=; b=kC/rUY8MAcyaWdSOnBoAT/0r+wh9QfFGKEczV8QvOnkRdh136zINvPkqPjNdK5eJt4 E/333KTJ3AQLIiQJN3Z8G7crQF1Qb02fDly4RG+nU1PHN0A6PQGiS46NK8ouTAWxAj0n lsUJPRFCQ7gvUWpkdk9PCzK0xkfy0OUPdJPBfchbd8sGaK2RwhHV+GxOcLgfXMMynyBs et7WFVekg2j4NBKPAjAUX2BltK8XFhNMRt5ni1OvNlsi1hav/Ul/8DmFSsMMzuIPS6LO tDkDlwpQ8VeBHr/elw6974GeGk+a5G9AAy5uad9Scfphz/nEsJGFp9KUCILQJbUGwUU3 asyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:from:cc:date:message-id:in-reply-to :references:user-agent:mime-version:content-type :content-transfer-encoding; bh=P6YErvvodF1D5Bj1SRA+qogN0tOPgRttOfqKMU802WI=; b=JLthSbW8RTVqN9jpxpZBp5j/aHmQWdHyMzmjcigx7BynorK/pcnEA3a2hwOSz6tDp6 Vmri7DQHq7o83X7NGUIkxaFvHUvewbJhCMlS9BR7e8rNqGeF0lkCzjsLDVIFFh5y2JHL xfpT5yaMkyXJT/t2dtth/WMz2MZcJ2omsz/HvspgDzAhXRgjojbCtlEorq1D7afDCzLz LQp0y1l6rl49hziW/TS5LGV133n+Eor7udvIrsP39ryIOHYsevqMO/x5a5Bvz5wZ8ITT loidooGSmYkV/ObxZk7ffST4388gzIwHrmEKVNYL9t84kNpDdI0V9FvMiuF2Mk7SSzpK 7dYQ== X-Gm-Message-State: ALoCoQlX7/bgKK3E3qiyO19o2tcnQ/j9x9u6KyZPp5mLfTmSESY+QOBvGfXF9D4+3bHuJLikfESQ X-Received: by 10.50.87.74 with SMTP id v10mr7007469igz.37.1438725246490; Tue, 04 Aug 2015 14:54:06 -0700 (PDT) Received: from localhost ([69.71.1.1]) by smtp.gmail.com with ESMTPSA id d4sm2087112igl.1.2015.08.04.14.54.05 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 04 Aug 2015 14:54:05 -0700 (PDT) Subject: [PATCH v5 2/9] PCI: Add pci_scan_root_bus_msi() To: Lorenzo Pieralisi From: Bjorn Helgaas Date: Tue, 04 Aug 2015 16:54:04 -0500 Message-ID: <20150804215404.9189.41823.stgit@bhelgaas-glaptop2.roam.corp.google.com> In-Reply-To: <20150804214234.9189.42548.stgit@bhelgaas-glaptop2.roam.corp.google.com> References: <20150804214234.9189.42548.stgit@bhelgaas-glaptop2.roam.corp.google.com> User-Agent: StGit/0.16 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150804_145427_610187_F8C5F240 X-CRM114-Status: GOOD ( 14.97 ) X-Spam-Score: -2.9 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni , Duc Dang , Russell King , Arnd Bergmann , Gabriele Paoloni , Marc Zyngier , linux-pci@vger.kernel.org, Pratyush Anand , Michal Simek , Simon Horman , James Morse , Tanmay Inamdar , Jingoo Han , Thierry Reding , Jayachandran C , linux-arm-kernel@lists.infradead.org, Jason Cooper Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID, 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 From: Lorenzo Pieralisi Add a pci_scan_root_bus_msi() interface so an arch can specify the MSI controller up front. This removes the need for a pcibios callback to set the MSI controller later. This is not exported because I'd like to replace the variety of "scan root bus" interfaces with a single, more extensible interface that can handle the MSI controller, domain, pci_ops, resources, etc. I hope this interface is temporary. [bhelgaas: changelog, split into separate patch, move to drivers/pci/pci.h] Suggested-by: Russell King Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas Reviewed-by: Jingoo Han --- drivers/pci/pci.h | 5 +++++ drivers/pci/probe.c | 14 ++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h index 4ff0ff1..1d4c95c 100644 --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h @@ -223,6 +223,11 @@ enum pci_bar_type { pci_bar_mem64, /* A 64-bit memory BAR */ }; +struct pci_bus *pci_scan_root_bus_msi(struct device *parent, int bus, + struct pci_ops *ops, void *sysdata, + struct list_head *resources, + struct msi_controller *msi); + bool pci_bus_read_dev_vendor_id(struct pci_bus *bus, int devfn, u32 *pl, int crs_timeout); int pci_setup_device(struct pci_dev *dev); diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index cefd636..9ff4df0 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -2096,8 +2096,9 @@ void pci_bus_release_busn_res(struct pci_bus *b) res, ret ? "can not be" : "is"); } -struct pci_bus *pci_scan_root_bus(struct device *parent, int bus, - struct pci_ops *ops, void *sysdata, struct list_head *resources) +struct pci_bus *pci_scan_root_bus_msi(struct device *parent, int bus, + struct pci_ops *ops, void *sysdata, + struct list_head *resources, struct msi_controller *msi) { struct resource_entry *window; bool found = false; @@ -2114,6 +2115,8 @@ struct pci_bus *pci_scan_root_bus(struct device *parent, int bus, if (!b) return NULL; + b->msi = msi; + if (!found) { dev_info(&b->dev, "No busn resource found for root bus, will use [bus %02x-ff]\n", @@ -2128,6 +2131,13 @@ struct pci_bus *pci_scan_root_bus(struct device *parent, int bus, return b; } + +struct pci_bus *pci_scan_root_bus(struct device *parent, int bus, + struct pci_ops *ops, void *sysdata, struct list_head *resources) +{ + return pci_scan_root_bus_msi(parent, bus, ops, sysdata, resources, + NULL); +} EXPORT_SYMBOL(pci_scan_root_bus); struct pci_bus *pci_scan_bus(int bus, struct pci_ops *ops,