From patchwork Mon Feb 29 08:45:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102655 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp1112417lbc; Mon, 29 Feb 2016 00:46:58 -0800 (PST) X-Received: by 10.66.61.204 with SMTP id s12mr20772576par.108.1456735618842; Mon, 29 Feb 2016 00:46:58 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id pr6si41539419pac.155.2016.02.29.00.46.58; Mon, 29 Feb 2016 00:46:58 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752068AbcB2Iq5 (ORCPT + 4 others); Mon, 29 Feb 2016 03:46:57 -0500 Received: from mout.kundenserver.de ([212.227.17.24]:55358 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751992AbcB2Iq4 (ORCPT ); Mon, 29 Feb 2016 03:46:56 -0500 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue101) with ESMTPA (Nemesis) id 0MS1yk-1aUNRT2keI-00THGU; Mon, 29 Feb 2016 09:46:17 +0100 From: Arnd Bergmann To: Joerg Roedel , Marek Szyprowski , Joerg Roedel , Kukjin Kim , Krzysztof Kozlowski Cc: linux-arm-kernel@lists.infradead.org, Arnd Bergmann , iommu@lists.linux-foundation.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] iommu: exynos: pointers are nto physical addresses Date: Mon, 29 Feb 2016 09:45:59 +0100 Message-Id: <1456735568-3886545-1-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 X-Provags-ID: V03:K0:nM/NfYnyZnLpC7xc6UjSackLPhzQB5uvVnqjFsWvAG0jArENhzN +RU9M19ZLVSffz5ygwQJVhfhjDKUr7HvXcMwr3EzAIC+dZ1ci3ZMbB0mvjJzdYfV/IWRIse jVIWfTHHiDnVl6/daYYqSFWDa3Nny+NHdfitZB8Yiu5xAsNVIho13jvcbd4msyKdVwBW4Wy yo5kaFmMtVWxoGIno0msA== X-UI-Out-Filterresults: notjunk:1; V01:K0:/olG1ckZ2Zw=:aNx5aHiNs/HSXPYqthkFBq 618yPrZ4zqxxLnj/cKYbaPcbFJ+CAga1rcE+T6jcP1E+rx5pBDvbppmmdtPYrDB1155HD4WJ0 s/UHPw+YFpVig4WNkarZ31sqbJdBq/P7cy0cYfqv1PZ5ckJyOH+W742b5T8V/ZA9TGELhDyVr TfN0+mxHNadWcTdTSchGiF/2Vdb4nOoTTEknyZXYT6yVYlk21gvoaRzQbDDn1kng+AhD0zT/b AL7kaBPvBFhX4VrFcKl8vw2HAXtDufFTME/Uin25+DJX00Z3ywb3u/PAjOCq6f2Q5fe1748qM B2nqNRWTnLTRI1IqrUVWU9v3w/C3o+Br8GtHO69ywOhv2F9hK0Mlw7X/hdyVj7vIY/IVC5Kbw nLx+UiuVBSQPZL4WfS5miQaZ7eJtWLfyg9yd4DFM08pZugemwB9Bn+uFYD3+hci4Fs6LFiIUn +SoUL055jb7RRFrH13bjLJGsyi1AF3aXSuCkPxcaQKIzEy2cmojSe7Eah42fo4+DMcsndBqlj 7S3/ywmLfR+EFJl+faNC67V+XJ0pCQE5Ar+SAeEalvlj3om7UdkCr8LaIwo8rW6tpJb3/v0ds e6En0+uMI46AlPjngKvTCzdf4HKJ4iyOUILFsz96mbauOKAeID6VedC/rt6XDUAgQcW9AKliA fkDeaPUtHlowLUFHcWkVHmIV6VfezLfAnb/6ITFTI3QiNtU4jDdak3ynlQJgIGRYZVQY= Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org The exynos iommu driver changed an incorrect cast from pointer to 'unsigned int' to an equally incorrect cast to a 'phys_addr_t', which results in an obvious compile-time error when phys_addr_t is wider than pointers are: drivers/iommu/exynos-iommu.c: In function 'alloc_lv2entry': drivers/iommu/exynos-iommu.c:918:32: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] The code does not actually want the physical address (which would involve using virt_to_phys()), but just checks the alignment, so we can change it to use a cast to uintptr_t instead. Signed-off-by: Arnd Bergmann Fixes: 740a01eee9ad ("iommu/exynos: Add support for v5 SYSMMU") --- I also see that some incorrect __raw_writel() calls have crept in around the same time, which breaks running big-endian kernels when this driver is loaded. Please fix and that that as well. drivers/iommu/exynos-iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.0 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" 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/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c index b0665042bf29..484b3b37631f 100644 --- a/drivers/iommu/exynos-iommu.c +++ b/drivers/iommu/exynos-iommu.c @@ -915,7 +915,7 @@ static sysmmu_pte_t *alloc_lv2entry(struct exynos_iommu_domain *domain, bool need_flush_flpd_cache = lv1ent_zero(sent); pent = kmem_cache_zalloc(lv2table_kmem_cache, GFP_ATOMIC); - BUG_ON((phys_addr_t)pent & (LV2TABLE_SIZE - 1)); + BUG_ON((uintptr_t)pent & (LV2TABLE_SIZE - 1)); if (!pent) return ERR_PTR(-ENOMEM);