From patchwork Mon Nov 23 13:39:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 547531 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id CF8A81402B7 for ; Tue, 24 Nov 2015 00:42:57 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1a0rLg-0004VC-0d; Mon, 23 Nov 2015 13:40:04 +0000 Received: from mout.kundenserver.de ([212.227.126.134]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1a0rLZ-0004TW-Kt; Mon, 23 Nov 2015 13:39:58 +0000 Received: from wuerfel.localnet ([134.3.118.24]) by mrelayeu.kundenserver.de (mreue004) with ESMTPSA (Nemesis) id 0LkDhW-1abqqy1SCw-00c9aH; Mon, 23 Nov 2015 14:39:34 +0100 From: Arnd Bergmann To: Brian Norris , linux-mtd@lists.infradead.org Subject: [PATCH] mtd: cfi: enforce valid geometry configuration Date: Mon, 23 Nov 2015 14:39:33 +0100 Message-ID: <3747078.dk5V5gxuXa@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) MIME-Version: 1.0 X-Provags-ID: V03:K0:nsb7M7T3S5kkRy7WYD/9GMdov7gthsg4+8+0XaxB8moDDvU1Y9N 5Tzor4BBSkaiBYqfGz4nsEFKDTOBAmjcMx+jp4SHmqSBoZ8THHFmikEAitkCopNSNb1dHWS Gc3DbcHu2QtJBNLxde4nsS/xMYdHGX8EFToEdVFyt4Yg9+pQ/qAGF9voGfJw0bloP4cNpvd Q+04zKiY4D9hQqRp66Z2g== X-UI-Out-Filterresults: notjunk:1; V01:K0:4uR8pa/JBek=:h9eSsvmprsZ20Tj0mPxxaO XHw64/1Um4AEQQrYmPnYsEAQ7PQ6VuYLI2hNogMPciVm5maim2SDjtFclRz5zIa8gdfpJ/28f PuPMyO4Sn6Tz8tQMIO9OP2MnDoY0P65q6ZiwbjzKJcbro1B3ndPFp5kEDQFSN3DSQZiE8o7/z VqIwYIGUohXB4rANeNqK/LTMP1sEGrtiMim3peViErhLLCRpMt59oV8iqPaReMZlXp1GT8Hnx G/SqIbeFrV+jGde4Oj1gtSDm3qfcrEokJGF6S52bMVd7l27xGZAFsUEDcuWVpmSN0sQbZgwNV JK0NzC90yxozQilax5fFXjD5VEw3Hg58qjW+Yan5Ah9vpRIQ8noXQ5tZa3PxIHqJTcEFkqtxp gxCOSJswT5er6yU/xQndaXkQp2+JbdPSphquKwqfhg2wn8OXB2zY0EQdywDep/Fg10Kk0d1D4 gUsqfWGGCPrPVm+hsuF1BKIa23FL3r9OTDoei/nQre4FZGDaaZz0DhVcf0dnQGh3Q7rzjuQ0o A665+QyH/L7ecRH+ZY9R+FWRRuhzBAYK2T+w4qg/NE/PZzV8AmyRPJufNrhZeBXKftEym5+B9 u7zTlsZVvlMyxkkOgFuKScRIqlxBFf4vjsobsXHEwyk5i6er5/Ru3ifCNgTcRATM39PhPTPWZ ksUSVwEI2JoTmQIAPthxVytuOJ6OPxIX6pMf2d2J7tMQ3OtNyPzf07pVnqsQuUqsqVbKWt0nI W05yxdL/ndKYDTrT X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151123_053958_134240_0F034757 X-CRM114-Status: GOOD ( 13.37 ) 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_MSPIKE_H2 RBL: Average reputation (+2) [212.227.126.134 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [212.227.126.134 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Woodhouse , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org MTD allows compile-time configuration of the possible CFI geometry settings that are allowed by the kernel, but that includes a couple of invalid configurations, where no bank width or no interleave setting is allowed. These are then caught with a compile-time warning: include/linux/mtd/cfi.h:76:2: warning: #warning No CONFIG_MTD_CFI_Ix selected. No NOR chip support can work. include/linux/mtd/map.h:145:2: warning: #warning "No CONFIG_MTD_MAP_BANK_WIDTH_xx selected. No NOR chip support can work" This is a bit annoying for randconfig tests, and can be avoided if we change the Kconfig logic to always select the simplest configuration when no other one is enabled. Signed-off-by: Arnd Bergmann diff --git a/drivers/mtd/chips/Kconfig b/drivers/mtd/chips/Kconfig index 63b6b536b044..741ec69e0b46 100644 --- a/drivers/mtd/chips/Kconfig +++ b/drivers/mtd/chips/Kconfig @@ -69,6 +69,10 @@ endchoice config MTD_CFI_GEOMETRY bool "Specific CFI Flash geometry selection" depends on MTD_CFI_ADV_OPTIONS + select MTD_MAP_BANK_WIDTH_1 if !(MTD_MAP_BANK_WIDTH_2 || \ + MTD_MAP_BANK_WIDTH_4 || MTD_MAP_BANK_WIDTH_8 || \ + MTD_MAP_BANK_WIDTH_16 || MTD_MAP_BANK_WIDTH_32) + select MTD_CFI_I1 if !(MTD_CFI_I2 || MTD_CFI_I4 || MTD_CFI_I8) help This option does not affect the code directly, but will enable some other configuration options which would allow you to reduce