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: 101478 Delivered-To: patch@linaro.org Received: by 10.140.97.165 with SMTP id m34csp2120177qge; Tue, 22 Nov 2016 06:20:42 -0800 (PST) X-Received: by 10.84.216.28 with SMTP id m28mr118066pli.107.1479824442369; Tue, 22 Nov 2016 06:20:42 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id q28si28687570pfl.44.2016.11.22.06.20.42 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Nov 2016 06:20:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1c9Bup-0000Ix-9F; Tue, 22 Nov 2016 14:19:19 +0000 Received: from mout.kundenserver.de ([212.227.17.13]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1c9Bul-0000Di-6B for linux-arm-kernel@lists.infradead.org; Tue, 22 Nov 2016 14:19:16 +0000 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 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= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161122_061915_599565_54ECCC56 X-CRM114-Status: GOOD ( 11.70 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [212.227.17.13 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [212.227.17.13 listed in wl.mailspike.net] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Arnd Bergmann , Scott Branden , Jon Mason , Ray Jui , linux-kernel@vger.kernel.org, Oza Oza , linux-pci@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org 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(-) -- 2.9.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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; From patchwork Tue Nov 22 14:17:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101477 Delivered-To: patch@linaro.org Received: by 10.140.97.165 with SMTP id m34csp2120197qge; Tue, 22 Nov 2016 06:20:44 -0800 (PST) X-Received: by 10.84.139.129 with SMTP id 1mr117430plr.178.1479824444456; Tue, 22 Nov 2016 06:20:44 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id b128si26617543pgc.336.2016.11.22.06.20.44 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Nov 2016 06:20:44 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1c9Bv7-0000Rv-St; Tue, 22 Nov 2016 14:19:37 +0000 Received: from mout.kundenserver.de ([217.72.192.75]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1c9Buy-0000GQ-Uv for linux-arm-kernel@lists.infradead.org; Tue, 22 Nov 2016 14:19:30 +0000 Received: from wuerfel.lan ([78.43.21.235]) by mrelayeu.kundenserver.de (mreue101 [212.227.15.145]) with ESMTPA (Nemesis) id 0MPp3a-1c5K1V3MSA-004xJL; Tue, 22 Nov 2016 15:19:04 +0100 From: Arnd Bergmann To: Bjorn Helgaas Subject: [PATCH 2/2] PCI: iproc: avoid maybe-uninitialized warning Date: Tue, 22 Nov 2016 15:17:52 +0100 Message-Id: <20161122141844.1655574-2-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20161122141844.1655574-1-arnd@arndb.de> References: <20161122141844.1655574-1-arnd@arndb.de> X-Provags-ID: V03:K0:Gog2JX0woEIbtkmDjiVoj7HO2VoNthxCzEH0WCUdop22vkiwU3x Hxgsr/QadWyXurjfWMLFIm2fUQhOyymlu7iZnRzSjsK5fkAjH09M00dTiDWLQpdYmuFCldL QLlpvnrwo1EaMj1lA73INoerJK0Fg1fYjjF2lMCgi5BblK3W8OIGXqQy03b/vU6dcoSHPFf iuiFSaOr/mUIYzR2jA6wA== X-UI-Out-Filterresults: notjunk:1; V01:K0:I1jV4j4G3y0=:UR53tLHHeMIeikmu/rS9B7 2tfXMn4Xkm6Bjnt9y1vDPkZY9oLjxC+BGNf9ATNDAe4PFCoyKiz2HFhgj56reEo+yxx5vjmx+ htluRU7jqQtInFy7IyxwIpZBDLGK2eDAISsrgy6DnVd79MuyOHGjTYBjUjS5/HYvVrpSsKxO0 OL+tVn/Ex7UyPDBAEAi4TOPyTN+dTAgTaPyC7/qV+8ScOvsGIYuDo0Cln11hsrznTLR5dQmTK khAN7iq1pkBKU6amooRv7BYBFPq9v47a2XmFMHBQKkxhb0Oo/rIq2R+XKEc9vfsWUVobRHa3f lCusO18XKsIh/OpKYUEmKPQAkdRRPOMzjY1LzJOGqQaxK3Um00UqHgD8u5vsW4xDmACn9fBQu ERJf1hZFh0lqUoGyvyfELqc4EgFhvQB7AU5b4kTQu7SYN8RLXnaGcTZU1pdPyLYUJlsyU8Mpk CZCfOU0HthArQ3ubvoXvjgvm1UUcDcpzRnbuEyWkY0B/5KG2A1ycxQaxahzppXOP+tyPGiTht R+cGLXAXWXMIdXtmVuDCfGGO3dlIPY8p0FIMmZHeieZkkaUQ0jZSgOxd2GCTtJ1zY3B9BVBoJ GgcC5rDRdh9B7WS+ho34j42CygEmtVDg4lAZ+0RzbseVyLYG4hNnKcowGVsmWiCDjVXJWAAov BXSPVVvT9/toLfWEBlJwbfM0Y8k+ru1FY9AQbZH/9vjJy67atDazpbo0M4Mf1ez/EHdg= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161122_061929_503938_CC6549A0 X-CRM114-Status: GOOD ( 10.56 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [217.72.192.75 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [217.72.192.75 listed in wl.mailspike.net] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Arnd Bergmann , Scott Branden , Jon Mason , Ray Jui , linux-kernel@vger.kernel.org, Oza Oza , "Dmitry V. Krivenok" , linux-pci@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org gcc notices that calling iproc_pcie_setup_ib with ib->nr_regions==0 would result in an uninitialized return value: drivers/pci/host/pcie-iproc.c: In function 'iproc_pcie_setup_ib': drivers/pci/host/pcie-iproc.c:894:6: error: 'ret' may be used uninitialized in this function [-Werror=maybe-uninitialized] This can't really happen, but the correct behavior of the function is probably to return -EINVAL if it ever did. Fixes: 4213e15c364e ("PCI: iproc: Make outbound mapping code more generic") Signed-off-by: Arnd Bergmann --- drivers/pci/host/pcie-iproc.c | 1 + 1 file changed, 1 insertion(+) -- 2.9.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/drivers/pci/host/pcie-iproc.c b/drivers/pci/host/pcie-iproc.c index 857ff5198317..0359569c8d78 100644 --- a/drivers/pci/host/pcie-iproc.c +++ b/drivers/pci/host/pcie-iproc.c @@ -936,6 +936,7 @@ static int iproc_pcie_setup_ib(struct iproc_pcie *pcie, } } + ret = -EINVAL; err_ib: dev_err(dev, "unable to configure inbound mapping\n"); dev_err(dev, "axi %pap, pci %pap, res size %pap\n",