From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D2D78C4BA3B for ; Thu, 27 Feb 2020 12:30:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A95772468E for ; Thu, 27 Feb 2020 12:30:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729076AbgB0Mab (ORCPT ); Thu, 27 Feb 2020 07:30:31 -0500 Received: from foss.arm.com ([217.140.110.172]:49606 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728856AbgB0Mab (ORCPT ); Thu, 27 Feb 2020 07:30:31 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0AD951FB; Thu, 27 Feb 2020 04:30:31 -0800 (PST) Received: from e121166-lin.cambridge.arm.com (e121166-lin.cambridge.arm.com [10.1.196.255]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 7FF473F73B; Thu, 27 Feb 2020 04:30:29 -0800 (PST) Date: Thu, 27 Feb 2020 12:30:24 +0000 From: Lorenzo Pieralisi To: Marek Szyprowski , Bjorn Helgaas Cc: linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Nicolas Saenz Julienne , Florian Fainelli , bcm-kernel-feedback-list@broadcom.com, Andrew Murray Subject: Re: [PATCH] pci: brcmstb: Fix build on 32bit ARM platforms with older compilers Message-ID: <20200227123024.GA12798@e121166-lin.cambridge.arm.com> References: <20200227115146.24515-1-m.szyprowski@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200227115146.24515-1-m.szyprowski@samsung.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Subject should be: PCI: brcmstb: Fix build on 32bit ARM platforms with older compilers On Thu, Feb 27, 2020 at 12:51:46PM +0100, Marek Szyprowski wrote: > Some older compilers have no implementation for the helper for 64-bit > unsigned division/modulo, so linking pcie-brcmstb driver causes the > "undefined reference to `__aeabi_uldivmod'" error. > > *rc_bar2_size is always a power of two, because it is calculated as: > "1ULL << fls64(entry->res->end - entry->res->start)", so the modulo > operation in the subsequent check can be replaced by a simple logical > AND with a proper mask. > Add a Fixes: tag please. Fixes: c0452137034b ("PCI: brcmstb: Add Broadcom STB PCIe host controller driver") > Signed-off-by: Marek Szyprowski > --- > drivers/pci/controller/pcie-brcmstb.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Hi Bjorn, I think this should be merged in one of the upcoming -rc, given that it fixes v5.6 material. Here is my ACK to that end, if you prefer postponing it to v5.7 please let me know. Acked-by: Lorenzo Pieralisi > diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c > index d20aabc26273..3a10e678c7f4 100644 > --- a/drivers/pci/controller/pcie-brcmstb.c > +++ b/drivers/pci/controller/pcie-brcmstb.c > @@ -670,7 +670,7 @@ static inline int brcm_pcie_get_rc_bar2_size_and_offset(struct brcm_pcie *pcie, > * outbound memory @ 3GB). So instead it will start at the 1x > * multiple of its size > */ > - if (!*rc_bar2_size || *rc_bar2_offset % *rc_bar2_size || > + if (!*rc_bar2_size || (*rc_bar2_offset & (*rc_bar2_size - 1)) || > (*rc_bar2_offset < SZ_4G && *rc_bar2_offset > SZ_2G)) { > dev_err(dev, "Invalid rc_bar2_offset/size: size 0x%llx, off 0x%llx\n", > *rc_bar2_size, *rc_bar2_offset); > -- > 2.17.1 >