From patchwork Mon Sep 22 09:51:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Phil Edworthy X-Patchwork-Id: 4946821 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 9F274BEEA5 for ; Mon, 22 Sep 2014 09:51:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DE54120149 for ; Mon, 22 Sep 2014 09:51:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C062D2016C for ; Mon, 22 Sep 2014 09:51:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753569AbaIVJvZ (ORCPT ); Mon, 22 Sep 2014 05:51:25 -0400 Received: from relmlor3.renesas.com ([210.160.252.173]:15347 "EHLO relmlie2.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753540AbaIVJvW (ORCPT ); Mon, 22 Sep 2014 05:51:22 -0400 Received: from unknown (HELO relmlir3.idc.renesas.com) ([10.200.68.153]) by relmlie2.idc.renesas.com with ESMTP; 22 Sep 2014 18:51:19 +0900 Received: from relmlac4.idc.renesas.com (relmlac4.idc.renesas.com [10.200.69.24]) by relmlir3.idc.renesas.com (Postfix) with ESMTP id B8C943E382; Mon, 22 Sep 2014 18:51:19 +0900 (JST) Received: by relmlac4.idc.renesas.com (Postfix, from userid 0) id 9AF3F480A8; Mon, 22 Sep 2014 18:51:19 +0900 (JST) Received: from relmlac4.idc.renesas.com (localhost [127.0.0.1]) by relmlac4.idc.renesas.com (Postfix) with ESMTP id 9A4F8480A7; Mon, 22 Sep 2014 18:51:19 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac4.idc.renesas.com with ESMTP id UAE32171; Mon, 22 Sep 2014 18:51:19 +0900 X-IronPort-AV: E=Sophos;i="5.04,571,1406559600"; d="scan'208";a="170703500" Received: from unknown (HELO relay51.aps.necel.com) ([10.29.19.60]) by relmlii2.idc.renesas.com with ESMTP; 22 Sep 2014 18:51:19 +0900 Received: from DU0NOTES13.ad.ree.renesas.com ([172.29.24.131]) by relay51.aps.necel.com (8.14.4+Sun/8.14.4) with ESMTP id s8M9pERl008705; Mon, 22 Sep 2014 18:51:15 +0900 (JST) Received: from duacsls.ad.ree.renesas.com ([172.29.43.47]) by DU0NOTES13.ad.ree.renesas.com (Lotus Domino Release 8.5.3 HF466) with ESMTP id 2014092211511345-120744 ; Mon, 22 Sep 2014 11:51:13 +0200 From: Phil Edworthy To: linux-pci@vger.kernel.org Cc: linux-sh@vger.kernel.org, LAKML , Bjorn Helgaas , Simon Horman , Valentine Barshak , Sergei Shtylyov , Ben Dooks , Jason Gunthorpe , Arnd Bergmann , Liviu Dudau , Phil Edworthy X-Mailer: git-send-email 2.1.0 In-Reply-To: <1411379470-20639-1-git-send-email-phil.edworthy@renesas.com> References: <1411379470-20639-1-git-send-email-phil.edworthy@renesas.com> X-TNEFEvaluated: 1 Message-ID: <1411379470-20639-2-git-send-email-phil.edworthy@renesas.com> Date: Mon, 22 Sep 2014 10:51:08 +0100 Subject: [PATCH 1/3] PCI: rcar-pcie: Add call to get domain nr X-MIMETrack: Itemize by SMTP Server on DU0NOTES13/SERVER/REE(Release 8.5.3 HF466|March 09, 2012) at 22.09.2014 11:51:13, Serialize by Router on DU0NOTES13/SERVER/REE(Release 8.5.3 HF466|March 09, 2012) at 22.09.2014 11:51:15, Serialize complete at 22.09.2014 11:51:15 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.9 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 R-Car devices (r8a7790 and r8a7791) need to place the internal PCI and external PCIe controllers on separate domains so that they can work at the same time. Signed-off-by: Phil Edworthy --- drivers/pci/host/pcie-rcar.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/pci/host/pcie-rcar.c b/drivers/pci/host/pcie-rcar.c index 4884ee5..db74371 100644 --- a/drivers/pci/host/pcie-rcar.c +++ b/drivers/pci/host/pcie-rcar.c @@ -128,6 +128,7 @@ struct rcar_pcie { struct device *dev; void __iomem *base; struct resource res[RCAR_PCI_MAX_RESOURCES]; + int domain; struct resource busn; int root_bus_nr; struct clk *clk; @@ -393,13 +394,13 @@ static void rcar_pcie_enable(struct rcar_pcie *pcie) { struct platform_device *pdev = to_platform_device(pcie->dev); +#ifdef CONFIG_PCI_DOMAINS + rcar_pci.domain = pcie->domain; +#endif rcar_pci.nr_controllers = 1; rcar_pci.private_data = (void **)&pcie; pci_common_init_dev(&pdev->dev, &rcar_pci); -#ifdef CONFIG_PCI_DOMAINS - rcar_pci.domain++; -#endif } static int phy_wait_for_ack(struct rcar_pcie *pcie) @@ -917,6 +918,8 @@ static int rcar_pcie_probe(struct platform_device *pdev) pcie->dev = &pdev->dev; platform_set_drvdata(pdev, pcie); + pcie->domain = of_pci_get_domain_nr(pdev->dev.of_node, true); + /* Get the bus range */ if (of_pci_parse_bus_range(pdev->dev.of_node, &pcie->busn)) { dev_err(&pdev->dev, "failed to parse bus-range property\n");