From patchwork Wed Jan 3 22:35:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 10143597 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EA7A06034B for ; Wed, 3 Jan 2018 22:36:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D78D5293C2 for ; Wed, 3 Jan 2018 22:36:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CBE9A293D3; Wed, 3 Jan 2018 22:36:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 83BEE293C2 for ; Wed, 3 Jan 2018 22:36:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751098AbeACWgD (ORCPT ); Wed, 3 Jan 2018 17:36:03 -0500 Received: from mout.kundenserver.de ([212.227.126.135]:55846 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751014AbeACWgC (ORCPT ); Wed, 3 Jan 2018 17:36:02 -0500 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue003 [212.227.15.129]) with ESMTPA (Nemesis) id 0LfFYi-1fHCtI40im-00omk0; Wed, 03 Jan 2018 23:35:49 +0100 From: Arnd Bergmann To: Yong Zhi , Sakari Ailus , Mauro Carvalho Chehab Cc: Arnd Bergmann , Rajmohan Mani , Hyungwoo Yang , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] media: intel-ipu3: cio2: fix building with large PAGE_SIZE Date: Wed, 3 Jan 2018 23:35:31 +0100 Message-Id: <20180103223546.3546694-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:1WpbsZ2r0V0oMm2O6y+pbRNN2CcJhZ44KRfjk/WHKLQTWVa0fo7 KR9ony3FEf+eN5lqmXYUMjwhpom/Mc+fr7AYZ1R6n/Ts219BH51t8Zvh3IjpNs5cr7bfSem ExkHxc33l/4OQPC0rKVDChk3pp/0kmltVQuThlEtbai/Q3VMo4ELQBxBrum9sLCWXudD4hY txNlYbZ8U55xr899BNhuQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:RzO/ApJGSvc=:+2kUZMW5oYfC3DWywJ2d2L lcJ32tyRqhY6pAugRpEXknNmPJ1mErKDkTAQpi5C26VMfeNPzjynCbPWUSUMQ+S2J8272V5yy G3+I22n5r8kw3V9QcrRrQOWaTFht7YZA/MKm61BnrIKqg18IClaopz1KpLq32q8gKCMt7r3U0 tUbcw1IeweazEDKGvlLZU51PQh5umT8nfpLul1hU/LkjLkYRR7taH664+Aml0HfK5sebtZ9Jy 5ohqtV6IOJVj0Ze4O+saPHrBNWdB8wEytmJyLPmntANO4bvEmdU6wgTUy0T39ITr2yfy6TG5D i2rAFT4tiyzIKN8y1yR55FIq1O9u2gbqcStXlxSz3mRwSwLS7hjj8zZ5rs+Q0dGtLUKIOp4sI QrGueVALUbXcwfWI8nbO4OZxUnVw2ET/n3HEzpBS+GVig+hvZa7DcNA+xQYxDi2j7Z+V9Kd5J aYAHT9QCWgzePz8uzQcoGu2/UBZF6pvHOaZe1Z9cuekplkUiYyE8eH4TYS9ar6p8aP+pLfmCL k7odddg3oduDolATUjv5U2lyLnE8QMLQ3AIn/VV2d1n65aqO4xEcB1CNj0+r7IPvmtiN4UaUe JdYLoAUpfLya4mRrVrggTejR2RDM1t8g/tezMCbRqvB9WCUCRYpAbJoy9A3GQzshqumFSkXzZ M2oZ09Pxwh97iSJ2ONz+SdvAzEE59edJ0FTwEftK11OH1nxxk2guDg2HjJ8+D7n+lOGS4DJPF zFVGXyKklDc89EVONNptJHzEMaqxNcn/oXihhuEBiJWWGlSj90I1hZsaM8k= Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The driver apparently assumes that the device uses the same page size as the CPU, but also assumes that this is 4096 bytes. On architectures with a larger page size like 65536 bytes, we get a warning about an integer overflow: drivers/media/pci/intel/ipu3/ipu3-cio2.c: In function 'cio2_fbpt_entry_init_dummy': arch/arm64/include/asm/page-def.h:28:20: error: large integer implicitly truncated to unsigned type [-Werror=overflow] #define PAGE_SIZE (_AC(1, UL) << PAGE_SHIFT) ^ drivers/media/pci/intel/ipu3/ipu3-cio2.h:404:26: note: in expansion of macro 'PAGE_SIZE' #define CIO2_PAGE_SIZE PAGE_SIZE ^~~~~~~~~ drivers/media/pci/intel/ipu3/ipu3-cio2.c:172:3: note: in expansion of macro 'CIO2_PAGE_SIZE' CIO2_PAGE_SIZE / sizeof(u32) * CIO2_MAX_LOPS; Obviously this won't work, but the driver is also unlikely to ever be used on such an architecture, so the easiest workaround is to define the CIO2_PAGE_SIZE macro to the size that the hardware actually uses. Fixes: c2a6a07afe4a ("media: intel-ipu3: cio2: add new MIPI-CSI2 driver") Signed-off-by: Arnd Bergmann --- drivers/media/pci/intel/ipu3/ipu3-cio2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/pci/intel/ipu3/ipu3-cio2.h b/drivers/media/pci/intel/ipu3/ipu3-cio2.h index 1a559990920f..78a5799f08e7 100644 --- a/drivers/media/pci/intel/ipu3/ipu3-cio2.h +++ b/drivers/media/pci/intel/ipu3/ipu3-cio2.h @@ -401,7 +401,7 @@ struct cio2_device { sizeof(struct cio2_fbpt_entry)) #define CIO2_FBPT_SUBENTRY_UNIT 4 -#define CIO2_PAGE_SIZE PAGE_SIZE +#define CIO2_PAGE_SIZE 4096 /* cio2 fbpt first_entry ctrl status */ #define CIO2_FBPT_CTRL_VALID BIT(0)