From patchwork Fri Aug 3 14:38:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 10555195 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7CC341822 for ; Fri, 3 Aug 2018 14:39:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6BF402C7C0 for ; Fri, 3 Aug 2018 14:39:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 605922C7D9; Fri, 3 Aug 2018 14:39:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1BACE2C7C0 for ; Fri, 3 Aug 2018 14:39:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=h8hLSo1lA0nsfMCM0JsDYij3EE4HMR7/53YzeaMWXlw=; b=kyFb5QDyRxRziuWpJEReShxtG4 FIpMkzk+U4zfdUfVAMu+JocAxcGdzXAZ2sAMsmage78YZSAHvrML7n1bY7Z6gYITHmPgqhm8x11Db Nnb6LmrXj83w/el7RDb97o/Slc8Shb6w6yI6ODJo9r7zBbXxL4B/FQgRDuYWvdVeVMatR3/I8tOZv +S8SYiguwg/8jLKpFeMwITpIrbvUK6ZuqdX/ms75TC5/aqPh9Jda5YWNl/H1PSm6zvQ470AsZY9mO Z1axK12I8ZCu1z9JiIWbvpk+tdeO62DPvuOYSPm5qrbqsVjjVGWtRLnO112maQxr+lETHhuTTbaZW HtWiHG0Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1flbEZ-0001bb-Lk; Fri, 03 Aug 2018 14:39:15 +0000 Received: from mail.bootlin.com ([62.4.15.54]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1flbEP-0001Qg-D6 for linux-arm-kernel@lists.infradead.org; Fri, 03 Aug 2018 14:39:07 +0000 Received: by mail.bootlin.com (Postfix, from userid 110) id AF4D4207CF; Fri, 3 Aug 2018 16:38:51 +0200 (CEST) Received: from localhost (AAubervilliers-681-1-99-143.w90-88.abo.wanadoo.fr [90.88.4.143]) by mail.bootlin.com (Postfix) with ESMTPSA id 80C9D20712; Fri, 3 Aug 2018 16:38:51 +0200 (CEST) From: Thomas Petazzoni To: Bjorn Helgaas , Lorenzo Pieralisi , linux-pci@vger.kernel.org Subject: [PATCH v2 3/6] PCI: mvebu: only remap I/O space if configured Date: Fri, 3 Aug 2018 16:38:45 +0200 Message-Id: <20180803143848.21551-4-thomas.petazzoni@bootlin.com> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180803143848.21551-1-thomas.petazzoni@bootlin.com> References: <20180803143848.21551-1-thomas.petazzoni@bootlin.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180803_073905_585890_B2C2429D X-CRM114-Status: GOOD ( 14.15 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Antoine Tenart , Gregory Clement , Maxime Chevallier , Nadav Haklai , Thomas Petazzoni , =?utf-8?q?Miqu=C3=A8l_Rayn?= =?utf-8?q?al?= , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP If there is no PCI I/O aperture configured in the Device Tree, it does not make sense to create the virtual mapping for the PCI I/O space, since we will anyway not create the MBus window that will allow to access it. Therefore, do the pci_ioremap_io() only if necessary. Signed-off-by: Thomas Petazzoni --- drivers/pci/controller/pci-mvebu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/pci/controller/pci-mvebu.c b/drivers/pci/controller/pci-mvebu.c index a195592723c2..9aa224f2f009 100644 --- a/drivers/pci/controller/pci-mvebu.c +++ b/drivers/pci/controller/pci-mvebu.c @@ -1220,6 +1220,9 @@ static int mvebu_pcie_probe(struct platform_device *pdev) pcie->realio.end = min_t(resource_size_t, IO_SPACE_LIMIT, resource_size(&pcie->io) - 1); + + for (i = 0; i < (IO_SPACE_LIMIT - SZ_64K); i += SZ_64K) + pci_ioremap_io(i, pcie->io.start + i); } else pcie->realio = pcie->io; @@ -1278,9 +1281,6 @@ static int mvebu_pcie_probe(struct platform_device *pdev) pcie->nports = i; - for (i = 0; i < (IO_SPACE_LIMIT - SZ_64K); i += SZ_64K) - pci_ioremap_io(i, pcie->io.start + i); - mvebu_pcie_enable(pcie); return 0;