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.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FAKE_REPLY_C,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 7D640C54FC0 for ; Thu, 27 Feb 2020 14:26:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 47CB621D7E for ; Thu, 27 Feb 2020 14:26:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582813599; bh=X9rl3ZGCnjqX0Ce24td4V97fsDt8ivYeM1csu23KtbA=; h=Date:From:To:Cc:Subject:In-Reply-To:List-ID:From; b=09lYXZoG3qa3TFJOVAfa0aJ+A50QllflQ1aassHfgwC6OvcahnGOLfeO/axEWqWOq B1XNwuG2lnDaZ3IqISwopL3yBg+Wx8CAQWrQPDpuVdX3UrI0zmoueQEPruBaWzURD5 pzZ2eW7zXBDVtk7BkOKxypJr4F4JyMNEx5mqThL8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388418AbgB0OJw (ORCPT ); Thu, 27 Feb 2020 09:09:52 -0500 Received: from mail.kernel.org ([198.145.29.99]:47874 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730257AbgB0OJu (ORCPT ); Thu, 27 Feb 2020 09:09:50 -0500 Received: from localhost (173-25-83-245.client.mchsi.com [173.25.83.245]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E06EB20578; Thu, 27 Feb 2020 14:09:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582812590; bh=X9rl3ZGCnjqX0Ce24td4V97fsDt8ivYeM1csu23KtbA=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=LFdE44vcMhziqC8vsqlprJou46T1FdXaTAU/cTGFMoy+JuvwXVnfxZvhShBpXVo9/ Ejhv5CEdeoWe0x4rO3WB6EcngNXFybpnYhP+JD2koCrpknOOJ7hjlr6e3SwMwZqf6O tGDeNshu3lujRonV6asb77lm++OB/Rz3dhevOyAw= Date: Thu, 27 Feb 2020 08:09:48 -0600 From: Bjorn Helgaas To: Marek Szyprowski 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, Lorenzo Pieralisi , Andrew Murray Subject: Re: [PATCH] pci: brcmstb: Fix build on 32bit ARM platforms with older compilers Message-ID: <20200227140948.GA78063@google.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.12.2 (2019-09-21) Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org 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. > > Signed-off-by: Marek Szyprowski Applied to for-linus for v5.6, thanks! I added acks from Nicolas and Lorenzo and also the Fixes: tag from Lorenzo. > --- > drivers/pci/controller/pcie-brcmstb.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > 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 > 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.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,FAKE_REPLY_C,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham 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 35DC1C3F37A for ; Thu, 27 Feb 2020 14:09:55 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0563A20714 for ; Thu, 27 Feb 2020 14:09:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="HVtqDQAP"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="LFdE44vc" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0563A20714 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Owner; bh=ArXI0NYo8Hf6diNZuw+JPizWz95nFInAWpP8D4PIY7w=; b=HVtqDQAPN9mQu6 SnrBn/6CU5g6PTYn3mEFb45aOWEMsGvOVAwJ7LtvzKB9pLp4zJTafLP9qdIg8M9rE5b2QwBxP8bPl lFq31gVWe9eThghmGhC6U1cYGE//5TEda4sHxZkasLK4l/uFje2hggpTX4V11TyPsYeCyZiw1Xzni w5oURtrI92BTQbi3vJkcMg4+JOSSPyyYOWpDG6YV+D79dwhr+OT7bIyoUp9RFMthvjRYEnWVKyBsk maxPkVbQxlDkdIhdMGJ52OhE///UxdtxnJ+sYK5aQqhj3qZnbeUMBfvLfcHtM2h2ECEbuwICIoUB7 oVB0A5Zu+giARUzyhZ1A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1j7JrO-0007Uc-8g; Thu, 27 Feb 2020 14:09:54 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j7JrK-0007Ta-VK; Thu, 27 Feb 2020 14:09:52 +0000 Received: from localhost (173-25-83-245.client.mchsi.com [173.25.83.245]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E06EB20578; Thu, 27 Feb 2020 14:09:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582812590; bh=X9rl3ZGCnjqX0Ce24td4V97fsDt8ivYeM1csu23KtbA=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=LFdE44vcMhziqC8vsqlprJou46T1FdXaTAU/cTGFMoy+JuvwXVnfxZvhShBpXVo9/ Ejhv5CEdeoWe0x4rO3WB6EcngNXFybpnYhP+JD2koCrpknOOJ7hjlr6e3SwMwZqf6O tGDeNshu3lujRonV6asb77lm++OB/Rz3dhevOyAw= Date: Thu, 27 Feb 2020 08:09:48 -0600 From: Bjorn Helgaas To: Marek Szyprowski Subject: Re: [PATCH] pci: brcmstb: Fix build on 32bit ARM platforms with older compilers Message-ID: <20200227140948.GA78063@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200227115146.24515-1-m.szyprowski@samsung.com> User-Agent: Mutt/1.12.2 (2019-09-21) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200227_060951_028663_2C99D201 X-CRM114-Status: GOOD ( 17.78 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, Florian Fainelli , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Lorenzo Pieralisi , bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, Nicolas Saenz Julienne , Andrew Murray Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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. > > Signed-off-by: Marek Szyprowski Applied to for-linus for v5.6, thanks! I added acks from Nicolas and Lorenzo and also the Fixes: tag from Lorenzo. > --- > drivers/pci/controller/pcie-brcmstb.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > 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 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel