From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932657AbcKVRmv (ORCPT ); Tue, 22 Nov 2016 12:42:51 -0500 Received: from mail-pg0-f45.google.com ([74.125.83.45]:33155 "EHLO mail-pg0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754970AbcKVRmq (ORCPT ); Tue, 22 Nov 2016 12:42:46 -0500 Subject: Re: [PATCH 1/2] PCI: iproc: fix 32-bit build To: Arnd Bergmann , Bjorn Helgaas References: <20161122141844.1655574-1-arnd@arndb.de> Cc: 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 From: Ray Jui Message-ID: Date: Tue, 22 Nov 2016 09:42:05 -0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:50.0) Gecko/20100101 Thunderbird/50.0 MIME-Version: 1.0 In-Reply-To: <20161122141844.1655574-1-arnd@arndb.de> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/22/2016 6:17 AM, Arnd Bergmann wrote: > 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 > --- > 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; > Hmmm, somehow we've never seen this link error for the ARM32 based platforms that we build for. Does it behave differently between different versions of compilers? Nevertheless, this is a good change to take, thanks! Acked-by: Ray Jui