From patchwork Thu Oct 15 19:40:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 7409041 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E0701BEEA4 for ; Thu, 15 Oct 2015 19:41:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D620B207C6 for ; Thu, 15 Oct 2015 19:41:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E5116207BC for ; Thu, 15 Oct 2015 19:41:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752069AbbJOTlQ (ORCPT ); Thu, 15 Oct 2015 15:41:16 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:52716 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751850AbbJOTlP (ORCPT ); Thu, 15 Oct 2015 15:41:15 -0400 Received: from wuerfel.localnet ([149.172.15.242]) by mrelayeu.kundenserver.de (mreue005) with ESMTPSA (Nemesis) id 0LrXNx-1aYdX30Z9p-013MYD; Thu, 15 Oct 2015 21:40:48 +0200 From: Arnd Bergmann To: Ray Jui Cc: Bjorn Helgaas , Hauke Mehrtens , linux-arm-kernel@lists.infradead.org, Kevin Hilman , Tyler Baker , lkml , Olof Johansson , Mark Brown , bcm-kernel-feedback-list@broadcom.com, Linux PCI , Bjorn Helgaas Subject: [PATCH v2] PCI: iproc: fix 32-bit build error Date: Thu, 15 Oct 2015 21:40:45 +0200 Message-ID: <5754881.OPA6La0Zg0@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <561FD20F.1090004@broadcom.com> References: <1442363962-29805-1-git-send-email-rjui@broadcom.com> <20151015160028.GA17702@localhost> <561FD20F.1090004@broadcom.com> MIME-Version: 1.0 X-Provags-ID: V03:K0:F4iRN9rW6YEeS+r/reD36fkHig0siqF7Yd7dwZ1OO/TS6PZedNZ +KteV0TzSa1HQeQs1QR2OPP04UfIV9X6/KKiJbgW1hw/vQ1yNkZV0I9zk5CkSKEkqyXh3rT t7jSjex5mOwIVKrOmorC/aOn+DK821z/AI25cW8tO/sOTgobqtxKGZ3ytX2oLj7ZyYYWpjM jBPYgc/PTQM4+ahQ0QfjA== X-UI-Out-Filterresults: notjunk:1; V01:K0:q5uewwkChuI=:NrUOG3taK7ia3J8r0jvYJh Qb2aOLffuAr7aK4EsJXlI/yO7KiORwxOA/leK71QdOQgRA71+s5Zqp8/YlchL7kMPSlIdcLlc AI3I0wA1oEuucTo+FVytw9iDFZxQadgdS5X+uzKUEbDP0FTaNzSEzToqVBnXZXxnkCuvsrEeI +Ifenckwdy5Khqh9Osh2Z1Uooev1I9Fq9lDpvKZwGWnSPvoe4/+0Q1ToUz15ZMqNw/4HXPsgC 51B0EKc+v+NjDedgApzCxaZTYlSz/0OTumXuXA2EyJqwDN5fhFUzl9oBisyp15IrP4NQRjYtJ MQ6YmAR3y0h23TccKQ4nPXrudYMC370/HNSPncOJvbGKdqCHnIrwXfIDOi93cO0LuqeRfJReF HdbdnNWPDSUztDOvKJJHNxIDUh2MKuZQdCrgzQaLCVA6m8yFOiAKpejUm+VubsCNR6ORcQFkU ha56QLK//Eo2QtoziglPAJTFzOxIa6GzzIStj7xIiatUWmyyWrZPlfvIuwg+QNrH062LKmYYW Mx0VDj7Xc0wAlT2vePg50poC2aXNWaWID9dYaj3RY7YXzLUlhAIq0kbawFvcoyfncYTEJnBgL ivlDBrwXVMsSiWVa7hfnhlR9s+NQdg80elPKK7SO1mDHpiZt02bBm14p8ofST13GYK0oCCCDp 4Id6obnl8loF+S+5v+DfxaD+uFCr0OM2fMIviVXQ1TRvMmLr5CSrcJPFVauayz6pow7Nq4ap0 1E3v22qJXMxjkNRW Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 The iproc PCI driver tries to figure out whether the MMIO window has a valid size, but does this using a 64-bit modulo operation, which is not allowed on 32-bit kernels and leads to a link error: drivers/built-in.o: In function `iproc_pcie_setup': :(.text+0x4b798): undefined reference to `__aeabi_uldivmod' This works around that error by using the div64_u64() function provided by the kernel. While this is an expensive operation, it is harmless because we only call it during the probing of the driver. Signed-off-by: Arnd Bergmann Acked-by: Ray Jui Fixes: 0ab99ca8eb6c ("PCI: iproc: Fix compile warnings") Acked-by: Hauke Mehrtens --- On Thursday 15 October 2015 09:19:27 Ray Jui wrote: > On 10/15/2015 9:00 AM, Bjorn Helgaas wrote: > > > > Ping; I can easily fix up the static, but it'd be nice to have real acks > > from Ray and Hauke. Argh, I knew there was one patch from my build fixes that I needed to redo, I just couldn't find it again. Thanks for the reminder. -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/pci/host/pcie-iproc.c b/drivers/pci/host/pcie-iproc.c index f3481ddff344..9193951ae861 100644 --- a/drivers/pci/host/pcie-iproc.c +++ b/drivers/pci/host/pcie-iproc.c @@ -241,6 +241,7 @@ static int iproc_pcie_setup_ob(struct iproc_pcie *pcie, u64 axi_addr, struct iproc_pcie_ob *ob = &pcie->ob; unsigned i; u64 max_size = (u64)ob->window_size * MAX_NUM_OB_WINDOWS; + u64 remainder; if (size > max_size) { dev_err(pcie->dev, @@ -249,7 +250,8 @@ static int iproc_pcie_setup_ob(struct iproc_pcie *pcie, u64 axi_addr, return -EINVAL; } - if (size % ob->window_size) { + div64_u64_rem(size, ob->window_size, &remainder); + if (remainder) { dev_err(pcie->dev, "res size %pap needs to be multiple of window size %pap\n", &size, &ob->window_size);