From patchwork Tue Nov 22 14:17:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9441273 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 306D4600BA for ; Tue, 22 Nov 2016 14:23:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 242052856F for ; Tue, 22 Nov 2016 14:23:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 18DB428572; Tue, 22 Nov 2016 14:23:56 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AFF6028571 for ; Tue, 22 Nov 2016 14:23:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933341AbcKVOXW (ORCPT ); Tue, 22 Nov 2016 09:23:22 -0500 Received: from mout.kundenserver.de ([212.227.17.13]:55572 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755679AbcKVOT7 (ORCPT ); Tue, 22 Nov 2016 09:19:59 -0500 Received: from wuerfel.lan ([78.43.21.235]) by mrelayeu.kundenserver.de (mreue101 [212.227.15.145]) with ESMTPA (Nemesis) id 0MfHVi-1cP3nx3XvW-00Opbn; Tue, 22 Nov 2016 15:18:48 +0100 From: Arnd Bergmann To: Bjorn Helgaas Cc: Arnd Bergmann , Ray Jui , Scott Branden , Jon Mason , bcm-kernel-feedback-list@broadcom.com, Oza Oza , linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] PCI: iproc: fix 32-bit build Date: Tue, 22 Nov 2016 15:17:51 +0100 Message-Id: <20161122141844.1655574-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:fIBc9yMn524ayJ79FISlDZw5moo57kaQOYEtQEVt+eiZO6z43Qp 6evbB2nS/5fbbSz3wcUTlRU5DEm6e2P7ng6WT+5xQg2f4gDaCuVi06C0ORiytWLHLpTtfFf DfgpzFfaJiWoqJ6G23XGsZfeox1xacr3VwYCyMi14ZXFBlRVPjC9P2sZS76kEE3axyEa3iL 8FbvBQo++8JebBRO5x1yQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:QOV7YJlO2ck=:5du6AdY5HwF/h9I91yh/Pn XMMCrruSmVD1WAYcgiShwCBY6omfS2kWiMp4JJethgKwwcX4fKC8aRN7taX4p1hYc2Wy2cjjx 3yvCzL5D+WD5aRoed4KhTWYQBj1OGDC3Qy3xesvjrSRQ7xqCQ8wIPIMlmHafM+8WsIpigpvK2 gOwDGOgp1sbnflq/9rGBBBxNRXWF/yAIdpWZYMdel/Q/2S5ndqfn7ouDd3rpl5/whnw3iuhu6 adYqqGUcqK7WgK6Gzxsy1N8vt2a9h0lj41zgqhuy6PNTOYjnDuuK4dpKeXU/5VsAUuw3mEOr4 6JinB3rIjgRJ1T2vm6It+DN0UVCgiYYQETPCvSUWedWA6KI6JZ7Kp2mRPKtHniQgf62geYqBC dv7n5TQ/emP+HpwTmcDMKFYxqza3kstBThQQW2cgtpNI2fT7PiABduNIFDOmLvrnbr6CHJbcY LpGHw6vW3805m3ZAOx6nvmmJ35B3XBFB/6TSTadxOwfY8+FV2SkNKQ5woI9IFl505cKExcoii lgfGoNA51R2bOxtHcp21rJW3LsP/zZZ/vtz8gI3PZvWNoILfEiilHlppAcqk27XUiAtpe7gV1 CEfBLDS/CEAXiGppNlaU6P4D91vOt/VAoP6XXjoME/3QXWdPKlsmO14vu7gRfxI0yWUAXUri/ MUeIvMo98cMMj9ngqvzCPWoDww5Kqme3kzXZGGWVK9eGWmlqT5RUgO1bJ1QUlzPDcO08= Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The newly added code to setup the inbound ranges causes a link error on 32-bit machines from a 32-bit division: drivers/pci/host/pcie-iproc.o: In function `iproc_pcie_setup_ib': pcie-iproc.c:(.text.iproc_pcie_setup_ib+0x14c): undefined reference to `__aeabi_uldivmod' As both sides of the division are always power-of-two numbers and we already rely on that, we can use a shift instead. Fixes: 87c240b19bba ("PCI: iproc: Add inbound DMA mapping support") Signed-off-by: Arnd Bergmann Acked-by: Ray Jui --- drivers/pci/host/pcie-iproc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/host/pcie-iproc.c b/drivers/pci/host/pcie-iproc.c index d10e6aa32e0d..857ff5198317 100644 --- a/drivers/pci/host/pcie-iproc.c +++ b/drivers/pci/host/pcie-iproc.c @@ -865,7 +865,7 @@ static int iproc_pcie_ib_write(struct iproc_pcie *pcie, int region_idx, * Now program the IMAP registers. Each IARR region may have one or * more IMAP windows. */ - size /= nr_windows; + size >>= ilog2(nr_windows); for (window_idx = 0; window_idx < nr_windows; window_idx++) { val = readl(pcie->base + imap_offset); val |= lower_32_bits(axi_addr) | IMAP_VALID;